perf-report.txt 16.8 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 30 31
-q::
--quiet::
	Do not show any message.  (Suppress -v)

32 33
-n::
--show-nr-samples::
34
	Show the number of samples for each symbol
35

36
--show-cpu-utilization::
37 38
        Show sample percentage for different cpu modes.

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

--tid=::
        Only show events for given thread ID (comma separated list).
53 54 55 56 57
-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.
58 59 60
-S::
--symbols=::
	Only consider these symbols. CSV that understands
61 62
	file://filename entries.  This option will affect the percentage of
	the overhead column.  See --percentage for more info.
I
Ingo Molnar 已提交
63

64 65 66
--symbol-filter=::
	Only show symbols that match (partially) with this filter.

67 68 69 70
-U::
--hide-unresolved::
        Only display entries resolved to a symbol.

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

	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
83
	- dso_size: size of library or module executed at the time of sample
84
	- symbol: name of function executed at the time of sample
85
	- symbol_size: size of function executed at the time of sample
86 87 88
	- 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
89
	- socket: processor socket number the task ran at the time of sample
90
	- srcline: filename and line number executed at the time of sample.  The
91
	DWARF debugging info must be provided.
92 93
	- srcfile: file name of the source file of the same. Requires dwarf
	information.
94 95 96
	- 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.
97
	- cgroup_id: ID derived from cgroup namespace device and inode numbers.
98
	- transaction: Transaction abort flags.
99 100 101 102 103 104 105 106 107
	- 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
108 109 110 111 112 113 114 115 116 117 118

	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: 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
119 120
	- srcline_from: source file and line branched from
	- srcline_to: source file and line branched to
121
	- mispredict: "N" for predicted branch, "Y" for mispredicted branch
122 123
	- in_tx: branch in TSX transaction
	- abort: TSX transaction abort.
124
	- cycles: Cycles in basic block
125 126 127

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

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

	- 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 the sample
	- locked: whether the bus was locked at the time of the sample
	- tlb: type of tlb access for the data at the time of the sample
	- mem: type of memory access for the data at the time of the sample
	- snoop: type of snoop (if any) for the data at the time of the sample
	- dcacheline: the cacheline the data address is on at the time of the sample
141
	- phys_daddr: physical address of data being executed on at the time of sample
142 143 144 145

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

146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
	If the data file has tracepoint event(s), following (dynamic) sort keys
	are also available:
	trace, trace_fields, [<event>.]<field>[/raw]

	- trace: pretty printed trace output in a single column
	- trace_fields: fields in tracepoints in separate columns
	- <field name>: optional event and field name for a specific field

	The last form consists of event and field names.  If event name is
	omitted, it searches all events for matching field name.  The matched
	field will be shown only for the event has the field.  The event name
	supports substring match so user doesn't need to specify full subsystem
	and event name everytime.  For example, 'sched:sched_switch' event can
	be shortened to 'switch' as long as it's not ambiguous.  Also event can
	be specified by its index (starting from 1) preceded by the '%'.
	So '%1' is the first event, '%2' is the second, and so on.

	The field name can have '/raw' suffix which disables pretty printing
	and shows raw field value like hex numbers.  The --raw-trace option
	has the same effect for all dynamic sort keys.

	The default sort keys are changed to 'trace' if all events in the data
	file are tracepoint.

170 171 172 173
-F::
--fields=::
	Specify output field - multiple keys can be specified in CSV format.
	Following fields are available:
174
	overhead, overhead_sys, overhead_us, overhead_children, sample and period.
175 176 177 178 179
	Also it can contain any sort key(s).

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

180 181 182
	If the keys starts with a prefix '+', then it will append the specified
        field(s) to the default field order. For example: perf report -F +period,sample.

183 184
-p::
--parent=<regex>::
185 186
        A regex filter to identify parent. The parent is a caller of this
	function and searched through the callchain, thus it requires callchain
