UFTRACE-DUMP(1)

πŸŽ€ NAME πŸŽ€

so this is uftrace-dump bestie πŸ’– β€” from the General Commands Manual corner of the universe β€” and it prints the raw tracing data chillin' in your data files. no filter, no glow-up, just the real real.


πŸ¦‹ SYNOPSIS πŸ¦‹

uftrace dump [options]

✨ DESCRIPTION ✨

okay so picture this: this command shows you the raw tracing data that got recorded into the data file 🌸. it's giving "behind the scenes, unedited footage" and honestly? iconic.

and the tea is you can configure the dump format with extra options, like --chrome, --flame-graph, or --graphviz πŸ’…. choose your own adventure, diva.


πŸ”₯ DUMP OPTIONS πŸ”₯

  • --chrome β€” shows JSON style output, the exact flavor the Google Chrome tracing facility eats up πŸ“
  • --flame-graph β€” shows FlameGraph style output, viewable in modern web browsers (after the FlameGraph tool has done its lil processing pass on it) πŸ”₯
  • --graphviz β€” shows DOT style output, the kind the graphviz toolkit fw πŸ’œ
  • --mermaid β€” shows the graph as a mermaid flowchart diagram ✨ it can be rendered right in the browser, no cap
  • --debug β€” also shows a hex dump of the data 🫢 like, yes, the hex, we're going there
  • --sample-time=TIME β€” applies a sampling time when generating output for --flame-graph 🌸 by default it tries to find a period from 1 usec to 1 sec where it keeps the total number of samples under 1 million (in a single-threaded program). you can override the sampling time with this option explicitly, main character move. **note: functions which ran less than the sampling time will be removed from the output 😭 and functions that ran longer than the time will be shown as larger πŸ’…
  • --no-args β€” do not show function arguments and return value πŸ™ˆ

🌸 COMMON OPTIONS 🌸

  • *-F *FUNC, --filter=FUNC β€” sets a filter so only selected functions and their children functions get traced πŸŽ€ this option can be used more than once. see uftrace-replay(1) for an explanation of filters.
  • -N FUNC, --notrace=FUNC β€” sets a filter so selected functions and their children functions do **not get traced πŸ’€ this option can be used more than once. see uftrace-replay(1) for an explanation of filters.
  • *-C *FUNC, --caller-filter=FUNC β€” sets a filter to trace only the callers of selected functions πŸ‘‘ this option can be used more than once. see uftrace-replay(1) for an explanation of filters.
  • *-T *TRG, --trigger=TRG β€” sets a trigger on selected functions ⚑ this option can be used more than once. see uftrace-replay(1) for an explanation of triggers.
  • *-D *DEPTH, --depth=DEPTH β€” sets the trace limit in nesting level πŸͺ†
  • -t TIME, --time-filter=TIME β€” do not show functions which run under the time threshold πŸ• if some functions explicitly have the trace trigger applied, those are **always traced regardless of execution time. periodt.
  • *-Z *SIZE, --size-filter=SIZE β€” do not show functions smaller than SIZE bytes πŸ“
  • *-L *LOCATION, --loc-filter=LOCATION β€” sets a filter to trace selected source locations πŸ—ΊοΈ this option can be used more than once.
  • --no-libcall β€” do not show library calls πŸ™…
  • --no-event β€” do not show any events 🚫 implies --no-sched.
  • --no-sched β€” do not show schedule events πŸ›‘
  • *--match=TYPE* β€” use pattern match using TYPE πŸ” possible types are regex and glob. default is regex.
  • *--with-syms=DIR* β€” read symbol data from the .sym files in DIR directory instead of the binary πŸ‘€ this can be useful to deal with stripped binaries. the file name of the main binary should be the same when saved and used β€” no funny business.

