Commit | Line | Data |
---|---|---|
d01f4e8d | 1 | perf-ftrace(1) |
ea66536a | 2 | ============== |
d01f4e8d NK |
3 | |
4 | NAME | |
5 | ---- | |
6 | perf-ftrace - simple wrapper for kernel's ftrace functionality | |
7 | ||
8 | ||
9 | SYNOPSIS | |
10 | -------- | |
11 | [verse] | |
feff0839 | 12 | 'perf ftrace' {trace|latency} <command> |
d01f4e8d NK |
13 | |
14 | DESCRIPTION | |
15 | ----------- | |
feff0839 NK |
16 | The 'perf ftrace' command provides a collection of subcommands which use |
17 | kernel's ftrace infrastructure. | |
d01f4e8d | 18 | |
feff0839 NK |
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. | |
d01f4e8d | 22 | |
feff0839 NK |
23 | 'perf ftrace latency' calculates execution latency of a given function |
24 | (optionally with BPF) and display it as a histogram. | |
d01f4e8d | 25 | |
feff0839 | 26 | The following options apply to perf ftrace. |
d01f4e8d | 27 | |
feff0839 NK |
28 | COMMON OPTIONS |
29 | -------------- | |
d6d81bfe | 30 | |
a9af6be5 NK |
31 | -p:: |
32 | --pid=:: | |
33 | Trace on existing process id (comma separated list). | |
34 | ||
42145d71 CD |
35 | --tid=:: |
36 | Trace on existing thread id (comma separated list). | |
37 | ||
dc231032 NK |
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 | ||
feff0839 NK |
52 | -v:: |
53 | --verbose:: | |
54 | Increase the verbosity level. | |
55 | ||
56 | ||
57 | OPTIONS 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 | ||
846e1939 CD |
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 | ||
5b347472 CD |
79 | --inherit:: |
80 | Trace children processes spawned by our target. | |
81 | ||
78b83e8b NK |
82 | -T:: |
83 | --trace-funcs=:: | |
eb6d31ae CD |
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. | |
78b83e8b NK |
89 | |
90 | -N:: | |
91 | --notrace-funcs=:: | |
eb6d31ae CD |
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. | |
78b83e8b | 96 | |
b1d84af6 CD |
97 | --func-opts:: |
98 | List of options allowed to set: | |
a1ef3aaf CD |
99 | |
100 | - call-graph - Display kernel stack trace for function tracer. | |
101 | - irq-info - Display irq context info for function tracer. | |
b1d84af6 | 102 | |
78b83e8b NK |
103 | -G:: |
104 | --graph-funcs=:: | |
eb6d31ae CD |
105 | Select function_graph tracer and set graph filter on the given |
106 | function (or a glob pattern). This is useful to trace for | |
107 | functions executed from the given function. This can be used more | |
108 | than once to specify multiple functions. It will be passed to | |
109 | 'set_graph_function' in tracefs. | |
78b83e8b NK |
110 | |
111 | -g:: | |
112 | --nograph-funcs=:: | |
eb6d31ae CD |
113 | Select function_graph tracer and set graph notrace filter on the |
114 | given function (or a glob pattern). Like -G option, this is useful | |
115 | for the function_graph tracer only and disables tracing for function | |
116 | executed from the given function. This can be used more than once to | |
117 | specify multiple functions. It will be passed to 'set_graph_notrace' | |
118 | in tracefs. | |
78b83e8b | 119 | |
38988f2e CD |
120 | --graph-opts:: |
121 | List of options allowed to set: | |
a1ef3aaf CD |
122 | |
123 | - nosleep-time - Measure on-CPU time only for function_graph tracer. | |
124 | - noirqs - Ignore functions that happen inside interrupt. | |
125 | - verbose - Show process names, PIDs, timestamps, etc. | |
126 | - thresh=<n> - Setup trace duration threshold in microseconds. | |
127 | - depth=<n> - Set max depth for function graph tracer to follow. | |
38988f2e | 128 | |
feff0839 NK |
129 | |
130 | OPTIONS for 'perf ftrace latency' | |
131 | --------------------------------- | |
132 | ||
133 | -T:: | |
134 | --trace-funcs=:: | |
135 | Set the function name to get the histogram. Unlike perf ftrace trace, | |
136 | it only allows single function to calculate the histogram. | |
137 | ||
138 | -b:: | |
139 | --use-bpf:: | |
140 | Use BPF to measure function latency instead of using the ftrace (it | |
141 | uses function_graph tracer internally). | |
142 | ||
143 | -n:: | |
144 | --use-nsec:: | |
145 | Use nano-second instead of micro-second as a base unit of the histogram. | |
146 | ||
147 | ||
d01f4e8d NK |
148 | SEE ALSO |
149 | -------- | |
150 | linkperf:perf-record[1], linkperf:perf-trace[1] |