K
Kim Phillips 已提交
187
	information recorded. The pattern is in the extended regex format and
188
	defaults to "\^sys_|^do_page_fault", see '--sort parent'.
189 190 191 192 193

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

194
-w::
195
--column-widths=<width[,width...]>::
196
	Force each column width to the provided list, for large terminal
197
	readability.  0 means no limit (default behavior).
198 199 200 201

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

205 206 207 208
-D::
--dump-raw-trace::
        Dump raw trace in ASCII.

209
-g::
210
--call-graph=<print_type,threshold[,print_limit],order,sort_key[,branch],value>::
211
        Display call chains using type, min percent threshold, print limit,
K
Kim Phillips 已提交
212 213
	call order, sort key, optional branch and value.  Note that ordering
	is not fixed so any parameter can be given in an arbitrary order.
214
	One exception is the print_limit which should be preceded by threshold.
215 216

	print_type can be either:
217
	- flat: single column, linear exposure of call chains.
218
	- graph: use a graph tree, displaying absolute overhead rates. (default)
219
	- fractal: like graph, but displays relative rates. Each branch of
220
		 the tree is considered as a new profiled object.
221
	- folded: call chains are displayed in a line, separated by semicolons
222 223 224 225 226 227 228 229 230
	- none: disable call chain display.

	threshold is a percentage value which specifies a minimum percent to be
	included in the output call graph.  Default is 0.5 (%).

	print_limit is only applied when stdio interface is used.  It's to limit
	number of call graph entries in a single hist entry.  Note that it needs
	to be given after threshold (but not necessarily consecutive).
	Default is 0 (unlimited).
231 232 233 234

	order can be either:
	- callee: callee based call graph.
	- caller: inverted caller based call graph.
235
	Default is 'caller' when --children is used, otherwise 'callee'.
236

237 238
	sort_key can be:
	- function: compare on functions (default)
239
	- address: compare on individual code addresses
240
	- srcline: compare on source filename and line number
241

242
	branch can be:
243 244
	- branch: include last branch information in callgraph when available.
	          Usually more convenient to use --branch-history for this.
245

246 247 248 249 250
	value can be:
	- percent: diplay overhead percent (default)
	- period: display event period
	- count: display event count

