XRef
Documentation menu
xrefcode.com / docs / cli / tree

$ xref tree

On this page
  1. Usage
  2. Arguments and options
  3. Examples
  4. Tree 0xd0aa0 --callers --depth 2
  5. Tree 0x9ef60 --callees --depth 2
  6. Reading the output
  7. Limits
  8. Provenance

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>
Root function (address or symbol name).

Options

--callers
Show callers instead of callees.
--callees
Show callees (default).
--depth <DEPTH>
Maximum tree depth.
default 3
--with-observed <WITH_OBSERVED>
Explicit observed-edge store tied to this binary; sample counts are not call counts.

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.

Command
$ xref -b xref.stripped tree 0xd0aa0 --callers --depth 2
Output
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:44
stderr
xref: load 559.5µs, total 3.0ms

Tree 0x9ef60 --callees --depth 2

2-hop downward callee tree rooted at 0x9ef60.

Command
$ xref -b xref.stripped tree 0x9ef60 --callees --depth 2
Output
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 0x6d730
stderr
xref: load 499.8µs, total 2.7ms

Reading the output

Limits

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.