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

SEE ALSO

217       perf-record(1), perf-report(1)
218
219
220
221perf                              01/12/2023                  PERF-ANNOTATE(1)
Impressum