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

NAME

6       perf-annotate - Read perf.data (created by perf record) and display
7       annotated code
8

SYNOPSIS

10       perf annotate [-i <file> | --input=file] [symbol_name]
11

DESCRIPTION

13       This command reads the input file and displays an annotated version of
14       the code. If the object file has debug symbols then the source code
15       will be displayed alongside assembly code.
16
17       If there is no debug info in the object, then annotated assembly is
18       displayed.
19

OPTIONS

21       -i, --input=<file>
22           Input file name. (default: perf.data unless stdin is a fifo)
23
24       -d, --dsos=<dso[,dso...]>
25           Only consider symbols in these dsos.
26
27       -s, --symbol=<symbol>
28           Symbol to annotate.
29
30       -f, --force
31           Don’t do ownership validation.
32
33       -v, --verbose
34           Be more verbose. (Show symbol address, etc)
35
36       -q, --quiet
37           Do not show any warnings or messages. (Suppress -v)
38
39       -n, --show-nr-samples
40           Show the number of samples for each symbol
41
42       -D, --dump-raw-trace
43           Dump raw trace in ASCII.
44
45       -k, --vmlinux=<file>
46           vmlinux pathname.
47
48       --ignore-vmlinux
49           Ignore vmlinux files.
50
51       --itrace
52           Options for decoding instruction tracing data. The options are:
53
54               i       synthesize instructions events
55               y       synthesize cycles events
56               b       synthesize branches events (branch misses for Arm SPE)
57               c       synthesize branches events (calls only)
58               r       synthesize branches events (returns only)
59               x       synthesize transactions events
60               w       synthesize ptwrite events
61               p       synthesize power events (incl. PSB events for Intel PT)
62               o       synthesize other events recorded due to the use
63                       of aux-output (refer to perf record)
64               I       synthesize interrupt or similar (asynchronous) events
65                       (e.g. Intel PT Event Trace)
66               e       synthesize error events
67               d       create a debug log
68               f       synthesize first level cache events
69               m       synthesize last level cache events
70               M       synthesize memory events
71               t       synthesize TLB events
72               a       synthesize remote access events
73               g       synthesize a call chain (use with i or x)
74               G       synthesize a call chain on existing event records
75               l       synthesize last branch entries (use with i or x)
76               L       synthesize last branch entries on existing event records
77               s       skip initial number of events
78               q       quicker (less detailed) decoding
79               A       approximate IPC
80               Z       prefer to ignore timestamps (so-called "timeless" decoding)
81
82               The default is all events i.e. the same as --itrace=iybxwpe,
83               except for perf script where it is --itrace=ce
84
85               In addition, the period (default 100000, except for perf script where it is 1)
86               for instructions events can be specified in units of:
87
88               i       instructions
89               t       ticks
90               ms      milliseconds
91               us      microseconds
92               ns      nanoseconds (default)
93
94               Also the call chain size (default 16, max. 1024) for instructions or
95               transactions events can be specified.
96
97               Also the number of last branch entries (default 64, max. 1024) for
98               instructions or transactions events can be specified.
99
100               Similar to options g and l, size may also be specified for options G and L.
101               On x86, note that G and L work poorly when data has been recorded with
102               large PEBS. Refer linkperf:perf-intel-pt[1] man page for details.
103
104               It is also possible to skip events generated (instructions, branches, transactions,
105               ptwrite, power) at the beginning. This is useful to ignore initialization code.
106
107               --itrace=i0nss1000000
108
109               skips the first million instructions.
110
111               The 'e' option may be followed by flags which affect what errors will or
112               will not be reported. Each flag must be preceded by either '+' or '-'.
113               The flags are:
114                       o       overflow
115                       l       trace data lost
116
117               If supported, the 'd' option may be followed by flags which affect what
118               debug messages will or will not be logged. Each flag must be preceded
119               by either '+' or '-'. The flags are:
120                       a       all perf events
121                       e       output only on errors (size configurable - see linkperf:perf-config[1])
122                       o       output to stdout
123
124               If supported, the 'q' option may be repeated to increase the effect.
125
126               To disable decoding entirely, use --no-itrace.
127
128       -m, --modules
129           Load module symbols. WARNING: use only with -k and LIVE kernel.
130
131       -l, --print-line
132           Print matching source lines (may be slow).
133
134       -P, --full-paths
135           Don’t shorten the displayed pathnames.
136
137       --stdio
138           Use the stdio interface.
139
140       --stdio2
141           Use the stdio2 interface, non-interactive, uses the TUI formatting.
142
143       --stdio-color=<mode>
144           always, never or auto, allowing configuring color output via the
145           command line, in addition to via "color.ui" .perfconfig. Use
146           --stdio-color always to generate color even when redirecting to a
147           pipe or file. Using just --stdio-color is equivalent to using
148           always.
149
150       --tui
151           Use the TUI interface. Use of --tui requires a tty, if one is not
152           present, as when piping to other commands, the stdio interface is
153           used. This interfaces starts by centering on the line with more
154           samples, TAB/UNTAB cycles through the lines with more samples.
155
156       --gtk
157           Use the GTK interface.
158
159       -C, --cpu=<cpu>
160           Only report samples for the list of CPUs provided. Multiple CPUs
161           can be provided as a comma-separated list with no space: 0,1.
162           Ranges of CPUs are specified with -: 0-2. Default is to report
163           samples on all CPUs.
164
165       --asm-raw
166           Show raw instruction encoding of assembly instructions.
167
168       --show-total-period
169           Show a column with the sum of periods.
170
171       --source
172           Interleave source code with assembly code. Enabled by default,
173           disable with --no-source.
174
175       --symfs=<directory>
176           Look for files with symbols relative to this directory.
177
178       -M, --disassembler-style=
179           Set disassembler style for objdump.
180
181       --addr2line=<path>
182           Path to addr2line binary.
183
184       --objdump=<path>
185           Path to objdump binary.
186
187       --prefix=PREFIX, --prefix-strip=N
188           Remove first N entries from source file path names in executables
189           and add PREFIX. This allows to display source code compiled on
190           systems with different file system layout.
191
192       --skip-missing
193           Skip symbols that cannot be annotated.
194
195       --group
196           Show event group information together
197
198       --demangle
199           Demangle symbol names to human readable form. It’s enabled by
200           default, disable with --no-demangle.
201
202       --demangle-kernel
203           Demangle kernel symbol names to human readable form (for C++
204           kernels).
205
206       --percent-type
207           Set annotation percent type from following choices: global-period,
208           local-period, global-hits, local-hits
209
210               The local/global keywords set if the percentage is computed
211               in the scope of the function (local) or the whole data (global).
212               The period/hits keywords set the base the percentage is computed
213               on - the samples period or the number of samples (hits).
214
215       --percent-limit
216           Do not show functions which have an overhead under that percent on
217           stdio or stdio2 (Default: 0). Note that this is about selection of
218           functions to display, not about lines within the function.
219

SEE ALSO

221       perf-record(1), perf-report(1)
222
223
224
225perf                              11/28/2023                  PERF-ANNOTATE(1)
Impressum