2009-05-26 15:17:18 +08:00
|
|
|
perf-report(1)
|
2009-05-30 18:38:51 +08:00
|
|
|
==============
|
2009-05-26 15:17:18 +08:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2009-05-27 15:33:18 +08:00
|
|
|
perf-report - Read perf.data (created by perf record) and display the profile
|
2009-05-26 15:17:18 +08:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
[verse]
|
|
|
|
'perf report' [-i <file> | --input=file]
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
This command displays the performance counter profile information recorded
|
2009-06-23 22:39:53 +08:00
|
|
|
via perf record.
|
2009-05-26 15:17:18 +08:00
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
-i::
|
|
|
|
--input=::
|
2011-12-07 17:02:54 +08:00
|
|
|
Input file name. (default: perf.data unless stdin is a fifo)
|
2010-12-01 09:57:17 +08:00
|
|
|
|
|
|
|
-v::
|
|
|
|
--verbose::
|
|
|
|
Be more verbose. (show symbol address, etc)
|
|
|
|
|
2009-11-09 19:26:13 +08:00
|
|
|
-n::
|
|
|
|
--show-nr-samples::
|
2009-07-11 23:18:37 +08:00
|
|
|
Show the number of samples for each symbol
|
2010-12-01 09:57:17 +08:00
|
|
|
|
|
|
|
--showcpuutilization::
|
|
|
|
Show sample percentage for different cpu modes.
|
|
|
|
|
2009-11-09 19:26:13 +08:00
|
|
|
-T::
|
|
|
|
--threads::
|
2009-08-07 19:55:24 +08:00
|
|
|
Show per-thread event counters
|
2011-11-14 02:30:08 +08:00
|
|
|
-c::
|
2009-07-01 06:01:21 +08:00
|
|
|
--comms=::
|
|
|
|
Only consider symbols in these comms. CSV that understands
|
2014-01-14 10:52:48 +08:00
|
|
|
file://filename entries. This option will affect the percentage of
|
|
|
|
the overhead column. See --percentage for more info.
|
2015-03-24 23:52:41 +08:00
|
|
|
--pid=::
|
|
|
|
Only show events for given process ID (comma separated list).
|
|
|
|
|
|
|
|
--tid=::
|
|
|
|
Only show events for given thread ID (comma separated list).
|
2014-01-14 10:52:48 +08:00
|
|
|
-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.
|
2009-07-01 06:01:22 +08:00
|
|
|
-S::
|
|
|
|
--symbols=::
|
|
|
|
Only consider these symbols. CSV that understands
|
2014-01-14 10:52:48 +08:00
|
|
|
file://filename entries. This option will affect the percentage of
|
|
|
|
the overhead column. See --percentage for more info.
|
2009-05-26 15:17:18 +08:00
|
|
|
|
2012-03-19 10:53:48 +08:00
|
|
|
--symbol-filter=::
|
|
|
|
Only show symbols that match (partially) with this filter.
|
|
|
|
|
2010-12-01 09:57:17 +08:00
|
|
|
-U::
|
|
|
|
--hide-unresolved::
|
|
|
|
Only display entries resolved to a symbol.
|
|
|
|
|
perf diff: Use perf_session__fprintf_hists just like 'perf record'
That means that almost everything you can do with 'perf report'
can be done with 'perf diff', for instance:
$ perf record -f find / > /dev/null
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.062 MB perf.data (~2699
samples) ] $ perf record -f find / > /dev/null
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.062 MB perf.data (~2687
samples) ] perf diff | head -8
9.02% +1.00% find libc-2.10.1.so [.] _IO_vfprintf_internal
2.91% -1.00% find [kernel] [k] __kmalloc
2.85% -1.00% find [kernel] [k] ext4_htree_store_dirent
1.99% -1.00% find [kernel] [k] _atomic_dec_and_lock
2.44% find [kernel] [k] half_md4_transform
$
So if you want to zoom into libc:
$ perf diff --dsos libc-2.10.1.so | head -8
37.34% find [.] _IO_vfprintf_internal
10.34% find [.] __GI_memmove
8.25% +2.00% find [.] _int_malloc
5.07% -1.00% find [.] __GI_mempcpy
7.62% +2.00% find [.] _int_free
$
And if there were multiple commands using libc, it is also
possible to aggregate them all by using --sort symbol:
$ perf diff --dsos libc-2.10.1.so --sort symbol | head -8
37.34% [.] _IO_vfprintf_internal
10.34% [.] __GI_memmove
8.25% +2.00% [.] _int_malloc
5.07% -1.00% [.] __GI_mempcpy
7.62% +2.00% [.] _int_free
$
The displacement column now is off by default, to use it:
perf diff -m --dsos libc-2.10.1.so --sort symbol | head -8
37.34% [.] _IO_vfprintf_internal
10.34% [.] __GI_memmove
8.25% +2.00% [.] _int_malloc
5.07% -1.00% +2 [.] __GI_mempcpy
7.62% +2.00% -1 [.] _int_free
$
Using -t/--field-separator can be used for scripting:
$ perf diff -t, -m --dsos libc-2.10.1.so --sort symbol | head -8
37.34, , ,[.] _IO_vfprintf_internal
10.34, , ,[.] __GI_memmove
8.25,+2.00%, ,[.] _int_malloc
5.07,-1.00%, +2,[.] __GI_mempcpy
7.62,+2.00%, -1,[.] _int_free
6.99,+1.00%, -1,[.] _IO_new_file_xsputn
1.89,-2.00%, +4,[.] __readdir64
$
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1260978567-550-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-12-16 23:49:27 +08:00
|
|
|
-s::
|
|
|
|
--sort=::
|
2012-12-27 17:11:47 +08:00
|
|
|
Sort histogram entries by given key(s) - multiple keys can be specified
|
|
|
|
in CSV format. Following sort keys are available:
|
2013-01-24 23:10:29 +08:00
|
|
|
pid, comm, dso, symbol, parent, cpu, srcline, weight, local_weight.
|
2012-12-27 17:11:47 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
- srcline: filename and line number executed at the time of sample. The
|
2013-09-20 22:40:41 +08:00
|
|
|
DWARF debugging info must be provided.
|
2013-09-20 22:40:43 +08:00
|
|
|
- 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.
|
2014-03-04 08:06:42 +08:00
|
|
|
- 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
|
2012-12-27 17:11:47 +08:00
|
|
|
|
|
|
|
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
|
2013-09-20 22:40:41 +08:00
|
|
|
- in_tx: branch in TSX transaction
|
|
|
|
- abort: TSX transaction abort.
|
2012-12-27 17:11:47 +08:00
|
|
|
|
|
|
|
And default sort keys are changed to comm, dso_from, symbol_from, dso_to
|
|
|
|
and symbol_to, see '--branch-stack'.
|
perf diff: Use perf_session__fprintf_hists just like 'perf record'
That means that almost everything you can do with 'perf report'
can be done with 'perf diff', for instance:
$ perf record -f find / > /dev/null
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.062 MB perf.data (~2699
samples) ] $ perf record -f find / > /dev/null
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.062 MB perf.data (~2687
samples) ] perf diff | head -8
9.02% +1.00% find libc-2.10.1.so [.] _IO_vfprintf_internal
2.91% -1.00% find [kernel] [k] __kmalloc
2.85% -1.00% find [kernel] [k] ext4_htree_store_dirent
1.99% -1.00% find [kernel] [k] _atomic_dec_and_lock
2.44% find [kernel] [k] half_md4_transform
$
So if you want to zoom into libc:
$ perf diff --dsos libc-2.10.1.so | head -8
37.34% find [.] _IO_vfprintf_internal
10.34% find [.] __GI_memmove
8.25% +2.00% find [.] _int_malloc
5.07% -1.00% find [.] __GI_mempcpy
7.62% +2.00% find [.] _int_free
$
And if there were multiple commands using libc, it is also
possible to aggregate them all by using --sort symbol:
$ perf diff --dsos libc-2.10.1.so --sort symbol | head -8
37.34% [.] _IO_vfprintf_internal
10.34% [.] __GI_memmove
8.25% +2.00% [.] _int_malloc
5.07% -1.00% [.] __GI_mempcpy
7.62% +2.00% [.] _int_free
$
The displacement column now is off by default, to use it:
perf diff -m --dsos libc-2.10.1.so --sort symbol | head -8
37.34% [.] _IO_vfprintf_internal
10.34% [.] __GI_memmove
8.25% +2.00% [.] _int_malloc
5.07% -1.00% +2 [.] __GI_mempcpy
7.62% +2.00% -1 [.] _int_free
$
Using -t/--field-separator can be used for scripting:
$ perf diff -t, -m --dsos libc-2.10.1.so --sort symbol | head -8
37.34, , ,[.] _IO_vfprintf_internal
10.34, , ,[.] __GI_memmove
8.25,+2.00%, ,[.] _int_malloc
5.07,-1.00%, +2,[.] __GI_mempcpy
7.62,+2.00%, -1,[.] _int_free
6.99,+1.00%, -1,[.] _IO_new_file_xsputn
1.89,-2.00%, +4,[.] __readdir64
$
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1260978567-550-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-12-16 23:49:27 +08:00
|
|
|
|
2014-03-04 09:46:34 +08:00
|
|
|
-F::
|
|
|
|
--fields=::
|
|
|
|
Specify output field - multiple keys can be specified in CSV format.
|
|
|
|
Following fields are available:
|
2013-10-30 16:05:55 +08:00
|
|
|
overhead, overhead_sys, overhead_us, overhead_children, sample and period.
|
2014-03-04 09:46:34 +08:00
|
|
|
Also it can contain any sort key(s).
|
|
|
|
|
|
|
|
By default, every sort keys not specified in -F will be appended
|
|
|
|
automatically.
|
|
|
|
|
2014-05-24 00:41:23 +08:00
|
|
|
If --mem-mode option is used, following sort keys are also available
|
|
|
|
(incompatible with --branch-stack):
|
2014-06-01 21:38:29 +08:00
|
|
|
symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline.
|
2014-05-24 00:41:23 +08:00
|
|
|
|
|
|
|
- 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
|
2014-06-01 21:38:29 +08:00
|
|
|
- dcacheline: the cacheline the data address is on at the time of sample
|
2014-05-24 00:41:23 +08:00
|
|
|
|
|
|
|
And default sort keys are changed to local_weight, mem, sym, dso,
|
|
|
|
symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'.
|
|
|
|
|
2010-12-01 09:57:17 +08:00
|
|
|
-p::
|
|
|
|
--parent=<regex>::
|
2012-12-27 17:11:47 +08:00
|
|
|
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'.
|
2010-12-01 09:57:17 +08:00
|
|
|
|
|
|
|
-x::
|
|
|
|
--exclude-other::
|
|
|
|
Only display entries with parent-match.
|
|
|
|
|
2009-07-11 09:47:28 +08:00
|
|
|
-w::
|
2010-12-01 09:57:17 +08:00
|
|
|
--column-widths=<width[,width...]>::
|
2009-07-11 09:47:28 +08:00
|
|
|
Force each column width to the provided list, for large terminal
|
2014-07-31 13:47:39 +08:00
|
|
|
readability. 0 means no limit (default behavior).
|
2009-07-11 09:47:28 +08:00
|
|
|
|
|
|
|
-t::
|
|
|
|
--field-separator=::
|
|
|
|
Use a special separator character and don't pad with spaces, replacing
|
2010-12-01 09:57:17 +08:00
|
|
|
all occurrences of this separator in symbol names (and other output)
|
2009-07-11 09:47:28 +08:00
|
|
|
with a '.' character, that thus it's the only non valid separator.
|
|
|
|
|
2010-12-01 09:57:17 +08:00
|
|
|
-D::
|
|
|
|
--dump-raw-trace::
|
|
|
|
Dump raw trace in ASCII.
|
|
|
|
|
perf callchain: Support handling complete branch stacks as histograms
Currently branch stacks can be only shown as edge histograms for
individual branches. I never found this display particularly useful.
This implements an alternative mode that creates histograms over
complete branch traces, instead of individual branches, similar to how
normal callgraphs are handled. This is done by putting it in front of
the normal callgraph and then using the normal callgraph histogram
infrastructure to unify them.
This way in complex functions we can understand the control flow that
lead to a particular sample, and may even see some control flow in the
caller for short functions.
Example (simplified, of course for such simple code this is usually not
needed), please run this after the whole patchkit is in, as at this
point in the patch order there is no --branch-history, that will be
added in a patch after this one:
tcall.c:
volatile a = 10000, b = 100000, c;
__attribute__((noinline)) f2()
{
c = a / b;
}
__attribute__((noinline)) f1()
{
f2();
f2();
}
main()
{
int i;
for (i = 0; i < 1000000; i++)
f1();
}
% perf record -b -g ./tsrc/tcall
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.044 MB perf.data (~1923 samples) ]
% perf report --no-children --branch-history
...
54.91% tcall.c:6 [.] f2 tcall
|
|--65.53%-- f2 tcall.c:5
| |
| |--70.83%-- f1 tcall.c:11
| | f1 tcall.c:10
| | main tcall.c:18
| | main tcall.c:18
| | main tcall.c:17
| | main tcall.c:17
| | f1 tcall.c:13
| | f1 tcall.c:13
| | f2 tcall.c:7
| | f2 tcall.c:5
| | f1 tcall.c:12
| | f1 tcall.c:12
| | f2 tcall.c:7
| | f2 tcall.c:5
| | f1 tcall.c:11
| |
| --29.17%-- f1 tcall.c:12
| f1 tcall.c:12
| f2 tcall.c:7
| f2 tcall.c:5
| f1 tcall.c:11
| f1 tcall.c:10
| main tcall.c:18
| main tcall.c:18
| main tcall.c:17
| main tcall.c:17
| f1 tcall.c:13
| f1 tcall.c:13
| f2 tcall.c:7
| f2 tcall.c:5
| f1 tcall.c:12
The default output is unchanged.
This is only implemented in perf report, no change to record or anywhere
else.
This adds the basic code to report:
- add a new "branch" option to the -g option parser to enable this mode
- when the flag is set include the LBR into the callstack in machine.c.
The rest of the history code is unchanged and doesn't know the
difference between LBR entry and normal call entry.
- detect overlaps with the callchain
- remove small loop duplicates in the LBR
Current limitations:
- The LBR flags (mispredict etc.) are not shown in the history
and LBR entries have no special marker.
- It would be nice if annotate marked the LBR entries somehow
(e.g. with arrows)
v2: Various fixes.
v3: Merge further patches into this one. Fix white space.
v4: Improve manpage. Address review feedback.
v5: Rename functions. Better error message without -g. Fix crash without
-b.
v6: Rebase
v7: Rebase. Use NO_ENTRY in memset.
v8: Port to latest tip. Move add_callchain_ip to separate
patch. Skip initial entries in callchain. Minor cleanups.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1415844328-4884-3-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2014-11-13 10:05:20 +08:00
|
|
|
-g [type,min[,limit],order[,key][,branch]]::
|
2009-08-31 09:32:03 +08:00
|
|
|
--call-graph::
|
2011-12-12 23:16:50 +08:00
|
|
|
Display call chains using type, min percent threshold, optional print
|
|
|
|
limit and order.
|
2009-08-31 09:32:03 +08:00
|
|
|
type can be either:
|
2010-12-01 09:57:17 +08:00
|
|
|
- flat: single column, linear exposure of call chains.
|
2009-08-31 09:32:03 +08:00
|
|
|
- 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. +
|
2011-06-07 23:49:46 +08:00
|
|
|
|
|
|
|
order can be either:
|
|
|
|
- callee: callee based call graph.
|
|
|
|
- caller: inverted caller based call graph.
|
|
|
|
|
2013-07-19 06:33:57 +08:00
|
|
|
key can be:
|
|
|
|
- function: compare on functions
|
|
|
|
- address: compare on individual code addresses
|
|
|
|
|
perf callchain: Support handling complete branch stacks as histograms
Currently branch stacks can be only shown as edge histograms for
individual branches. I never found this display particularly useful.
This implements an alternative mode that creates histograms over
complete branch traces, instead of individual branches, similar to how
normal callgraphs are handled. This is done by putting it in front of
the normal callgraph and then using the normal callgraph histogram
infrastructure to unify them.
This way in complex functions we can understand the control flow that
lead to a particular sample, and may even see some control flow in the
caller for short functions.
Example (simplified, of course for such simple code this is usually not
needed), please run this after the whole patchkit is in, as at this
point in the patch order there is no --branch-history, that will be
added in a patch after this one:
tcall.c:
volatile a = 10000, b = 100000, c;
__attribute__((noinline)) f2()
{
c = a / b;
}
__attribute__((noinline)) f1()
{
f2();
f2();
}
main()
{
int i;
for (i = 0; i < 1000000; i++)
f1();
}
% perf record -b -g ./tsrc/tcall
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.044 MB perf.data (~1923 samples) ]
% perf report --no-children --branch-history
...
54.91% tcall.c:6 [.] f2 tcall
|
|--65.53%-- f2 tcall.c:5
| |
| |--70.83%-- f1 tcall.c:11
| | f1 tcall.c:10
| | main tcall.c:18
| | main tcall.c:18
| | main tcall.c:17
| | main tcall.c:17
| | f1 tcall.c:13
| | f1 tcall.c:13
| | f2 tcall.c:7
| | f2 tcall.c:5
| | f1 tcall.c:12
| | f1 tcall.c:12
| | f2 tcall.c:7
| | f2 tcall.c:5
| | f1 tcall.c:11
| |
| --29.17%-- f1 tcall.c:12
| f1 tcall.c:12
| f2 tcall.c:7
| f2 tcall.c:5
| f1 tcall.c:11
| f1 tcall.c:10
| main tcall.c:18
| main tcall.c:18
| main tcall.c:17
| main tcall.c:17
| f1 tcall.c:13
| f1 tcall.c:13
| f2 tcall.c:7
| f2 tcall.c:5
| f1 tcall.c:12
The default output is unchanged.
This is only implemented in perf report, no change to record or anywhere
else.
This adds the basic code to report:
- add a new "branch" option to the -g option parser to enable this mode
- when the flag is set include the LBR into the callstack in machine.c.
The rest of the history code is unchanged and doesn't know the
difference between LBR entry and normal call entry.
- detect overlaps with the callchain
- remove small loop duplicates in the LBR
Current limitations:
- The LBR flags (mispredict etc.) are not shown in the history
and LBR entries have no special marker.
- It would be nice if annotate marked the LBR entries somehow
(e.g. with arrows)
v2: Various fixes.
v3: Merge further patches into this one. Fix white space.
v4: Improve manpage. Address review feedback.
v5: Rename functions. Better error message without -g. Fix crash without
-b.
v6: Rebase
v7: Rebase. Use NO_ENTRY in memset.
v8: Port to latest tip. Move add_callchain_ip to separate
patch. Skip initial entries in callchain. Minor cleanups.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1415844328-4884-3-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2014-11-13 10:05:20 +08:00
|
|
|
branch can be:
|
|
|
|
- branch: include last branch information in callgraph
|
|
|
|
when available. Usually more convenient to use --branch-history
|
|
|
|
for this.
|
|
|
|
|
2013-07-19 06:33:57 +08:00
|
|
|
Default: fractal,0.5,callee,function.
|
2011-06-07 23:49:46 +08:00
|
|
|
|
2013-10-30 16:05:55 +08:00
|
|
|
--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.
|
2015-04-22 14:33:45 +08:00
|
|
|
See the `overhead calculation' section for more details.
|
2013-10-30 16:05:55 +08:00
|
|
|
|
perf report: Add --max-stack option to limit callchain stack scan
When callgraph data was included in the perf data file, it may take a
long time to scan all those data and merge them together especially if
the stored callchains are long and the perf data file itself is large,
like a Gbyte or so.
The callchain stack is currently limited to PERF_MAX_STACK_DEPTH (127).
This is a large value. Usually the callgraph data that developers are
most interested in are the first few levels, the rests are usually not
looked at.
This patch adds a new --max-stack option to perf-report to limit the
depth of callchain stack data to look at to reduce the time it takes for
perf-report to finish its processing. It trades the presence of trailing
stack information with faster speed.
The following table shows the elapsed time of doing perf-report on a
perf.data file of size 985,531,828 bytes.
--max_stack Elapsed Time Output data size
----------- ------------ ----------------
not set 88.0s 124,422,651
64 87.5s 116,303,213
32 87.2s 112,023,804
16 86.6s 94,326,380
8 59.9s 33,697,248
4 40.7s 10,116,637
-g none 27.1s 2,555,810
Signed-off-by: Waiman Long <Waiman.Long@hp.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Aswin Chandramouleeswaran <aswin@hp.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Scott J Norton <scott.norton@hp.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1382107129-2010-4-git-send-email-Waiman.Long@hp.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-10-18 22:38:48 +08:00
|
|
|
--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.
|
|
|
|
|
|
|
|
Default: 127
|
|
|
|
|
2011-06-07 23:49:46 +08:00
|
|
|
-G::
|
|
|
|
--inverted::
|
|
|
|
alias for inverted caller based call graph.
|
2009-08-31 09:32:03 +08:00
|
|
|
|
2012-12-07 13:48:05 +08:00
|
|
|
--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.
|
|
|
|
|
2010-12-01 09:57:17 +08:00
|
|
|
--pretty=<key>::
|
|
|
|
Pretty printing style. key: normal, raw
|
|
|
|
|
2010-08-21 21:38:16 +08:00
|
|
|
--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.
|
|
|
|
|
2012-03-20 02:13:29 +08:00
|
|
|
--gtk:: Use the GTK2 interface.
|
|
|
|
|
2010-12-01 09:57:17 +08:00
|
|
|
-k::
|
|
|
|
--vmlinux=<file>::
|
|
|
|
vmlinux pathname
|
|
|
|
|
2010-12-08 10:39:46 +08:00
|
|
|
--kallsyms=<file>::
|
|
|
|
kallsyms pathname
|
|
|
|
|
2010-12-01 09:57:17 +08:00
|
|
|
-m::
|
|
|
|
--modules::
|
|
|
|
Load module symbols. WARNING: This should only be used with -k and
|
|
|
|
a LIVE kernel.
|
|
|
|
|
|
|
|
-f::
|
|
|
|
--force::
|
|
|
|
Don't complain, do it.
|
|
|
|
|
2010-12-10 04:27:07 +08:00
|
|
|
--symfs=<directory>::
|
|
|
|
Look for files with symbols relative to this directory.
|
|
|
|
|
2011-11-14 02:30:08 +08:00
|
|
|
-C::
|
2011-07-04 19:57:50 +08:00
|
|
|
--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.
|
|
|
|
|
2011-09-16 05:31:41 +08:00
|
|
|
-M::
|
|
|
|
--disassembler-style=:: Set disassembler style for objdump.
|
|
|
|
|
2011-10-06 23:48:31 +08:00
|
|
|
--source::
|
|
|
|
Interleave source code with assembly code. Enabled by default,
|
|
|
|
disable with --no-source.
|
|
|
|
|
|
|
|
--asm-raw::
|
|
|
|
Show raw instruction encoding of assembly instructions.
|
|
|
|
|
2011-10-06 03:10:06 +08:00
|
|
|
--show-total-period:: Show a column with the sum of periods.
|
|
|
|
|
perf tools: Make perf.data more self-descriptive (v8)
The goal of this patch is to include more information about the host
environment into the perf.data so it is more self-descriptive. Overtime,
profiles are captured on various machines and it becomes hard to track
what was recorded, on what machine and when.
This patch provides a way to solve this by extending the perf.data file
with basic information about the host machine. To add those extensions,
we leverage the feature bits capabilities of the perf.data format. The
change is backward compatible with existing perf.data files.
We define the following useful new extensions:
- HEADER_HOSTNAME: the hostname
- HEADER_OSRELEASE: the kernel release number
- HEADER_ARCH: the hw architecture
- HEADER_CPUDESC: generic CPU description
- HEADER_NRCPUS: number of online/avail cpus
- HEADER_CMDLINE: perf command line
- HEADER_VERSION: perf version
- HEADER_TOPOLOGY: cpu topology
- HEADER_EVENT_DESC: full event description (attrs)
- HEADER_CPUID: easy-to-parse low level CPU identication
The small granularity for the entries is to make it easier to extend
without breaking backward compatiblity. Many entries are provided as
ASCII strings.
Perf report/script have been modified to print the basic information as
easy-to-parse ASCII strings. Extended information about CPU and NUMA
topology may be requested with the -I option.
Thanks to David Ahern for reviewing and testing the many versions of
this patch.
$ perf report --stdio
# ========
# captured on : Mon Sep 26 15:22:14 2011
# hostname : quad
# os release : 3.1.0-rc4-tip
# perf version : 3.1.0-rc4
# arch : x86_64
# nrcpus online : 4
# nrcpus avail : 4
# cpudesc : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
# cpuid : GenuineIntel,6,15,11
# total memory : 8105360 kB
# cmdline : /home/eranian/perfmon/official/tip/build/tools/perf/perf record date
# event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, id = { 29, 30, 31,
# HEADER_CPU_TOPOLOGY info available, use -I to display
# HEADER_NUMA_TOPOLOGY info available, use -I to display
# ========
#
...
$ perf report --stdio -I
# ========
# captured on : Mon Sep 26 15:22:14 2011
# hostname : quad
# os release : 3.1.0-rc4-tip
# perf version : 3.1.0-rc4
# arch : x86_64
# nrcpus online : 4
# nrcpus avail : 4
# cpudesc : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
# cpuid : GenuineIntel,6,15,11
# total memory : 8105360 kB
# cmdline : /home/eranian/perfmon/official/tip/build/tools/perf/perf record date
# event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, id = { 29, 30, 31,
# sibling cores : 0-3
# sibling threads : 0
# sibling threads : 1
# sibling threads : 2
# sibling threads : 3
# node0 meminfo : total = 8320608 kB, free = 7571024 kB
# node0 cpu list : 0-3
# ========
#
...
Reviewed-by: David Ahern <dsahern@gmail.com>
Tested-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/20110930134040.GA5575@quad
Signed-off-by: Stephane Eranian <eranian@google.com>
[ committer notes: Use --show-info in the tools as was in the docs, rename
perf_header_fprintf_info to perf_file_section__fprintf_info, fixup
conflict with f69b64f7 "perf: Support setting the disassembler style" ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-09-30 21:40:40 +08:00
|
|
|
-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.
|
|
|
|
|
perf report: Add support for taken branch sampling
This patch adds support for taken branch sampling, i.e, the
PERF_SAMPLE_BRANCH_STACK feature to perf report. In other
words, to display histograms based on taken branches rather
than executed instructions addresses.
The new option is called -b and it takes no argument. To
generate meaningful output, the perf.data must have been
obtained using perf record -b xxx ... where xxx is a branch
filter option.
The output shows symbols, modules, sorted by 'who branches
where' the most often. The percentages reported in the first
column refer to the total number of branches captured and
not the usual number of samples.
Here is a quick example.
Here branchy is simple test program which looks as follows:
void f2(void)
{}
void f3(void)
{}
void f1(unsigned long n)
{
if (n & 1UL)
f2();
else
f3();
}
int main(void)
{
unsigned long i;
for (i=0; i < N; i++)
f1(i);
return 0;
}
Here is the output captured on Nehalem, if we are
only interested in user level function calls.
$ perf record -b any_call,u -e cycles:u branchy
$ perf report -b --sort=symbol
52.34% [.] main [.] f1
24.04% [.] f1 [.] f3
23.60% [.] f1 [.] f2
0.01% [k] _IO_new_file_xsputn [k] _IO_file_overflow
0.01% [k] _IO_vfprintf_internal [k] _IO_new_file_xsputn
0.01% [k] _IO_vfprintf_internal [k] strchrnul
0.01% [k] __printf [k] _IO_vfprintf_internal
0.01% [k] main [k] __printf
About half (52%) of the call branches captured are from main()
-> f1(). The second half (24%+23%) is split in two equal shares
between f1() -> f2(), f1() ->f3(). The output is as expected
given the code.
It should be noted, that using -b in perf record does not
eliminate information in the perf.data file. Consequently, a
typical profile can also be obtained by perf report by simply
not using its -b option.
It is possible to sort on branch related columns:
- dso_from, symbol_from
- dso_to, symbol_to
- mispredict
Signed-off-by: Roberto Agostino Vitillo <ravitillo@lbl.gov>
Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: peterz@infradead.org
Cc: acme@redhat.com
Cc: robert.richter@amd.com
Cc: ming.m.lin@intel.com
Cc: andi@firstfloor.org
Cc: asharma@fb.com
Cc: vweaver1@eecs.utk.edu
Cc: khandual@linux.vnet.ibm.com
Cc: dsahern@gmail.com
Link: http://lkml.kernel.org/r/1328826068-11713-14-git-send-email-eranian@google.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2012-02-10 06:21:03 +08:00
|
|
|
-b::
|
|
|
|
--branch-stack::
|
|
|
|
Use the addresses of sampled taken branches instead of the instruction
|
|
|
|
address to build the histograms. To generate meaningful output, the
|
2012-03-09 06:47:47 +08:00
|
|
|
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.
|
perf report: Add support for taken branch sampling
This patch adds support for taken branch sampling, i.e, the
PERF_SAMPLE_BRANCH_STACK feature to perf report. In other
words, to display histograms based on taken branches rather
than executed instructions addresses.
The new option is called -b and it takes no argument. To
generate meaningful output, the perf.data must have been
obtained using perf record -b xxx ... where xxx is a branch
filter option.
The output shows symbols, modules, sorted by 'who branches
where' the most often. The percentages reported in the first
column refer to the total number of branches captured and
not the usual number of samples.
Here is a quick example.
Here branchy is simple test program which looks as follows:
void f2(void)
{}
void f3(void)
{}
void f1(unsigned long n)
{
if (n & 1UL)
f2();
else
f3();
}
int main(void)
{
unsigned long i;
for (i=0; i < N; i++)
f1(i);
return 0;
}
Here is the output captured on Nehalem, if we are
only interested in user level function calls.
$ perf record -b any_call,u -e cycles:u branchy
$ perf report -b --sort=symbol
52.34% [.] main [.] f1
24.04% [.] f1 [.] f3
23.60% [.] f1 [.] f2
0.01% [k] _IO_new_file_xsputn [k] _IO_file_overflow
0.01% [k] _IO_vfprintf_internal [k] _IO_new_file_xsputn
0.01% [k] _IO_vfprintf_internal [k] strchrnul
0.01% [k] __printf [k] _IO_vfprintf_internal
0.01% [k] main [k] __printf
About half (52%) of the call branches captured are from main()
-> f1(). The second half (24%+23%) is split in two equal shares
between f1() -> f2(), f1() ->f3(). The output is as expected
given the code.
It should be noted, that using -b in perf record does not
eliminate information in the perf.data file. Consequently, a
typical profile can also be obtained by perf report by simply
not using its -b option.
It is possible to sort on branch related columns:
- dso_from, symbol_from
- dso_to, symbol_to
- mispredict
Signed-off-by: Roberto Agostino Vitillo <ravitillo@lbl.gov>
Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: peterz@infradead.org
Cc: acme@redhat.com
Cc: robert.richter@amd.com
Cc: ming.m.lin@intel.com
Cc: andi@firstfloor.org
Cc: asharma@fb.com
Cc: vweaver1@eecs.utk.edu
Cc: khandual@linux.vnet.ibm.com
Cc: dsahern@gmail.com
Link: http://lkml.kernel.org/r/1328826068-11713-14-git-send-email-eranian@google.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2012-02-10 06:21:03 +08:00
|
|
|
|
2014-11-13 10:05:22 +08:00
|
|
|
--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.
|
|
|
|
|
2012-09-04 18:32:30 +08:00
|
|
|
--objdump=<path>::
|
|
|
|
Path to objdump binary.
|
|
|
|
|
2013-01-22 17:09:45 +08:00
|
|
|
--group::
|
|
|
|
Show event group information together.
|
|
|
|
|
2013-03-25 17:18:18 +08:00
|
|
|
--demangle::
|
|
|
|
Demangle symbol names to human readable form. It's enabled by default,
|
|
|
|
disable with --no-demangle.
|
|
|
|
|
2014-09-13 12:15:05 +08:00
|
|
|
--demangle-kernel::
|
|
|
|
Demangle kernel symbol names to human readable form (for C++ kernels).
|
|
|
|
|
2014-05-24 00:41:23 +08:00
|
|
|
--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.
|
|
|
|
|
2013-05-14 10:09:04 +08:00
|
|
|
--percent-limit::
|
|
|
|
Do not show entries which have an overhead under that percent.
|
|
|
|
(Default: 0).
|
|
|
|
|
2014-01-14 10:52:48 +08:00
|
|
|
--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.
|
|
|
|
|
2013-12-09 18:02:49 +08:00
|
|
|
--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).
|
|
|
|
|
2015-04-22 14:33:45 +08:00
|
|
|
|
|
|
|
include::callchain-overhead-calculation.txt[]
|
|
|
|
|
2015-04-25 03:29:45 +08:00
|
|
|
--itrace::
|
|
|
|
Options for decoding instruction tracing data. The options are:
|
|
|
|
|
|
|
|
i synthesize instructions events
|
|
|
|
b synthesize branches events
|
|
|
|
c synthesize branches events (calls only)
|
|
|
|
r synthesize branches events (returns only)
|
|
|
|
e synthesize error events
|
|
|
|
d create a debug log
|
|
|
|
g synthesize a call chain for instructions events
|
|
|
|
|
|
|
|
The default is all events i.e. the same as --itrace=ibe
|
|
|
|
|
|
|
|
In addition, the period (default 100000) for instructions events
|
|
|
|
can be specified in units of:
|
|
|
|
|
|
|
|
i instructions
|
|
|
|
t ticks
|
|
|
|
ms milliseconds
|
|
|
|
us microseconds
|
|
|
|
ns nanoseconds (default)
|
|
|
|
|
|
|
|
Also the call chain size (default 16, max. 1024) for instructions
|
|
|
|
events can be specified.
|
|
|
|
|
|
|
|
To disable decoding entirely, use --no-itrace.
|
|
|
|
|
2009-05-26 15:17:18 +08:00
|
|
|
SEE ALSO
|
|
|
|
--------
|
2011-10-06 23:48:31 +08:00
|
|
|
linkperf:perf-stat[1], linkperf:perf-annotate[1]
|