UFTRACE(1)

✨ UFTRACE(1) ✨

okay bestie, welcome to the General Commands Manual entry for uftrace(1) β€” like, THE function graph tracer for userspace. buckle up πŸŽ€


πŸ’– NAME πŸ’–

uftrace β€” Function graph tracer for userspace


🌸 SYNOPSIS 🌸

uftrace [record|replay|live|report|info|dump|recv|graph|script|tui]
[options] COMMAND [command-options]

πŸ¦‹ DESCRIPTION πŸ¦‹

so. uftrace is a function tracer, and what it does is trace the execution of whatever COMMAND you hand it, but at the function level. that's the whole vibe. ✨

COMMAND has to be a C or C++ executable that was built with compiler instrumentation β€” we're talking -pg or -finstrument-functions. and it also needs an ELF symbol table (so basically: don't let anyone strip(1) it 😭), otherwise there's no way to get the names of the functions being traced. no names, no trace, no slay.

the uftrace command is made up of a bunch of sub-commands, structured the way git(1) or perf(1) do it. below is a short lil description of each sub-command β€” for the full tea, go read the respective manual pages. and heads up: the options on this page can be given to any sub-command. πŸ’…

for convenience, if you don't give a sub-command at all, uftrace just acts like you said the live sub-command β€” which runs record and replay one after the other. see uftrace-live(1) for the options that belong to live. but ngl, if you want more detailed analysis it's genuinely better to use uftrace-record(1) to save your trace data, and then analyze it with the other uftrace commands like uftrace-replay(1), uftrace-report(1), uftrace-info(1), uftrace-dump(1), uftrace-script(1) or uftrace-tui(1). save first, analyze later, that's the main character pipeline. πŸ‘‘


🌈 SUB-COMMANDS 🌈

  • record β€” run a given command and save the trace data in a data file or directory.
  • replay β€” print recorded function trace data with time durations.
  • live β€” do live tracing. print the function trace of the given command.
  • report β€” print various statistics and summary of the recorded trace data.
  • info β€” print side-band information like OS version, CPU info, command line and so on.
  • dump β€” print raw tracing data in the data files.
  • recv β€” save tracing data sent to network.
  • graph β€” print function call graph.
  • script β€” run a script for recorded function trace.
  • tui β€” show text user interface for graph and report.

πŸ’… COMMON OPTIONS πŸ’…

these are the common options that all uftrace subcommands support, periodt:

  • -h, --help β€” print help message and list of options with description.
  • --usage β€” print usage string.
  • -V, --version β€” print program version.
  • -v, --verbose β€” print verbose messages. this one bumps up a debug level and you can use it at most 3 times.
  • --debug β€” print debug messages. it's literally the same as -v/--verbose and it exists only for backward compatibility. lowkey legacy behavior, we love her anyway 🫢
  • --debug-domain=DOMAIN[,DOMAIN, ...] β€” limit the printing of debug messages to those belonging to one of the DOMAINs you specified. available domains are: uftrace, symbol, demangle, filter, fstack, session, kernel, mcount, dynamic, event, script and dwarf. each domain can optionally have its own debug level (preceded by a colon). for example, -v --debug-domain=filter:2 will apply debug level of 2 to the β€œfilter” domain and apply debug level of 1 to all the others. give the girl her own volume knob ✨
  • -d DATA, --data=DATA β€” specify name of trace data (directory). default is uftrace.data.
  • --logfile=FILE β€” save warning and debug messages into this file instead of stderr.
  • --color=VAL β€” enable or disable color on the output. possible values are β€œyes” (= β€œtrue” | β€œ1” | β€œon”), β€œno” (= β€œfalse” | β€œ0” | β€œoff”) and β€œauto”. the β€œauto” value is the default and turns on coloring if stdout is a terminal. 🌈
  • --no-pager β€” do not use a pager.
  • --opt-file=FILE β€” read command-line options from the FILE.

πŸŽ€ SUBCOMMAND-SPECIFIC OPTIONS πŸŽ€

these are listed here for completeness, but bestie, they're only effective with specific subcommands. so don't come for me if they don't do anything in your context.

for more info please see the uftrace-<subcommand> manual pages. and the manual for uftrace-live(1) is special: the live subcommand does record and replay internally, so that one describes most regular options in detail. πŸ’–

  • --avg-self β€” show average/min/max of self function time.
  • --avg-total β€” show average/min/max of total function time.
  • -a, --auto-args β€” show arguments and return value of known functions.
  • -A, --argument=FUNC@arg[,arg,...] β€” show function arguments.
  • -b, --buffer=SIZE β€” size of tracing buffer (default: 128K).
  • --chrome β€” dump recorded data in chrome trace format.
  • --clock β€” set clock source for timestamp (default: mono).
  • --column-offset=DEPTH β€” offset of each column (default: 8).
  • --column-view β€” print tasks in separate columns.
  • -C, --caller-filter=FUNC β€” only trace callers of those FUNCs.
  • --demangle=TYPE β€” C++ symbol demangling: full, simple, no (default: simple).
  • --diff=DATA β€” report differences.
  • --diff-policy=POLICY β€” control diff report policy (default: abs,compact,no-percent).
  • --disable β€” start with tracing disabled.
  • -D, --depth=DEPTH β€” trace functions within DEPTH.
  • -e, --estimate-return β€” use only entry record type for safety.
  • --event-full β€” show all events outside of function.
  • -E, --Event=EVENT β€” enable EVENT to save more information.
  • --flame-graph β€” dump recorded data in FlameGraph format.
  • --flat β€” use flat output format.
  • --force β€” trace even if executable is not instrumented.
  • --format=FORMAT β€” use FORMAT for output: normal, html (default: normal).
  • -f, --output-fields=FIELD β€” show FIELDs in the replay or graph output.
  • -F, --filter=FUNC β€” only trace those FUNCs.
  • -g, --agent β€” start an agent in mcount to listen to commands.
  • --graphviz β€” dump recorded data in DOT format.
  • -H, --hide=FUNC β€” hide FUNCs from trace.
  • --host=HOST β€” send trace data to HOST instead of write to file.
  • -k, --kernel β€” trace kernel functions also (if supported). πŸ‘€
  • --keep-pid β€” keep same pid during execution of traced program.
  • --kernel-buffer=SIZE β€” size of kernel tracing buffer (default: 1408K).
  • --kernel-full β€” show kernel functions outside of user.
  • --kernel-only β€” dump kernel data only.
  • --kernel-skip-out β€” skip kernel functions outside of user (deprecated).
  • -K, --kernel-depth=DEPTH β€” trace kernel functions within DEPTH.
  • --libmcount-single β€” use single thread version of libmcount.
  • --list-event β€” list available events.
  • --logfile=FILE β€” save warning and debug messages into this file instead of stderr.
  • -l, --nest-libcall β€” show nested library calls.
  • --libname β€” show libname name with symbol name.
  • --libmcount-path=PATH β€” load libmcount libraries from this PATH.
  • --match=TYPE β€” support pattern match: regex, glob (default: regex).
  • --max-stack=DEPTH β€” set max stack depth to DEPTH (default: 65535).
  • --no-args β€” do not show arguments and return value.
  • --no-comment β€” don’t show comments of returned functions.
  • --no-event β€” disable (default) events.
  • --no-sched β€” disable schedule events.
  • --no-sched-preempt β€” hide pre-emptive schedule event but show regular(sleeping) schedule event.
  • --no-libcall β€” don’t trace library function calls.
  • --no-merge β€” don’t merge leaf functions.
  • --no-pltbind β€” do not bind dynamic symbols (LD_BIND_NOT).
  • --no-randomize-addr β€” disable ASLR (Address Space Layout Randomization).
  • --nop β€” no operation (for performance test).
  • --num-thread=NUM β€” create NUM recorder threads.
  • -N, --notrace=FUNC β€” don’t trace those FUNCs.
  • -p, --pid=PID β€” connect to the PID of an interactive mcount instance.
  • --port=PORT β€” use PORT for network connection (default: 8090).
  • -P, --patch=FUNC β€” apply dynamic patching for FUNCs.
  • --record β€” record a new trace before running given script.
  • --report β€” show a live report before replay.
  • --rt-prio=PRIO β€” record with real-time (FIFO) priority.
  • -r, --time-range=TIME~TIME β€” show output within the TIME (timestamp or elapsed time) range only.
  • --run-cmd=CMDLINE β€” command line that want to execute after tracing data received.
  • -R, --retval=FUNC[@retspec] β€” show function return values for FUNC, optionally with given uftrace retspec.
  • --sample-time=TIME β€” show flame graph with this sampling time.
  • --signal=SIGNAL@act[,act,...] β€” trigger the given actions when the given SIGNAL is received.
  • --sort-column=INDEX β€” sort diff report on column INDEX (default: 2).
  • --srcline β€” enable recording source line info.
  • --symbols β€” print symbol table instead of the recorded tracing info.
  • -s, --sort=KEY[,KEY,...] β€” sort reported functions by KEYs (default: 2).
  • -S, --script=SCRIPT β€” run a given SCRIPT in function entry and exit.
  • -t, --time-filter=TIME β€” hide small functions run less than the TIME.
  • --task β€” print task relationship in a tree form instead of the tracing info.
  • --task-newline β€” interleave a newline when task is changed.
  • --tid=TID[,TID,...] β€” only replay those tasks.
  • --time β€” print time information.
  • -T, --trigger=FUNC@act[,act,...] β€” trigger action on those FUNCs.
  • -U, --unpatch=FUNC β€” don’t apply dynamic patching for FUNCs.
  • --with-syms=DIR β€” use symbol files in the DIR.
  • -W, --watch=POINT β€” watch and report POINT if it’s changed.
  • -Z, --size-filter=SIZE β€” apply dynamic patching for functions bigger than SIZE.

for more detail about these command-specific options, please see the more specific manual pages listed below. 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

uftrace-live(1), uftrace-record(1), uftrace-replay(1), uftrace-report(1), uftrace-info(1), uftrace-dump(1), uftrace-recv(1), uftrace-graph(1), uftrace-script(1), uftrace-tui(1)


🧚 AUTHORS 🧚

Namhyung Kim namhyung@gmail.com


and that's the whole page, bestie!! this one came straight out of the Uftrace User Manuals, dated Sep, 2018, under the title UFTRACE(1). iconic, historic, obsessed. go trace something πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from