πŸ’œ COMMON ANALYSIS OPTIONS πŸ’œ

  • -H FUNC, --hide=FUNC β€” sets a filter **not to trace selected functions πŸ™ˆ it doesn't affect their subtrees, it hides only the given functions. this option can be used more than once. see uftrace-replay(1) for an explanation of filters.
  • --kernel-full β€” show all kernel functions called outside of user functions 🌌 this option is only meaningful when used with --chrome, --flame-graph or --graphviz options.
  • --kernel-only β€” dump kernel functions only, without user functions 🧚
  • --event-full β€” show all (user) events outside of user functions πŸŽ‰ this option is only meaningful when used with --chrome, --flame-graph or --graphviz options.
  • *--tid=TID*[,TID,...] β€” only print functions called by the given tasks πŸ‘― to see the list of tasks in the data file, you can use uftrace report --task or uftrace info. this option can also be used more than once.
  • *--demangle=TYPE* β€” use demangled C++ symbol names for filters, triggers, arguments and/or return values πŸ’– possible values are full, simple and no. default is simple, which ignores function arguments and template parameters.
  • *-r *RANGE, --time-range=RANGE β€” only show functions executed within the time RANGE ⏳ the RANGE can be <start>~<stop> (separated by ~) and one of <start> and <stop> can be omitted. the <start> and <stop> are timestamp or elapsed time if they have <time_unit> postfix, for example 100us. the timestamp or elapsed time can be shown with -f time or -f elapsed option respectively in uftrace replay(1).

🌈 EXAMPLE 🌈

this command dumps data like below, bestie β€” feast your eyes 😌✨

$ uftrace record abc

$ uftrace dump
uftrace file header: magic         = 4674726163652100
uftrace file header: version       = 4
uftrace file header: header size   = 40
uftrace file header: endian        = 1 (little)
uftrace file header: class         = 2 (64 bit)
uftrace file header: features      = 0x63 (PLTHOOK | TASK_SESSION | SYM_REL_ADDR | MAX_STACK)
uftrace file header: info          = 0x3ff

reading 23043.dat
105430.415350255  23043: [entry] __monstartup(4004d0) depth: 0
105430.415351178  23043: [exit ] __monstartup(4004d0) depth: 0
105430.415351932  23043: [entry] __cxa_atexit(4004f0) depth: 0
105430.415352687  23043: [exit ] __cxa_atexit(4004f0) depth: 0
105430.415353833  23043: [entry] main(400512) depth: 0
105430.415353992  23043: [entry] a(4006b2) depth: 1
105430.415354112  23043: [entry] b(4006a0) depth: 2
105430.415354230  23043: [entry] c(400686) depth: 3
105430.415354425  23043: [entry] getpid(4004b0) depth: 4
105430.415355035  23043: [exit ] getpid(4004b0) depth: 4
105430.415355549  23043: [exit ] c(400686) depth: 3
105430.415355761  23043: [exit ] b(4006a0) depth: 2
105430.415355943  23043: [exit ] a(4006b2) depth: 1
105430.415356109  23043: [exit ] main(400512) depth: 0

$ uftrace dump --chrome -F main
{"traceEvents":[
{"ts":105430415353,"ph":"B","pid":23043,"name":"main"},
{"ts":105430415353,"ph":"B","pid":23043,"name":"a"},
{"ts":105430415354,"ph":"B","pid":23043,"name":"b"},
{"ts":105430415354,"ph":"B","pid":23043,"name":"c"},
{"ts":105430415354,"ph":"B","pid":23043,"name":"getpid"},
{"ts":105430415355,"ph":"E","pid":23043,"name":"getpid"},
{"ts":105430415355,"ph":"E","pid":23043,"name":"c"},
{"ts":105430415355,"ph":"E","pid":23043,"name":"b"},
{"ts":105430415355,"ph":"E","pid":23043,"name":"a"},
{"ts":105430415356,"ph":"E","pid":23043,"name":"main"}
], "metadata": {
"command_line":"uftrace record abc ",
"recorded_time":"Tue May 24 19:44:54 2016"
} }

$ uftrace dump --flame-graph --sample-time 1us
main 1
main;a;b;c 1

$ uftrace dump --graphviz
\# command_line "uftrace record tests/t-abc"
digraph "/home/m/git/uftrace/tests/t-abc" {
        \# Attributes
        splines=ortho;
        concentrate=true;
        node [shape="rect",fontsize="7",style="filled"];
        edge [fontsize="7"];
        \# Elements
        main[xlabel = "Calls : 1"]
        main->a[xlabel = "Calls : 1"]
        a->b[xlabel = "Calls : 1"]
        b->c[xlabel = "Calls : 1"]
        c->getpid[xlabel = "Calls : 1"]
}

πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, they're all part of the same friend group 🫢


🫢 AUTHORS 🫢

Namhyung Kim namhyung@gmail.com β€” thank you for your service king πŸ‘‘


and that's the whole page, babe πŸ’– this was the Uftrace User Manuals edition, dated Sep, 2018 β€” uftrace-dump(1) girlies rise up, you're all caught up now βœ¨πŸŒˆπŸ’…

πŸ“¦ where this page comes from