Loading...
1perf-ftrace(1)
2==============
3
4NAME
5----
6perf-ftrace - simple wrapper for kernel's ftrace functionality
7
8
9SYNOPSIS
10--------
11[verse]
12'perf ftrace' {trace|latency} <command>
13
14DESCRIPTION
15-----------
16The 'perf ftrace' command provides a collection of subcommands which use
17kernel's ftrace infrastructure.
18
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
21 write it to stdout.
22
23 'perf ftrace latency' calculates execution latency of a given function
24 (optionally with BPF) and display it as a histogram.
25
26The following options apply to perf ftrace.
27
28COMMON OPTIONS
29--------------
30
31-p::
32--pid=::
33 Trace on existing process id (comma separated list).
34
35--tid=::
36 Trace on existing thread id (comma separated list).
37
38-a::
39--all-cpus::
40 Force system-wide collection. Scripts run without a <command>
41 normally use -a by default, while scripts run with a <command>
42 normally don't - this option allows the latter to be run in
43 system-wide mode.
44
45-C::
46--cpu=::
47 Only trace for the list of CPUs provided. Multiple CPUs can
48 be provided as a comma separated list with no space like: 0,1.
49 Ranges of CPUs are specified with -: 0-2.
50 Default is to trace on all online CPUs.
51
52-v::
53--verbose::
54 Increase the verbosity level.
55
56
57OPTIONS for 'perf ftrace trace'
58-------------------------------
59
60-t::
61--tracer=::
62 Tracer to use when neither -G nor -F option is not
63 specified: function_graph or function.
64
65-F::
66--funcs::
67 List available functions to trace. It accepts a pattern to
68 only list interested functions.
69
70-D::
71--delay::
72 Time (ms) to wait before starting tracing after program start.
73
74-m::
75--buffer-size::
76 Set the size of per-cpu tracing buffer, <size> is expected to
77 be a number with appended unit character - B/K/M/G.
78
79--inherit::
80 Trace children processes spawned by our target.
81
82-T::
83--trace-funcs=::
84 Select function tracer and set function filter on the given
85 function (or a glob pattern). Multiple functions can be given
86 by using this option more than once. The function argument also
87 can be a glob pattern. It will be passed to 'set_ftrace_filter'
88 in tracefs.
89
90-N::
91--notrace-funcs=::
92 Select function tracer and do not trace functions given by the
93 argument. Like -T option, this can be used more than once to
94 specify multiple functions (or glob patterns). It will be
95 passed to 'set_ftrace_notrace' in tracefs.
96
97--func-opts::
98 List of options allowed to set:
99 call-graph - Display kernel stack trace for function tracer.
100 irq-info - Display irq context info for function tracer.
101
102-G::
103--graph-funcs=::
104 Select function_graph tracer and set graph filter on the given
105 function (or a glob pattern). This is useful to trace for
106 functions executed from the given function. This can be used more
107 than once to specify multiple functions. It will be passed to
108 'set_graph_function' in tracefs.
109
110-g::
111--nograph-funcs=::
112 Select function_graph tracer and set graph notrace filter on the
113 given function (or a glob pattern). Like -G option, this is useful
114 for the function_graph tracer only and disables tracing for function
115 executed from the given function. This can be used more than once to
116 specify multiple functions. It will be passed to 'set_graph_notrace'
117 in tracefs.
118
119--graph-opts::
120 List of options allowed to set:
121 nosleep-time - Measure on-CPU time only for function_graph tracer.
122 noirqs - Ignore functions that happen inside interrupt.
123 verbose - Show process names, PIDs, timestamps, etc.
124 thresh=<n> - Setup trace duration threshold in microseconds.
125 depth=<n> - Set max depth for function graph tracer to follow.
126
127
128OPTIONS for 'perf ftrace latency'
129---------------------------------
130
131-T::
132--trace-funcs=::
133 Set the function name to get the histogram. Unlike perf ftrace trace,
134 it only allows single function to calculate the histogram.
135
136-b::
137--use-bpf::
138 Use BPF to measure function latency instead of using the ftrace (it
139 uses function_graph tracer internally).
140
141-n::
142--use-nsec::
143 Use nano-second instead of micro-second as a base unit of the histogram.
144
145
146SEE ALSO
147--------
148linkperf:perf-record[1], linkperf:perf-trace[1]
1perf-ftrace(1)
2==============
3
4NAME
5----
6perf-ftrace - simple wrapper for kernel's ftrace functionality
7
8
9SYNOPSIS
10--------
11[verse]
12'perf ftrace' <command>
13
14DESCRIPTION
15-----------
16The 'perf ftrace' command is a simple wrapper of kernel's ftrace
17functionality. It only supports single thread tracing currently and
18just reads trace_pipe in text and then write it to stdout.
19
20The following options apply to perf ftrace.
21
22OPTIONS
23-------
24
25-t::
26--tracer=::
27 Tracer to use when neither -G nor -F option is not
28 specified: function_graph or function.
29
30-v::
31--verbose::
32 Increase the verbosity level.
33
34-F::
35--funcs::
36 List available functions to trace. It accepts a pattern to
37 only list interested functions.
38
39-p::
40--pid=::
41 Trace on existing process id (comma separated list).
42
43--tid=::
44 Trace on existing thread id (comma separated list).
45
46-D::
47--delay::
48 Time (ms) to wait before starting tracing after program start.
49
50-a::
51--all-cpus::
52 Force system-wide collection. Scripts run without a <command>
53 normally use -a by default, while scripts run with a <command>
54 normally don't - this option allows the latter to be run in
55 system-wide mode.
56
57-C::
58--cpu=::
59 Only trace for the list of CPUs provided. Multiple CPUs can
60 be provided as a comma separated list with no space like: 0,1.
61 Ranges of CPUs are specified with -: 0-2.
62 Default is to trace on all online CPUs.
63
64-m::
65--buffer-size::
66 Set the size of per-cpu tracing buffer, <size> is expected to
67 be a number with appended unit character - B/K/M/G.
68
69--inherit::
70 Trace children processes spawned by our target.
71
72-T::
73--trace-funcs=::
74 Select function tracer and set function filter on the given
75 function (or a glob pattern). Multiple functions can be given
76 by using this option more than once. The function argument also
77 can be a glob pattern. It will be passed to 'set_ftrace_filter'
78 in tracefs.
79
80-N::
81--notrace-funcs=::
82 Select function tracer and do not trace functions given by the
83 argument. Like -T option, this can be used more than once to
84 specify multiple functions (or glob patterns). It will be
85 passed to 'set_ftrace_notrace' in tracefs.
86
87--func-opts::
88 List of options allowed to set:
89 call-graph - Display kernel stack trace for function tracer.
90 irq-info - Display irq context info for function tracer.
91
92-G::
93--graph-funcs=::
94 Select function_graph tracer and set graph filter on the given
95 function (or a glob pattern). This is useful to trace for
96 functions executed from the given function. This can be used more
97 than once to specify multiple functions. It will be passed to
98 'set_graph_function' in tracefs.
99
100-g::
101--nograph-funcs=::
102 Select function_graph tracer and set graph notrace filter on the
103 given function (or a glob pattern). Like -G option, this is useful
104 for the function_graph tracer only and disables tracing for function
105 executed from the given function. This can be used more than once to
106 specify multiple functions. It will be passed to 'set_graph_notrace'
107 in tracefs.
108
109--graph-opts::
110 List of options allowed to set:
111 nosleep-time - Measure on-CPU time only for function_graph tracer.
112 noirqs - Ignore functions that happen inside interrupt.
113 verbose - Show process names, PIDs, timestamps, etc.
114 thresh=<n> - Setup trace duration threshold in microseconds.
115 depth=<n> - Set max depth for function graph tracer to follow.
116
117SEE ALSO
118--------
119linkperf:perf-record[1], linkperf:perf-trace[1]