perf-report.txt 12.0 KB
Newer Older
I
Ingo Molnar 已提交
1
perf-report(1)
2
==============
I
Ingo Molnar 已提交
3 4 5

NAME
----
6
perf-report - Read perf.data (created by perf record) and display the profile
I
Ingo Molnar 已提交
7 8 9 10 11 12 13 14 15

SYNOPSIS
--------
[verse]
'perf report' [-i <file> | --input=file]

DESCRIPTION
-----------
This command displays the performance counter profile information recorded
I
Ingo Molnar 已提交
16
via perf record.
I
Ingo Molnar 已提交
17 18 19 20 21

OPTIONS
-------
-i::
--input=::
22
        Input file name. (default: perf.data unless stdin is a fifo)
23 24 25 26 27

-v::
--verbose::
        Be more verbose. (show symbol address, etc)

28 29
-n::
--show-nr-samples::
30
	Show the number of samples for each symbol
31 32 33 34

--showcpuutilization::
        Show sample percentage for different cpu modes.

35 36
-T::
--threads::
37 38
	Show per-thread event counters.  The input data file should be recorded
	with -s option.
39
-c::
40 41
--comms=::
	Only consider symbols in these comms. CSV that understands
42 43
	file://filename entries.  This option will affect the percentage of
	the overhead column.  See --percentage for more info.
44 45 46 47 48
--pid=::
        Only show events for given process ID (comma separated list).

--tid=::
        Only show events for given thread ID (comma separated list).
49 50 51 52 53
-d::
--dsos=::
	Only consider symbols in these dsos. CSV that understands
	file://filename entries.  This option will affect the percentage of
	the overhead column.  See --percentage for more info.
54 55 56
-S::
--symbols=::
	Only consider these symbols. CSV that understands
57 58
	file://filename entries.  This option will affect the percentage of
	the overhead column.  See --percentage for more info.
I
Ingo Molnar 已提交
59

60 61 62
--symbol-filter=::
	Only show symbols that match (partially) with this filter.

63 64 65 66
-U::
--hide-unresolved::
        Only display entries resolved to a symbol.

67 68
-s::
--sort=::
69 70
	Sort histogram entries by given key(s) - multiple keys can be specified
	in CSV format.  Following sort keys are available:
71
	pid, comm, dso, symbol, parent, cpu, socket, srcline, weight, local_weight.
72 73 74 75 76 77 78 79 80 81

	Each key has following meaning:

	- comm: command (name) of the task which can be read via /proc/<pid>/comm
	- pid: command and tid of the task
	- dso: name of library or module executed at the time of sample
	- symbol: name of function executed at the time of sample
	- parent: name of function matched to the parent regex filter. Unmatched
	entries are displayed as "[other]".
	- cpu: cpu number the task ran at the time of sample
82
	- socket: processor socket number the task ran at the time of sample
83
	- srcline: filename and line number executed at the time of sample.  The
84
	DWARF debugging info must be provided.
85 86
	- srcfile: file name of the source file of the same. Requires dwarf
	information.
87 88 89 90
	- weight: Event specific weight, e.g. memory latency or transaction
	abort cost. This is the global weight.
	- local_weight: Local weight version of the weight above.
	- transaction: Transaction abort flags.
91 92 93 94 95 96 97 98 99
	- overhead: Overhead percentage of sample
	- overhead_sys: Overhead percentage of sample running in system mode
	- overhead_us: Overhead percentage of sample running in user mode
	- overhead_guest_sys: Overhead percentage of sample running in system mode
	on guest machine
	- overhead_guest_us: Overhead percentage of sample running in user mode on
	guest machine
	- sample: Number of sample
	- period: Raw number of event count of sample
100 101 102 103 104 105 106 107 108 109 110 111 112

	By default, comm, dso and symbol keys are used.
	(i.e. --sort comm,dso,symbol)

	If --branch-stack option is used, following sort keys are also
	available:
	dso_from, dso_to, symbol_from, symbol_to, mispredict.

	- dso_from: name of library or module branched from
	- dso_to: name of library or module branched to
	- symbol_from: name of function branched from
	- symbol_to: name of function branched to
	- mispredict: "N" for predicted branch, "Y" for mispredicted branch
113 114
	- in_tx: branch in TSX transaction
	- abort: TSX transaction abort.
115
	- cycles: Cycles in basic block
