$ xref tree
On this page
Indented caller or callee tree of a function, with ranges and first panic locations.
Finds shortest call chains between two functions and prints indented caller/callee trees annotated with panic source locations.
Usage
xref tree [OPTIONS] <ADDR>
Arguments and options
Arguments
<ADDR>Options
--callers--callees--depth <DEPTH>--with-observed <WITH_OBSERVED>Examples
All examples were recorded on public binaries; see Provenance.
Tree 0xd0aa0 --callers --depth 2
2-hop upward caller tree from 0xd0aa0 across loops.rs -> unrotate.rs -> cfg.rs.
$ xref -b xref.stripped tree 0xd0aa0 --callers --depth 2
0xd0aa0..0xd0d73 src/loops.rs:33:18
0xc7fc0..0xd0a9d at 0xcbe5e x2 src/unrotate.rs:133:22
0xb43a0..0xbb5da at 0xb6793 src/cfg.rs:169:44xref: load 559.5µs, total 3.0ms
Tree 0x9ef60 --callees --depth 2
2-hop downward callee tree rooted at 0x9ef60.
$ xref -b xref.stripped tree 0x9ef60 --callees --depth 2
0x9ef60..0x9f518 src/image.rs:46:20
0x131ec0..0x131f23 at 0x9f17c
0x129030..0x12916c at 0x131ef5
0x1267c5..0x1267d8 at 0x131f1e
0x86340..0x863bd at 0x9f300
0xa6aa0..0xa6bfc at 0x86388
0x1267c5..0x1267d8 at 0x863a9 x2
0x15fe80..0x15ff45 at 0x9f366
0x15e180..0x15e1ab at 0x15fec2 x3
0x6d5e0..0x6d735 at 0x9f50e
0x85920..0x8633f at 0x6d730xref: load 499.8µs, total 2.7ms
Reading the output
- The root line is the function and its first panic location; each indented line is a caller (with
--callers) or callee, the call site (at …,x2when there are several) and its first panic location. --depthsets how many levels are expanded.
Limits
- Only direct calls, tail jumps and visible pointer slots are followed.
Provenance
Recorded with a development build of xref after 0.4.0 on Linux x86-64, on xref.stripped = a stripped xref build (the binary of the home-page examples). Output is unchanged except that whitespace at the end of each line and empty lines at the end of the output are removed; long outputs are cut where marked.
Source: docs/cli/tree.md · generated for the site; edit the Markdown, not this page.