6 perf-ftrace - simple wrapper for kernel's ftrace functionality
12 'perf ftrace' {trace|latency|profile} <command>
16 The 'perf ftrace' command provides a collection of subcommands which use
17 kernel's ftrace infrastructure.
19 'perf ftrace trace' is a simple wrapper of the ftrace. It only supports
20 single thread tracing currently and just reads trace_pipe in text and then
23 'perf ftrace latency' calculates execution latency of a given function
24 (optionally with BPF) and display it as a histogram.
26 'perf ftrace profile' show a execution profile for each function including
27 total, average, max time and the number of calls.
29 The following options apply to perf ftrace.
36 Trace on existing process id (comma separated list).
39 Trace on existing thread id (comma separated list).
43 Force system-wide collection. Scripts run without a <command>
44 normally use -a by default, while scripts run with a <command>
45 normally don't - this option allows the latter to be run in
50 Only trace for the list of CPUs provided. Multiple CPUs can
51 be provided as a comma separated list with no space like: 0,1.
52 Ranges of CPUs are specified with -: 0-2.
53 Default is to trace on all online CPUs.
57 Increase the verbosity level.
60 OPTIONS for 'perf ftrace trace'
61 -------------------------------
65 Tracer to use when neither -G nor -F option is not
66 specified: function_graph or function.
70 List available functions to trace. It accepts a pattern to
71 only list interested functions.
75 Time (ms) to wait before starting tracing after program start.
79 Set the size of per-cpu tracing buffer, <size> is expected to
80 be a number with appended unit character - B/K/M/G.
83 Trace children processes spawned by our target.
87 Select function tracer and set function filter on the given
88 function (or a glob pattern). Multiple functions can be given
89 by using this option more than once. The function argument also
90 can be a glob pattern. It will be passed to 'set_ftrace_filter'
95 Select function tracer and do not trace functions given by the
96 argument. Like -T option, this can be used more than once to
97 specify multiple functions (or glob patterns). It will be
98 passed to 'set_ftrace_notrace' in tracefs.
101 List of options allowed to set:
103 - call-graph - Display kernel stack trace for function tracer.
104 - irq-info - Display irq context info for function tracer.
108 Select function_graph tracer and set graph filter on the given
109 function (or a glob pattern). This is useful to trace for
110 functions executed from the given function. This can be used more
111 than once to specify multiple functions. It will be passed to
112 'set_graph_function' in tracefs.
116 Select function_graph tracer and set graph notrace filter on the
117 given function (or a glob pattern). Like -G option, this is useful
118 for the function_graph tracer only and disables tracing for function
119 executed from the given function. This can be used more than once to
120 specify multiple functions. It will be passed to 'set_graph_notrace'
124 List of options allowed to set:
126 - nosleep-time - Measure on-CPU time only for function_graph tracer.
127 - noirqs - Ignore functions that happen inside interrupt.
128 - verbose - Show process names, PIDs, timestamps, etc.
129 - thresh=<n> - Setup trace duration threshold in microseconds.
130 - depth=<n> - Set max depth for function graph tracer to follow.
131 - tail - Print function name at the end.
134 OPTIONS for 'perf ftrace latency'
135 ---------------------------------
139 Set the function name to get the histogram. Unlike perf ftrace trace,
140 it only allows single function to calculate the histogram.
144 Use BPF to measure function latency instead of using the ftrace (it
145 uses function_graph tracer internally).
149 Use nano-second instead of micro-second as a base unit of the histogram.
152 OPTIONS for 'perf ftrace profile'
153 ---------------------------------
157 Set function filter on the given function (or a glob pattern).
158 Multiple functions can be given by using this option more than once.
159 The function argument also can be a glob pattern. It will be passed
160 to 'set_ftrace_filter' in tracefs.
164 Do not trace functions given by the argument. Like -T option, this
165 can be used more than once to specify multiple functions (or glob
166 patterns). It will be passed to 'set_ftrace_notrace' in tracefs.
170 Set graph filter on the given function (or a glob pattern). This is
171 useful to trace for functions executed from the given function. This
172 can be used more than once to specify multiple functions. It will be
173 passed to 'set_graph_function' in tracefs.
177 Set graph notrace filter on the given function (or a glob pattern).
178 Like -G option, this is useful for the function_graph tracer only and
179 disables tracing for function executed from the given function. This
180 can be used more than once to specify multiple functions. It will be
181 passed to 'set_graph_notrace' in tracefs.
185 Set the size of per-cpu tracing buffer, <size> is expected to
186 be a number with appended unit character - B/K/M/G.
190 Sort the result by the given field. Available values are:
191 total, avg, max, count, name. Default is 'total'.
196 linkperf:perf-record[1], linkperf:perf-trace[1]