> 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="https://449949240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2ZTr9umTUpVzGSJHbuR%2Fuploads%2FUvpZeamSpTAOUha9On57%2Fimage.png?alt=media&amp;token=5d109199-abd7-46b9-8d13-27013040c92a" 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="https://449949240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2ZTr9umTUpVzGSJHbuR%2Fuploads%2FJJTaM93RqHnBivK3KzaB%2Fimage.png?alt=media&amp;token=39cc0e42-973a-4c59-addb-24a7f5a6fc6e" alt=""><figcaption><p>Filter Functions</p></figcaption></figure>

<figure><img src="https://449949240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2ZTr9umTUpVzGSJHbuR%2Fuploads%2F6HSTrlJxwlLaKMIJ5M27%2Fimage.png?alt=media&amp;token=76c9eb86-9881-4025-98cd-4a10b9342442" 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="https://449949240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2ZTr9umTUpVzGSJHbuR%2Fuploads%2FYNmHFLiTaCpb1cWLtUUT%2Fimage.png?alt=media&amp;token=2df6187f-12a3-4a0a-9625-d1fa3dc8dd99" alt=""><figcaption><p>Visualized relations on the Call Graph</p></figcaption></figure>