116 117 118

	And default sort keys are changed to comm, dso_from, symbol_from, dso_to
	and symbol_to, see '--branch-stack'.
119

120 121 122 123
-F::
--fields=::
	Specify output field - multiple keys can be specified in CSV format.
	Following fields are available:
124
	overhead, overhead_sys, overhead_us, overhead_children, sample and period.
125 126 127 128 129
	Also it can contain any sort key(s).

	By default, every sort keys not specified in -F will be appended
	automatically.

130 131
	If --mem-mode option is used, following sort keys are also available
	(incompatible with --branch-stack):
D
Don Zickus 已提交
132
	symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline.
133 134 135 136 137 138 139 140

	- symbol_daddr: name of data symbol being executed on at the time of sample
	- dso_daddr: name of library or module containing the data being executed
	on at the time of sample
	- locked: whether the bus was locked at the time of sample
	- tlb: type of tlb access for the data at the time of sample
	- mem: type of memory access for the data at the time of sample
	- snoop: type of snoop (if any) for the data at the time of sample
D
Don Zickus 已提交
141
	- dcacheline: the cacheline the data address is on at the time of sample
142 143 144 145

	And default sort keys are changed to local_weight, mem, sym, dso,
	symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'.

146 147
-p::
--parent=<regex>::
148 149 150 151
        A regex filter to identify parent. The parent is a caller of this
	function and searched through the callchain, thus it requires callchain
	information recorded. The pattern is in the exteneded regex format and
	defaults to "\^sys_|^do_page_fault", see '--sort parent'.
152 153 154 155 156

-x::
--exclude-other::
        Only display entries with parent-match.

157
-w::
158
--column-widths=<width[,width...]>::
159
	Force each column width to the provided list, for large terminal
160
	readability.  0 means no limit (default behavior).
161 162 163 164

-t::
--field-separator=::
	Use a special separator character and don't pad with spaces, replacing
165
	all occurrences of this separator in symbol names (and other output)
166 167
	with a '.' character, that thus it's the only non valid separator.

168 169 170 171
-D::
--dump-raw-trace::
        Dump raw trace in ASCII.

172
-g [type,min[,limit],order[,key][,branch]]::
173
--call-graph::
174 175
        Display call chains using type, min percent threshold, optional print
	limit and order.
176
	type can be either:
177
	- flat: single column, linear exposure of call chains.
178 179 180
	- graph: use a graph tree, displaying absolute overhead rates.
	- fractal: like graph, but displays relative rates. Each branch of
		 the tree is considered as a new profiled object. +
181 182 183 184 185

	order can be either:
	- callee: callee based call graph.
	- caller: inverted caller based call graph.

186 187 188 189
	key can be:
	- function: compare on functions
	- address: compare on individual code addresses

190 191 192 193 194
	branch can be:
	- branch: include last branch information in callgraph
	when available. Usually more convenient to use --branch-history
	for this.

195
	Default: fractal,0.5,callee,function.
196

197 198 199 200
--children::
	Accumulate callchain of children to parent entry so that then can
	show up in the output.  The output will have a new "Children" column
	and will be sorted on the data.  It requires callchains are recorded.
