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 reads trace_pipe in 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 -a by 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 like 0,1. ranges of CPUs are specified with -, like 0-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 -G nor -F option is not specified: function_graph or function.
  • -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 to set_ftrace_filter in tracefs.
  • -N, --notrace-funcs= β€” select function tracer and do not trace functions given by the argument. like the -T option, this can be used more than once to specify multiple functions (or glob patterns). it will be passed to set_ftrace_notrace in 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= β€” select function_graph tracer 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 to set_graph_function in tracefs.
  • -g, --nograph-funcs= β€” select function_graph tracer and set graph notrace filter on the given function (or a glob pattern). like the -G option, this is useful for the function_graph tracer 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 to set_graph_notrace in 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 for function_graph tracer.
    • 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. unlike perf 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-bpf option.
  • -b, --use-bpf β€” use BPF to measure function latency instead of using the ftrace (it uses function_graph tracer 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 is log2() 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 to set_ftrace_filter in tracefs.
  • -N, --notrace-funcs= β€” do not trace functions given by the argument. like the -T option, this can be used more than once to specify multiple functions (or glob patterns). it will be passed to set_ftrace_notrace in 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 to set_graph_function in tracefs.
  • -g, --nograph-funcs= β€” set graph notrace filter on the given function (or a glob pattern). like the -G option, this is useful for the function_graph tracer 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 to set_graph_notrace in 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 is total.
  • --graph-opts β€” list of options allowed to set:
    • nosleep-time β€” measure on-CPU time only for function_graph tracer.
    • 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