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/--verboseand 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 theDOMAINs you specified. available domains are:uftrace,symbol,demangle,filter,fstack,session,kernel,mcount,dynamic,event,scriptanddwarf. each domain can optionally have its own debug level (preceded by a colon). for example,-v --debug-domain=filter:2will 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 isuftrace.data.--logfile=FILEβ save warning and debug messages into this file instead ofstderr.--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 ifstdoutis a terminal. π--no-pagerβ do not use a pager.--opt-file=FILEβ read command-line options from theFILE.
π 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 thoseFUNCs.--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 withinDEPTH.-e,--estimate-returnβ use only entry record type for safety.--event-fullβ show all events outside of function.-E,--Event=EVENTβ enableEVENTto 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β useFORMATfor output:normal,html(default:normal).-f,--output-fields=FIELDβ showFIELDs in thereplayorgraphoutput.-F,--filter=FUNCβ only trace thoseFUNCs.-g,--agentβ start an agent in mcount to listen to commands.--graphvizβ dump recorded data in DOT format.-H,--hide=FUNCβ hideFUNCs from trace.--host=HOSTβ send trace data toHOSTinstead 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 withinDEPTH.--libmcount-singleβ use single thread version of libmcount.--list-eventβ list available events.--logfile=FILEβ save warning and debug messages into this file instead ofstderr.-l,--nest-libcallβ show nested library calls.--libnameβ show libname name with symbol name.--libmcount-path=PATHβ load libmcount libraries from thisPATH.--match=TYPEβ support pattern match:regex,glob(default:regex).--max-stack=DEPTHβ set max stack depth toDEPTH(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β createNUMrecorder threads.-N,--notrace=FUNCβ donβt trace thoseFUNCs.-p,--pid=PIDβ connect to thePIDof an interactive mcount instance.--port=PORTβ usePORTfor network connection (default:8090).-P,--patch=FUNCβ apply dynamic patching forFUNCs.--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 theTIME(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 forFUNC, optionally with given uftraceretspec.--sample-time=TIMEβ show flame graph with this sampling time.--signal=SIGNAL@act[,act,...]β trigger the given actions when the givenSIGNALis received.--sort-column=INDEXβ sort diff report on columnINDEX(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 byKEYs (default:2).-S,--script=SCRIPTβ run a givenSCRIPTin function entry and exit.-t,--time-filter=TIMEβ hide small functions run less than theTIME.--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 thoseFUNCs.-U,--unpatch=FUNCβ donβt apply dynamic patching forFUNCs.--with-syms=DIRβ use symbol files in theDIR.-W,--watch=POINTβ watch and reportPOINTif itβs changed.-Z,--size-filter=SIZEβ apply dynamic patching for functions bigger thanSIZE.
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
- nixos 26.05: uftrace 0.19
- ubuntu stonking: uftrace 0.19-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms