PERF-FTRACE(1)
π
perf-ftrace β the header says PERF-FTRACE(1), and yes bestie that's the official manual name, we're being fancy today β¨
okay so welcome to the perf ftrace page, the perf Manual one, and honestly? it's giving "kernel internals but make it cute" π
β¨ NAME β¨
perf-ftrace β a simple wrapper for the kernel's ftrace functionality. that's it, that's the whole vibe π¦
πΈ SYNOPSIS πΈ
perf ftrace {trace|latency|profile} <command>
π DESCRIPTION π
The perf ftrace command gives you a whole little collection of subcommands, and every single one of them is out here using the kernel's ftrace infrastructure. no cap π₯
perf ftrace traceβ a simple wrapper of the ftrace. it only supports single thread tracing currently, and it just readstrace_pipein text and then writes it to stdout. lowkey iconic π«Άperf ftrace latencyβ calculates execution latency of a given function (optionally with BPF) and displays it as a histogram. the way it just... graphs your latency πperf ftrace profileβ shows an execution profile for each function, including total, average, max time and the number of calls. main character energy fr fr π
The following options apply to perf ftrace.
π COMMON OPTIONS π
these are the base-level icons, they apply all over the place π
-p,--pid=β trace on existing process id (comma separated list).--tid=β trace on existing thread id (comma separated list).-a,--all-cpusβ force system-wide collection. scripts run without a<command>normally use-aby default, while scripts run with a<command>normally don't β this option allows the latter to be run in system-wide mode.-C,--cpu=β only trace for the list of CPUs provided. multiple CPUs can be provided as a comma separated list with no space like0,1. ranges of CPUs are specified with-, like0-2. default is to trace on all online CPUs.-v,--verboseβ increase the verbosity level. she's chatty and we love that β¨
π¦ OPTIONS FOR PERF FTRACE TRACE π¦
this is the trace subcommand's own little wardrobe π
-t,--tracer=β tracer to use when neither-Gnor-Foption is not specified:function_graphorfunction.-F,--funcsβ list available functions to trace. it accepts a pattern to only list interested functions.-D,--delayβ time (ms) to wait before starting tracing after program start.-m,--buffer-sizeβ set the size of per-cpu tracing buffer.<size>is expected to be a number with an appended unit character βB/K/M/G.--inheritβ trace children processes spawned by our target. yes, the children too, we're collecting the whole family πΈ-T,--trace-funcs=β select function tracer and set function filter on the given function (or a glob pattern). multiple functions can be given by using this option more than once. the function argument also can be a glob pattern. it will be passed toset_ftrace_filterin tracefs.-N,--notrace-funcs=β select function tracer and do not trace functions given by the argument. like the-Toption, this can be used more than once to specify multiple functions (or glob patterns). it will be passed toset_ftrace_notracein tracefs.--func-optsβ list of options allowed to set:call-graphβ display kernel stack trace for function tracer.irq-infoβ display irq context info for function tracer.
-G,--graph-funcs=β selectfunction_graphtracer and set graph filter on the given function (or a glob pattern). this is useful to trace for functions executed from the given function. this can be used more than once to specify multiple functions. it will be passed toset_graph_functionin tracefs.-g,--nograph-funcs=β selectfunction_graphtracer and set graph notrace filter on the given function (or a glob pattern). like the-Goption, this is useful for thefunction_graphtracer only and disables tracing for function executed from the given function. this can be used more than once to specify multiple functions. it will be passed toset_graph_notracein tracefs.--graph-optsβ list of options allowed to set:argsβ show function arguments.retvalβ show function return value.retval-hexβ show function return value in hexadecimal format.retaddrβ show function return address.nosleep-timeβ measure on-CPU time only forfunction_graphtracer.noirqsβ ignore functions that happen inside interrupt.verboseβ show process names, PIDs, timestamps, etc.thresh=<n>β setup trace duration threshold in microseconds.depth=<n>β set max depth for function graph tracer to follow.tailβ print function name at the end.
π OPTIONS FOR PERF FTRACE LATENCY π
the histogram girlies rise π
-T,--trace-funcs=β set the function name to get the histogram. unlikeperf ftrace trace, it only allows single function to calculate the histogram.-e,--events=β set the pair of events to get the histogram. the histogram is calculated by the time difference between the two events from the same thread. this requires-b/--use-bpfoption.-b,--use-bpfβ use BPF to measure function latency instead of using the ftrace (it usesfunction_graphtracer internally).-n,--use-nsecβ use nano-second instead of micro-second as a base unit of the histogram.--bucket-range=β bucket range in ms or ns (according to-n/--use-nsec), default islog2()mode.--min-latency=β minimum latency for the start of the first bucket, in ms or ns (according to-n/--use-nsec).--max-latency=β maximum latency for the start of the last bucket, in ms or ns (according to-n/--use-nsec).
β οΈ heads up bestie: the --max-latency= setting is ignored if the value results in more than 22 buckets. the math said no π
π₯ OPTIONS FOR PERF FTRACE PROFILE π₯
the full glow-up, total + average + max time + call counts π
-T,--trace-funcs=β set function filter on the given function (or a glob pattern). multiple functions can be given by using this option more than once. the function argument also can be a glob pattern. it will be passed toset_ftrace_filterin tracefs.-N,--notrace-funcs=β do not trace functions given by the argument. like the-Toption, this can be used more than once to specify multiple functions (or glob patterns). it will be passed toset_ftrace_notracein tracefs.-G,--graph-funcs=β set graph filter on the given function (or a glob pattern). this is useful to trace for functions executed from the given function. this can be used more than once to specify multiple functions. it will be passed toset_graph_functionin tracefs.-g,--nograph-funcs=β set graph notrace filter on the given function (or a glob pattern). like the-Goption, this is useful for thefunction_graphtracer only and disables tracing for function executed from the given function. this can be used more than once to specify multiple functions. it will be passed toset_graph_notracein tracefs.-m,--buffer-sizeβ set the size of per-cpu tracing buffer.<size>is expected to be a number with an appended unit character βB/K/M/G.-s,--sort=β sort the result by the given field. available values are:total,avg,max,count,name. default istotal.--graph-optsβ list of options allowed to set:nosleep-timeβ measure on-CPU time only forfunction_graphtracer.noirqsβ ignore functions that happen inside interrupt.thresh=<n>β setup trace duration threshold in microseconds.depth=<n>β set max depth for function graph tracer to follow.
π SEE ALSO π
perf-record(1), perf-trace(1) β go read those too, iykyk π
and that's the page, bestie π«Ά this whole thing came from the perf manual, dated 10/31/2026, and the manual name at the top is PERF-FTRACE(1) β slay, go trace something iconic πβ¨
π¦ where this page comes from
- arch rolling: perf 7.3.1-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms