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: call-graph - Display kernel stack
79           trace for function tracer. irq-info - Display irq context info for
80           function tracer.
81
82       -G, --graph-funcs=
83           Select function_graph tracer and set graph filter on the given
84           function (or a glob pattern). This is useful to trace for functions
85           executed from the given function. This can be used more than once
86           to specify multiple functions. It will be passed to
87           set_graph_function in tracefs.
88
89       -g, --nograph-funcs=
90           Select function_graph tracer and set graph notrace filter on the
91           given function (or a glob pattern). Like -G option, this is useful
92           for the function_graph tracer only and disables tracing for
93           function executed from the given function. This can be used more
94           than once to specify multiple functions. It will be passed to
95           set_graph_notrace in tracefs.
96
97       --graph-opts
98           List of options allowed to set: nosleep-time - Measure on-CPU time
99           only for function_graph tracer. noirqs - Ignore functions that
100           happen inside interrupt. verbose - Show process names, PIDs,
101           timestamps, etc. thresh=<n> - Setup trace duration threshold in
102           microseconds. depth=<n> - Set max depth for function graph tracer
103           to follow.
104

OPTIONS FOR PERF FTRACE LATENCY

106       -T, --trace-funcs=
107           Set the function name to get the histogram. Unlike perf ftrace
108           trace, it only allows single function to calculate the histogram.
109
110       -b, --use-bpf
111           Use BPF to measure function latency instead of using the ftrace (it
112           uses function_graph tracer internally).
113
114       -n, --use-nsec
115           Use nano-second instead of micro-second as a base unit of the
116           histogram.
117

SEE ALSO

119       perf-record(1), perf-trace(1)
120
121
122
123perf                              01/12/2023                    PERF-FTRACE(1)
Impressum