1PERF-FTRACE(1)                    perf Manual                   PERF-FTRACE(1)
2
3
4

NAME

6       perf-ftrace - simple wrapper for kernel's ftrace functionality
7

SYNOPSIS

9       perf ftrace {trace|latency} <command>
10

DESCRIPTION

12       The perf ftrace command provides a collection of subcommands which use
13       kernel’s ftrace infrastructure.
14
15           'perf ftrace trace' is a simple wrapper of the ftrace.  It only supports
16           single thread tracing currently and just reads trace_pipe in text and then
17           write it to stdout.
18
19           'perf ftrace latency' calculates execution latency of a given function
20           (optionally with BPF) and display it as a histogram.
21
22       The following options apply to perf ftrace.
23

COMMON OPTIONS

25       -p, --pid=
26           Trace on existing process id (comma separated list).
27
28       --tid=
29           Trace on existing thread id (comma separated list).
30
31       -a, --all-cpus
32           Force system-wide collection. Scripts run without a <command>
33           normally use -a by default, while scripts run with a <command>
34           normally don’t - this option allows the latter to be run in
35           system-wide mode.
36
37       -C, --cpu=
38           Only trace for the list of CPUs provided. Multiple CPUs can be
39           provided as a comma separated list with no space like: 0,1. Ranges
40           of CPUs are specified with -: 0-2. Default is to trace on all
41           online CPUs.
42
43       -v, --verbose
44           Increase the verbosity level.
45

OPTIONS FOR PERF FTRACE TRACE

47       -t, --tracer=
48           Tracer to use when neither -G nor -F option is not specified:
49           function_graph or function.
50
51       -F, --funcs
52           List available functions to trace. It accepts a pattern to only
53           list interested functions.
54
55       -D, --delay
56           Time (ms) to wait before starting tracing after program start.
57
58       -m, --buffer-size
59           Set the size of per-cpu tracing buffer, <size> is expected to be a
60           number with appended unit character - B/K/M/G.
61
62       --inherit
63           Trace children processes spawned by our target.
64
65       -T, --trace-funcs=
66           Select function tracer and set function filter on the given
67           function (or a glob pattern). Multiple functions can be given by
68           using this option more than once. The function argument also can be
69           a glob pattern. It will be passed to set_ftrace_filter in tracefs.
70
71       -N, --notrace-funcs=
72           Select function tracer and do not trace functions given by the
73           argument. Like -T option, this can be used more than once to
74           specify multiple functions (or glob patterns). It will be passed to
75           set_ftrace_notrace in tracefs.
76
77       --func-opts
78           List of options allowed to set:
79
80           •   call-graph - Display kernel stack trace for function tracer.
81
82           •   irq-info - Display irq context info for function tracer.
83
84       -G, --graph-funcs=
85           Select function_graph tracer and set graph filter on the given
86           function (or a glob pattern). This is useful to trace for functions
87           executed from the given function. This can be used more than once
88           to specify multiple functions. It will be passed to
89           set_graph_function in tracefs.
90
91       -g, --nograph-funcs=
92           Select function_graph tracer and set graph notrace filter on the
93           given function (or a glob pattern). Like -G option, this is useful
94           for the function_graph tracer only and disables tracing for
95           function executed from the given function. This can be used more
96           than once to specify multiple functions. It will be passed to
97           set_graph_notrace in tracefs.
98
99       --graph-opts
100           List of options allowed to set:
101
102           •   nosleep-time - Measure on-CPU time only for function_graph
103               tracer.
104
105           •   noirqs - Ignore functions that happen inside interrupt.
106
107           •   verbose - Show process names, PIDs, timestamps, etc.
108
109           •   thresh=<n> - Setup trace duration threshold in microseconds.
110
111           •   depth=<n> - Set max depth for function graph tracer to follow.
112

OPTIONS FOR PERF FTRACE LATENCY

114       -T, --trace-funcs=
115           Set the function name to get the histogram. Unlike perf ftrace
116           trace, it only allows single function to calculate the histogram.
117
118       -b, --use-bpf
119           Use BPF to measure function latency instead of using the ftrace (it
120           uses function_graph tracer internally).
121
122       -n, --use-nsec
123           Use nano-second instead of micro-second as a base unit of the
124           histogram.
125

SEE ALSO

127       perf-record(1), perf-trace(1)
128
129
130
131perf                              11/28/2023                    PERF-FTRACE(1)
Impressum