201
	See the `overhead calculation' section for more details.
202

203 204 205 206 207
--max-stack::
	Set the stack depth limit when parsing the callchain, anything
	beyond the specified depth will be ignored. This is a trade-off
	between information loss and faster processing especially for
	workloads that can have a very long callchain stack.
208 209
	Note that when using the --itrace option the synthesized callchain size
	will override this value if the synthesized callchain size is bigger.
210 211 212

	Default: 127

213 214 215
-G::
--inverted::
        alias for inverted caller based call graph.
216

217 218 219 220 221
--ignore-callees=<regex>::
        Ignore callees of the function(s) matching the given regex.
        This has the effect of collecting the callers of each such
        function into one place in the call-graph tree.

222 223 224
--pretty=<key>::
        Pretty printing style.  key: normal, raw

225 226 227 228 229 230 231
--stdio:: Use the stdio interface.

--tui:: Use the TUI interface, that is integrated with annotate and allows
        zooming into DSOs or threads, among other features. Use of --tui
	requires a tty, if one is not present, as when piping to other
	commands, the stdio interface is used.

232 233
--gtk:: Use the GTK2 interface.

234 235 236 237
-k::
--vmlinux=<file>::
        vmlinux pathname

238 239 240
--kallsyms=<file>::
        kallsyms pathname

241 242 243 244 245 246 247 248 249
-m::
--modules::
        Load module symbols. WARNING: This should only be used with -k and
        a LIVE kernel.

-f::
--force::
        Don't complain, do it.

250 251 252
--symfs=<directory>::
        Look for files with symbols relative to this directory.

253
-C::
254 255 256 257 258
--cpu:: Only report samples for the list of CPUs provided. Multiple CPUs can
	be provided as a comma-separated list with no space: 0,1. Ranges of
	CPUs are specified with -: 0-2. Default is to report samples on all
	CPUs.

259 260 261
-M::
--disassembler-style=:: Set disassembler style for objdump.

262 263 264 265 266 267 268
--source::
	Interleave source code with assembly code. Enabled by default,
	disable with --no-source.

--asm-raw::
	Show raw instruction encoding of assembly instructions.

269 270
--show-total-period:: Show a column with the sum of periods.

271 272 273 274 275 276
-I::
--show-info::
	Display extended information about the perf.data file. This adds
	information which may be very large and thus may clutter the display.
	It currently includes: cpu and numa topology of the host system.

277 278 279 280
-b::
--branch-stack::
	Use the addresses of sampled taken branches instead of the instruction
	address to build the histograms. To generate meaningful output, the
281 282 283 284 285
	perf.data file must have been obtained using perf record -b or
	perf record --branch-filter xxx where xxx is a branch filter option.
	perf report is able to auto-detect whether a perf.data file contains
	branch stacks and it will automatically switch to the branch view mode,
	unless --no-branch-stack is used.
286

287 288 289 290 291
--branch-history::
	Add the addresses of sampled taken branches to the callstack.
	This allows to examine the path the program took to each sample.
	The data collection must have used -b (or -j) and -g.

292 293 294
--objdump=<path>::
        Path to objdump binary.

N
Namhyung Kim 已提交
295 296 297
--group::
	Show event group information together.

298 299 300 301
--demangle::
	Demangle symbol names to human readable form. It's enabled by default,
	disable with --no-demangle.

302 303 304
--demangle-kernel::
	Demangle kernel symbol names to human readable form (for C++ kernels).

305 306 307 308 309 310 311
--mem-mode::
	Use the data addresses of samples in addition to instruction addresses
	to build the histograms.  To generate meaningful output, the perf.data
	file must have been obtained using perf record -d -W and using a
	special event -e cpu/mem-loads/ or -e cpu/mem-stores/. See
	'perf mem' for simpler access.

312 313 314 315
--percent-limit::
	Do not show entries which have an overhead under that percent.
	(Default: 0).

316 317 318 319 320 321 322 323 324
--percentage::
	Determine how to display the overhead percentage of filtered entries.
	Filters can be applied by --comms, --dsos and/or --symbols options and
	Zoom operations on the TUI (thread, dso, etc).

	"relative" means it's relative to filtered entries only so that the
	sum of shown entries will be always 100%.  "absolute" means it retains
	the original value before and after the filter is applied.

325 326 327 328 329 330 331 332 333
--header::
	Show header information in the perf.data file.  This includes
	various information like hostname, OS and perf version, cpu/mem
	info, perf command line, event list and so on.  Currently only
	--stdio output supports this feature.

--header-only::
	Show only perf.data header (forces --stdio).

334 335 336
--itrace::
	Options for decoding instruction tracing data. The options are:

337
include::itrace.txt[]
338 339 340

	To disable decoding entirely, use --no-itrace.

341 342
--full-source-path::
	Show the full path for source files for srcline output.
343

344 345 346 347 348 349 350 351 352 353 354
--show-ref-call-graph::
	When multiple events are sampled, it may not be needed to collect
	callgraphs for all of them. The sample sites are usually nearby,
	and it's enough to collect the callgraphs on a reference event.
	So user can use "call-graph=no" event modifier to disable callgraph
	for other events to reduce the overhead.
	However, perf report cannot show callgraphs for the event which
	disable the callgraph.
	This option extends the perf report to show reference callgraphs,
	which collected by reference event, in no callgraph event.

355 356 357
--socket-filter::
	Only report the samples on the processor socket that match with this filter

358 359
include::callchain-overhead-calculation.txt[]

I
Ingo Molnar 已提交
360 361
SEE ALSO
--------
362
linkperf:perf-stat[1], linkperf:perf-annotate[1]