xref: /OK3568_Linux_fs/kernel/tools/perf/Documentation/perf-annotate.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyunperf-annotate(1)
2*4882a593Smuzhiyun================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunNAME
5*4882a593Smuzhiyun----
6*4882a593Smuzhiyunperf-annotate - Read perf.data (created by perf record) and display annotated code
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunSYNOPSIS
9*4882a593Smuzhiyun--------
10*4882a593Smuzhiyun[verse]
11*4882a593Smuzhiyun'perf annotate' [-i <file> | --input=file] [symbol_name]
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunDESCRIPTION
14*4882a593Smuzhiyun-----------
15*4882a593SmuzhiyunThis command reads the input file and displays an annotated version of the
16*4882a593Smuzhiyuncode. If the object file has debug symbols then the source code will be
17*4882a593Smuzhiyundisplayed alongside assembly code.
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunIf there is no debug info in the object, then annotated assembly is displayed.
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunOPTIONS
22*4882a593Smuzhiyun-------
23*4882a593Smuzhiyun-i::
24*4882a593Smuzhiyun--input=<file>::
25*4882a593Smuzhiyun        Input file name. (default: perf.data unless stdin is a fifo)
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun-d::
28*4882a593Smuzhiyun--dsos=<dso[,dso...]>::
29*4882a593Smuzhiyun        Only consider symbols in these dsos.
30*4882a593Smuzhiyun-s::
31*4882a593Smuzhiyun--symbol=<symbol>::
32*4882a593Smuzhiyun        Symbol to annotate.
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun-f::
35*4882a593Smuzhiyun--force::
36*4882a593Smuzhiyun        Don't do ownership validation.
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun-v::
39*4882a593Smuzhiyun--verbose::
40*4882a593Smuzhiyun        Be more verbose. (Show symbol address, etc)
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun-q::
43*4882a593Smuzhiyun--quiet::
44*4882a593Smuzhiyun	Do not show any message.  (Suppress -v)
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun-n::
47*4882a593Smuzhiyun--show-nr-samples::
48*4882a593Smuzhiyun	Show the number of samples for each symbol
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun-D::
51*4882a593Smuzhiyun--dump-raw-trace::
52*4882a593Smuzhiyun        Dump raw trace in ASCII.
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun-k::
55*4882a593Smuzhiyun--vmlinux=<file>::
56*4882a593Smuzhiyun        vmlinux pathname.
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun--ignore-vmlinux::
59*4882a593Smuzhiyun	Ignore vmlinux files.
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun-m::
62*4882a593Smuzhiyun--modules::
63*4882a593Smuzhiyun        Load module symbols. WARNING: use only with -k and LIVE kernel.
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun-l::
66*4882a593Smuzhiyun--print-line::
67*4882a593Smuzhiyun        Print matching source lines (may be slow).
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun-P::
70*4882a593Smuzhiyun--full-paths::
71*4882a593Smuzhiyun        Don't shorten the displayed pathnames.
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun--stdio:: Use the stdio interface.
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun--stdio2:: Use the stdio2 interface, non-interactive, uses the TUI formatting.
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun--stdio-color=<mode>::
78*4882a593Smuzhiyun	'always', 'never' or 'auto', allowing configuring color output
79*4882a593Smuzhiyun	via the command line, in addition to via "color.ui" .perfconfig.
80*4882a593Smuzhiyun	Use '--stdio-color always' to generate color even when redirecting
81*4882a593Smuzhiyun	to a pipe or file. Using just '--stdio-color' is equivalent to
82*4882a593Smuzhiyun	using 'always'.
83*4882a593Smuzhiyun
84*4882a593Smuzhiyun--tui:: Use the TUI interface. Use of --tui requires a tty, if one is not
85*4882a593Smuzhiyun	present, as when piping to other commands, the stdio interface is
86*4882a593Smuzhiyun	used. This interfaces starts by centering on the line with more
87*4882a593Smuzhiyun	samples, TAB/UNTAB cycles through the lines with more samples.
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun--gtk:: Use the GTK interface.
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun-C::
92*4882a593Smuzhiyun--cpu=<cpu>:: Only report samples for the list of CPUs provided. Multiple CPUs can
93*4882a593Smuzhiyun	be provided as a comma-separated list with no space: 0,1. Ranges of
94*4882a593Smuzhiyun	CPUs are specified with -: 0-2. Default is to report samples on all
95*4882a593Smuzhiyun	CPUs.
96*4882a593Smuzhiyun
97*4882a593Smuzhiyun--asm-raw::
98*4882a593Smuzhiyun	Show raw instruction encoding of assembly instructions.
99*4882a593Smuzhiyun
100*4882a593Smuzhiyun--show-total-period:: Show a column with the sum of periods.
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun--source::
103*4882a593Smuzhiyun	Interleave source code with assembly code. Enabled by default,
104*4882a593Smuzhiyun	disable with --no-source.
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun--symfs=<directory>::
107*4882a593Smuzhiyun        Look for files with symbols relative to this directory.
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun-M::
110*4882a593Smuzhiyun--disassembler-style=:: Set disassembler style for objdump.
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun--objdump=<path>::
113*4882a593Smuzhiyun        Path to objdump binary.
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun--prefix=PREFIX::
116*4882a593Smuzhiyun--prefix-strip=N::
117*4882a593Smuzhiyun	Remove first N entries from source file path names in executables
118*4882a593Smuzhiyun	and add PREFIX. This allows to display source code compiled on systems
119*4882a593Smuzhiyun	with different file system layout.
120*4882a593Smuzhiyun
121*4882a593Smuzhiyun--skip-missing::
122*4882a593Smuzhiyun	Skip symbols that cannot be annotated.
123*4882a593Smuzhiyun
124*4882a593Smuzhiyun--group::
125*4882a593Smuzhiyun	Show event group information together
126*4882a593Smuzhiyun
127*4882a593Smuzhiyun--percent-type::
128*4882a593Smuzhiyun	Set annotation percent type from following choices:
129*4882a593Smuzhiyun	  global-period, local-period, global-hits, local-hits
130*4882a593Smuzhiyun
131*4882a593Smuzhiyun	The local/global keywords set if the percentage is computed
132*4882a593Smuzhiyun	in the scope of the function (local) or the whole data (global).
133*4882a593Smuzhiyun	The period/hits keywords set the base the percentage is computed
134*4882a593Smuzhiyun	on - the samples period or the number of samples (hits).
135*4882a593Smuzhiyun
136*4882a593SmuzhiyunSEE ALSO
137*4882a593Smuzhiyun--------
138*4882a593Smuzhiyunlinkperf:perf-record[1], linkperf:perf-report[1]
139