> For the complete documentation index, see [llms.txt](https://docs.loci-dev.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.loci-dev.net/loci-inspector/call-graph-analysis/call-graph-inspector.md).

# Call Graph Inspector

The Call Graph Inspector renders the function call graph for a selected project version as an interactive, progressively expandable graph. The initial view surfaces the highest-impact functions ranked by Response Time. From there, the full graph is explored node by node through on-demand expansion. The canvas supports scroll-to-zoom and click-and-drag panning; any node can be repositioned by dragging.

<figure><img src="/files/OzRs3DOHVGFx6K5oC7bG" alt=""><figcaption><p>Call Graph Inspector</p></figcaption></figure>

***

### Graph Layout and Containers

Functions appear as nodes grouped in color-coded cluster subgraphs — one cluster per binary. Each cluster carries a draggable label identifying the binary. Nodes move freely anywhere on the canvas.

When multiple binaries are selected, all are loaded simultaneously and cross-binary call edges are drawn wherever they exist.

***

### Nodes

Each node represents a single function from the analyzed binary. The node label shows the short function name. Clicking a node opens its **Expansion Panel**, which displays the fully-qualified name alongside the three timing metrics below.

#### Timing Metrics

| Metric              | Definition                                                                        |
| ------------------- | --------------------------------------------------------------------------------- |
| **Response Time**   | Worst-case time from function entry to exit, including all time spent in callees. |
| **Throughput Time** | Worst-case time from function entry to exit, excluding time spent in callees.     |
| **Bottleneck Time** | Worst-case time spent consecutively inside the function body.                     |

All three values display in the most readable unit (ns / µs / ms / s). A dash (`--`) indicates no data was recorded for that function.

#### Node Colors

| Color  | Meaning                                         |
| ------ | ----------------------------------------------- |
| Blue   | Default — function is rendered but not selected |
| Orange | Selected — the most recently clicked function   |

***

### Relations

Each directed edge represents an observed call from one function to another, derived directly from collected execution traces.

#### Edge Labels

Every edge shows a call count — the number of times that specific call was recorded across all collected execution traces.

#### Edge Colors

Colors are relative to the currently selected node and reset each time the selection changes.

| Color  | Meaning                                                           |
| ------ | ----------------------------------------------------------------- |
| Gray   | Default — not connected to the selected node, or no node selected |
| Orange | Outgoing — the call originates from the selected function         |
| Purple | Incoming — the call terminates at the selected function           |

#### Edge Style

All edges are Bézier curves with a triangle arrowhead pointing toward the callee. Self-referencing calls (recursive functions) render as looped arcs.

***

### Expansion Panel

Clicking any function opens the Expansion Panel, which shows:

* **Function name** — short and fully-qualified
* **Response Time**, **Throughput Time**, and **Bottleneck Time** for that function
* **Incoming edges** — count of edges currently visible versus total available
* **Outgoing edges** — same counter

Edges are added directly from the panel in two ways:

| Button         | Action                                              |
| -------------- | --------------------------------------------------- |
| **+10**        | Loads the next 10 edges in that direction           |
| **Expand All** | Loads all remaining edges in that direction at once |

***

### Initial Graph Load

On load, the graph surfaces a ranked subset of functions and a bounded number of edges per function. Functions with the highest Response Time load first — the most impactful call chains are always visible by default.

Load limits are adjustable in the **Advanced Options** panel:

| Setting                        | Default | Description                                                                              |
| ------------------------------ | ------- | ---------------------------------------------------------------------------------------- |
| Total Functions (Maximum)      | 50      | Upper bound on functions loaded across all selected binaries                             |
| Functions per Binary (Minimum) | 10      | Each binary contributes at least this many functions, even when the total cap is reached |
| Edges per Function (Maximum)   | 3       | Number of outgoing edges loaded per function in the initial view                         |

***

### Filtering and Search

The filter bar accepts a text query matched against function names. Three match modes are available:

| Mode                | Behavior                                      |
| ------------------- | --------------------------------------------- |
| Substring (default) | Functions whose name contains the query       |
| Whole Word          | Functions whose name exactly equals the query |
| Regex               | Treats the query as a regular expression      |

Case sensitivity toggles independently of the match mode.

The filter panel also provides:

* **Binary selection** — show or hide individual binaries
* **Advanced Options** (tune icon) — adjust the load limits described above

Applying new filter settings clears the current graph and reloads it from scratch.

<figure><img src="/files/mFT60rXDhurbqQJ5zwdb" alt=""><figcaption><p>Filter Functions</p></figcaption></figure>

<figure><img src="/files/ps8PvN7v88vJVvt8o62F" alt=""><figcaption><p>Focus on Function</p></figcaption></figure>

***

### Toolbar Controls

| Control                         | Action                                                                                 |
| ------------------------------- | -------------------------------------------------------------------------------------- |
| **Focus on function…** dropdown | Centers and zooms the viewport onto any visible function and opens its Expansion Panel |
| **Reset**                       | Clears the graph and reloads with the current filter settings                          |
| **Zoom Out**                    | Fits the entire graph into the viewport                                                |

***

### Tooltips

Hovering over an edge shows a tooltip identifying the source and target functions:

```
<source function> → <target function>
```

The tooltip follows the cursor and disappears when the cursor leaves the edge.

<figure><img src="/files/qNaVSXJWSeryQRdYm4e1" alt=""><figcaption><p>Visualized relations on the Call Graph</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.loci-dev.net/loci-inspector/call-graph-analysis/call-graph-inspector.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