251 252 253 254
--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.
255 256
	See the `overhead calculation' section for more details. Enabled by
	default, disable with --no-children.
257

258 259 260 261 262
--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.
263 264
	Note that when using the --itrace option the synthesized callchain size
	will override this value if the synthesized callchain size is bigger.
265

266
	Default: 127
267

268 269 270
-G::
--inverted::
        alias for inverted caller based call graph.
271

272 273 274 275 276
--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.

277 278 279
--pretty=<key>::
        Pretty printing style.  key: normal, raw

280 281
--stdio:: Use the stdio interface.

282 283 284 285 286 287 288
--stdio-color::
	'always', 'never' or 'auto', allowing configuring color output
	via the command line, in addition to via "color.ui" .perfconfig.
	Use '--stdio-color always' to generate color even when redirecting
	to a pipe or file. Using just '--stdio-color' is equivalent to
	using 'always'.

289 290 291 292 293
--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.

294 295
--gtk:: Use the GTK2 interface.

296 297 298 299
-k::
--vmlinux=<file>::
        vmlinux pathname

300 301 302
--ignore-vmlinux::
	Ignore vmlinux files.

303 304 305
--kallsyms=<file>::
        kallsyms pathname

306 307 308 309 310 311 312
-m::
--modules::
        Load module symbols. WARNING: This should only be used with -k and
        a LIVE kernel.

-f::
--force::
313
        Don't do ownership validation.
314

315 316 317
--symfs=<directory>::
        Look for files with symbols relative to this directory.

318
-C::
319 320 321 322 323
--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.

324 325 326
-M::
--disassembler-style=:: Set disassembler style for objdump.

327 328 329 330 331 332 333
--source::
	Interleave source code with assembly code. Enabled by default,
	disable with --no-source.

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

334 335
--show-total-period:: Show a column with the sum of periods.

336 337 338 339 340 341
-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.

342 343 344 345
-b::
--branch-stack::
	Use the addresses of sampled taken branches instead of the instruction
	address to build the histograms. To generate meaningful output, the
346 347 348 349 350
	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.
351

352 353 354 355 356
--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.

357 358 359
--objdump=<path>::
        Path to objdump binary.

N
Namhyung Kim 已提交
360
--group::
361 362
	Show event group information together. It forces group output also
	if there are no groups defined in data file.
N
Namhyung Kim 已提交
363

364 365 366 367
--demangle::
	Demangle symbol names to human readable form. It's enabled by default,
	disable with --no-demangle.

368 369 370
--demangle-kernel::
	Demangle kernel symbol names to human readable form (for C++ kernels).

371 372 373 374
--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
375
	special event -e cpu/mem-loads/p or -e cpu/mem-stores/p. See
376 377
	'perf mem' for simpler access.

378 379
--percent-limit::
	Do not show entries which have an overhead under that percent.
380 381 382 383
	(Default: 0).  Note that this option also sets the percent limit (threshold)
	of callchains.  However the default value of callchain threshold is
	different than the default value of hist entries.  Please see the
	--call-graph option for details.
384

385 386 387 388 389 390 391 392 393
--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.

394 395 396 397 398 399 400 401 402
--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).

403 404 405 406 407 408 409
--time::
	Only analyze samples within given time window: <start>,<stop>. Times
	have the format seconds.microseconds. If start is not given (i.e., time
	string is ',x.y') then analysis starts at the beginning of the file. If
	stop time is not given (i.e, time string is 'x.y,') then analysis goes
	to end of file.

410
	Also support time percent with multiple time range. Time string is
411
	'a%/n,b%/m,...' or 'a%-b%,c%-%d,...'.
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429

	For example:
	Select the second 10% time slice:

	  perf report --time 10%/2

	Select from 0% to 10% time slice:

	  perf report --time 0%-10%

	Select the first and second 10% time slices:

	  perf report --time 10%/1,10%/2

	Select from 0% to 10% and 30% to 40% slices:

	  perf report --time 0%-10%,30%-40%

430 431 432
--itrace::
	Options for decoding instruction tracing data. The options are:

433
include::itrace.txt[]
434 435 436

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

437 438
--full-source-path::
	Show the full path for source files for srcline output.
439

440 441 442 443 444 445 446 447 448 449 450
--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.

451 452 453
--socket-filter::
	Only report the samples on the processor socket that match with this filter

454 455 456
--raw-trace::
	When displaying traceevent output, do not use print fmt or plugins.

457 458 459
--hierarchy::
	Enable hierarchical output.

J
Jin Yao 已提交
460 461
--inline::
	If a callgraph address belongs to an inlined function, the inline stack
462 463
	will be printed. Each entry is function name or file/line. Enabled by
	default, disable with --no-inline.
J
Jin Yao 已提交
464

465 466 467 468 469 470 471
--mmaps::
	Show --tasks output plus mmap information in a format similar to
	/proc/<PID>/maps.

	Please note that not all mmaps are stored, options affecting which ones
	are include 'perf record --data', for instance.

472 473 474 475
--stats::
	Display overall events statistics without any further processing.
	(like the one at the end of the perf report -D command)

476 477 478 479
--tasks::
	Display monitored tasks stored in perf data. Displaying pid/tid/ppid
	plus the command string aligned to distinguish parent and child tasks.

480 481
include::callchain-overhead-calculation.txt[]

I
Ingo Molnar 已提交
482 483
SEE ALSO
--------
484
linkperf:perf-stat[1], linkperf:perf-annotate[1], linkperf:perf-record[1]