2009-05-26 11:17:18 +04:00
|
|
|
perf-report(1)
|
2009-05-30 14:38:51 +04:00
|
|
|
==============
|
2009-05-26 11:17:18 +04:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2009-05-27 11:33:18 +04:00
|
|
|
perf-report - Read perf.data (created by perf record) and display the profile
|
2009-05-26 11:17:18 +04:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
[verse]
|
|
|
|
'perf report' [-i <file> | --input=file]
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
This command displays the performance counter profile information recorded
|
2009-06-23 18:39:53 +04:00
|
|
|
via perf record.
|
2009-05-26 11:17:18 +04:00
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
-i::
|
|
|
|
--input=::
|
2011-12-07 13:02:54 +04:00
|
|
|
Input file name. (default: perf.data unless stdin is a fifo)
|
2010-12-01 04:57:17 +03:00
|
|
|
|
|
|
|
-v::
|
|
|
|
--verbose::
|
|
|
|
Be more verbose. (show symbol address, etc)
|
|
|
|
|
2017-02-17 11:17:39 +03:00
|
|
|
-q::
|
|
|
|
--quiet::
|
|
|
|
Do not show any message. (Suppress -v)
|
|
|
|
|
2009-11-09 14:26:13 +03:00
|
|
|
-n::
|
|
|
|
--show-nr-samples::
|
2009-07-11 19:18:37 +04:00
|
|
|
Show the number of samples for each symbol
|
2010-12-01 04:57:17 +03:00
|
|
|
|
2015-10-24 18:49:25 +03:00
|
|
|
--show-cpu-utilization::
|
2010-12-01 04:57:17 +03:00
|
|
|
Show sample percentage for different cpu modes.
|
|
|
|
|
2009-11-09 14:26:13 +03:00
|
|
|
-T::
|
|
|
|
--threads::
|
2015-05-09 18:19:42 +03:00
|
|
|
Show per-thread event counters. The input data file should be recorded
|
|
|
|
with -s option.
|
2011-11-13 22:30:08 +04:00
|
|
|
-c::
|
2009-07-01 02:01:21 +04:00
|
|
|
--comms=::
|
|
|
|
Only consider symbols in these comms. CSV that understands
|
2014-01-14 06:52:48 +04:00
|
|
|
file://filename entries. This option will affect the percentage of
|
|
|
|
the overhead column. See --percentage for more info.
|
2015-03-24 18:52:41 +03: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 06:52:48 +04: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 02:01:22 +04:00
|
|
|
-S::
|
|
|
|
--symbols=::
|
|
|
|
Only consider these symbols. CSV that understands
|
2014-01-14 06:52:48 +04:00
|
|
|
file://filename entries. This option will affect the percentage of
|
|
|
|
the overhead column. See --percentage for more info.
|
2009-05-26 11:17:18 +04:00
|
|
|
|
2012-03-19 06:53:48 +04:00
|
|
|
--symbol-filter=::
|
|
|
|
Only show symbols that match (partially) with this filter.
|
|
|
|
|
2010-12-01 04:57:17 +03: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 18:49:27 +03:00
|
|
|
-s::
|
|
|
|
--sort=::
|
2012-12-27 13:11:47 +04:00
|
|
|
Sort histogram entries by given key(s) - multiple keys can be specified
|
|
|
|
in CSV format. Following sort keys are available:
|
perf tools: Add 'cgroup_id' sort order keyword
This patch introduces a cgroup identifier entry field in perf report to
identify or distinguish data of different cgroups. It uses the device
number and inode number of cgroup namespace, included in perf data with
the new PERF_RECORD_NAMESPACES event, as cgroup identifier.
With the assumption that each container is created with it's own cgroup
namespace, this allows assessment/analysis of multiple containers at
once.
A simple test for this would be to clone a few processes passing
SIGCHILD & CLONE_NEWCROUP flags to each of them, execute shell and run
different workloads on each of those contexts, while running perf
record command with --namespaces option.
Shown below is the output of perf report, sorted with cgroup identifier,
on perf.data generated with the above test scenario, clearly indicating
one context's considerable use of kernel memory in comparison with
others:
$ perf report -s cgroup_id,sample --stdio
#
# Total Lost Samples: 0
#
# Samples: 5K of event 'kmem:kmalloc'
# Event count (approx.): 5965
#
# Overhead cgroup id (dev/inode) Samples
# ........ ..................... ............
#
81.27% 3/0xeffffffb 4848
16.24% 3/0xf00000d0 969
1.16% 3/0xf00000ce 69
0.82% 3/0xf00000cf 49
0.50% 0/0x0 30
While this is a start, there is further scope of improving this. For
example, instead of cgroup namespace's device and inode numbers, dev
and inode numbers of some or all namespaces may be used to distinguish
which processes are running in a given container context.
Also, scripts to map device and inode info to containers sounds
plausible for better tracing of containers.
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sargun Dhillon <sargun@sargun.me>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/148891933338.25309.756882900782042645.stgit@hbathini.in.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-03-07 23:42:13 +03:00
|
|
|
pid, comm, dso, symbol, parent, cpu, socket, srcline, weight,
|
|
|
|
local_weight, cgroup_id.
|
2012-12-27 13:11:47 +04: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
|
2017-02-24 16:32:56 +03:00
|
|
|
- symbol_size: size of function executed at the time of sample
|
2012-12-27 13:11:47 +04:00
|
|
|
- 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
|
2015-09-04 17:45:43 +03:00
|
|
|
- socket: processor socket number the task ran at the time of sample
|
2012-12-27 13:11:47 +04:00
|
|
|
- srcline: filename and line number executed at the time of sample. The
|
2013-09-20 18:40:41 +04:00
|
|
|
DWARF debugging info must be provided.
|
2015-08-08 01:54:24 +03:00
|
|
|
- srcfile: file name of the source file of the same. Requires dwarf
|
|
|
|
information.
|
2013-09-20 18:40:43 +04: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.
|
perf tools: Add 'cgroup_id' sort order keyword
This patch introduces a cgroup identifier entry field in perf report to
identify or distinguish data of different cgroups. It uses the device
number and inode number of cgroup namespace, included in perf data with
the new PERF_RECORD_NAMESPACES event, as cgroup identifier.
With the assumption that each container is created with it's own cgroup
namespace, this allows assessment/analysis of multiple containers at
once.
A simple test for this would be to clone a few processes passing
SIGCHILD & CLONE_NEWCROUP flags to each of them, execute shell and run
different workloads on each of those contexts, while running perf
record command with --namespaces option.
Shown below is the output of perf report, sorted with cgroup identifier,
on perf.data generated with the above test scenario, clearly indicating
one context's considerable use of kernel memory in comparison with
others:
$ perf report -s cgroup_id,sample --stdio
#
# Total Lost Samples: 0
#
# Samples: 5K of event 'kmem:kmalloc'
# Event count (approx.): 5965
#
# Overhead cgroup id (dev/inode) Samples
# ........ ..................... ............
#
81.27% 3/0xeffffffb 4848
16.24% 3/0xf00000d0 969
1.16% 3/0xf00000ce 69
0.82% 3/0xf00000cf 49
0.50% 0/0x0 30
While this is a start, there is further scope of improving this. For
example, instead of cgroup namespace's device and inode numbers, dev
and inode numbers of some or all namespaces may be used to distinguish
which processes are running in a given container context.
Also, scripts to map device and inode info to containers sounds
plausible for better tracing of containers.
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sargun Dhillon <sargun@sargun.me>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/148891933338.25309.756882900782042645.stgit@hbathini.in.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-03-07 23:42:13 +03:00
|
|
|
- cgroup_id: ID derived from cgroup namespace device and inode numbers.
|
2013-09-20 18:40:43 +04:00
|
|
|
- transaction: Transaction abort flags.
|
2014-03-04 04:06:42 +04: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 13:11:47 +04: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: 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
|
2016-05-20 23:15:08 +03:00
|
|
|
- srcline_from: source file and line branched from
|
|
|
|
- srcline_to: source file and line branched to
|
2012-12-27 13:11:47 +04:00
|
|
|
- mispredict: "N" for predicted branch, "Y" for mispredicted branch
|
2013-09-20 18:40:41 +04:00
|
|
|
- in_tx: branch in TSX transaction
|
|
|
|
- abort: TSX transaction abort.
|
2015-07-18 18:24:46 +03:00
|
|
|
- cycles: Cycles in basic block
|
2012-12-27 13:11:47 +04: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 18:49:27 +03:00
|
|
|
|
2016-02-03 17:11:20 +03:00
|
|
|
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
|
2017-08-29 20:11:09 +03:00
|
|
|
- phys_daddr: physical address of data being executed on at the time of sample
|
2016-02-03 17:11:20 +03:00
|
|
|
|
|
|
|
And the default sort keys are changed to local_weight, mem, sym, dso,
|
|
|
|
symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'.
|
|
|
|
|
2016-01-05 13:58:36 +03:00
|
|
|
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.
|
|
|
|
|
2014-03-04 05:46:34 +04:00
|
|
|
-F::
|
|
|
|
--fields=::
|
|
|
|
Specify output field - multiple keys can be specified in CSV format.
|
|
|
|
Following fields are available:
|
2013-10-30 12:05:55 +04:00
|
|
|
overhead, overhead_sys, overhead_us, overhead_children, sample and period.
|
2014-03-04 05:46:34 +04:00
|
|
|
Also it can contain any sort key(s).
|
|
|
|
|
|
|
|
By default, every sort keys not specified in -F will be appended
|
|
|
|
automatically.
|
|
|
|
|
2017-03-13 11:32:52 +03:00
|
|
|
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.
|
|
|
|
|
2010-12-01 04:57:17 +03:00
|
|
|
-p::
|
|
|
|
--parent=<regex>::
|
2012-12-27 13:11:47 +04:00
|
|
|
A regex filter to identify parent. The parent is a caller of this
|
|
|
|
function and searched through the callchain, thus it requires callchain
|
2017-05-03 15:13:50 +03:00
|
|
|
information recorded. The pattern is in the extended regex format and
|
2012-12-27 13:11:47 +04:00
|
|
|
defaults to "\^sys_|^do_page_fault", see '--sort parent'.
|
2010-12-01 04:57:17 +03:00
|
|
|
|
|
|
|
-x::
|
|
|
|
--exclude-other::
|
|
|
|
Only display entries with parent-match.
|
|
|
|
|
2009-07-11 05:47:28 +04:00
|
|
|
-w::
|
2010-12-01 04:57:17 +03:00
|
|
|
--column-widths=<width[,width...]>::
|
2009-07-11 05:47:28 +04:00
|
|
|
Force each column width to the provided list, for large terminal
|
2014-07-31 09:47:39 +04:00
|
|
|
readability. 0 means no limit (default behavior).
|
2009-07-11 05:47:28 +04:00
|
|
|
|
|
|
|
-t::
|
|
|
|
--field-separator=::
|
|
|
|
Use a special separator character and don't pad with spaces, replacing
|
2010-12-01 04:57:17 +03:00
|
|
|
all occurrences of this separator in symbol names (and other output)
|
2009-07-11 05:47:28 +04:00
|
|
|
with a '.' character, that thus it's the only non valid separator.
|
|
|
|
|
2010-12-01 04:57:17 +03:00
|
|
|
-D::
|
|
|
|
--dump-raw-trace::
|
|
|
|
Dump raw trace in ASCII.
|
|
|
|
|
perf tools: Improve call graph documents and help messages
The --call-graph option is complex so we should provide better guide for
users. Also change help message to be consistent with config option
names. Now perf top will show help like below:
$ perf top --call-graph
Error: option `call-graph' requires a value
Usage: perf top [<options>]
--call-graph <record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]>
setup and enables call-graph (stack chain/backtrace):
record_mode: call graph recording mode (fp|dwarf|lbr)
record_size: if record_mode is 'dwarf', max size of stack recording (<bytes>)
default: 8192 (bytes)
print_type: call graph printing style (graph|flat|fractal|none)
threshold: minimum call graph inclusion threshold (<percent>)
print_limit: maximum number of call graph entry (<number>)
order: call graph order (caller|callee)
sort_key: call graph sort key (function|address)
branch: include last branch info to call graph (branch)
Default: fp,graph,0.5,caller,function
Requested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Chandler Carruth <chandlerc@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1445524112-5201-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-10-22 17:28:32 +03:00
|
|
|
-g::
|
2015-11-09 08:45:41 +03:00
|
|
|
--call-graph=<print_type,threshold[,print_limit],order,sort_key[,branch],value>::
|
perf tools: Improve call graph documents and help messages
The --call-graph option is complex so we should provide better guide for
users. Also change help message to be consistent with config option
names. Now perf top will show help like below:
$ perf top --call-graph
Error: option `call-graph' requires a value
Usage: perf top [<options>]
--call-graph <record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]>
setup and enables call-graph (stack chain/backtrace):
record_mode: call graph recording mode (fp|dwarf|lbr)
record_size: if record_mode is 'dwarf', max size of stack recording (<bytes>)
default: 8192 (bytes)
print_type: call graph printing style (graph|flat|fractal|none)
threshold: minimum call graph inclusion threshold (<percent>)
print_limit: maximum number of call graph entry (<number>)
order: call graph order (caller|callee)
sort_key: call graph sort key (function|address)
branch: include last branch info to call graph (branch)
Default: fp,graph,0.5,caller,function
Requested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Chandler Carruth <chandlerc@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1445524112-5201-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-10-22 17:28:32 +03:00
|
|
|
Display call chains using type, min percent threshold, print limit,
|
2017-05-03 15:13:50 +03:00
|
|
|
call order, sort key, optional branch and value. Note that ordering
|
|
|
|
is not fixed so any parameter can be given in an arbitrary order.
|
2015-11-09 08:45:41 +03:00
|
|
|
One exception is the print_limit which should be preceded by threshold.
|
perf tools: Improve call graph documents and help messages
The --call-graph option is complex so we should provide better guide for
users. Also change help message to be consistent with config option
names. Now perf top will show help like below:
$ perf top --call-graph
Error: option `call-graph' requires a value
Usage: perf top [<options>]
--call-graph <record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]>
setup and enables call-graph (stack chain/backtrace):
record_mode: call graph recording mode (fp|dwarf|lbr)
record_size: if record_mode is 'dwarf', max size of stack recording (<bytes>)
default: 8192 (bytes)
print_type: call graph printing style (graph|flat|fractal|none)
threshold: minimum call graph inclusion threshold (<percent>)
print_limit: maximum number of call graph entry (<number>)
order: call graph order (caller|callee)
sort_key: call graph sort key (function|address)
branch: include last branch info to call graph (branch)
Default: fp,graph,0.5,caller,function
Requested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Chandler Carruth <chandlerc@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1445524112-5201-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-10-22 17:28:32 +03:00
|
|
|
|
|
|
|
print_type can be either:
|
2010-12-01 04:57:17 +03:00
|
|
|
- flat: single column, linear exposure of call chains.
|
perf tools: Improve call graph documents and help messages
The --call-graph option is complex so we should provide better guide for
users. Also change help message to be consistent with config option
names. Now perf top will show help like below:
$ perf top --call-graph
Error: option `call-graph' requires a value
Usage: perf top [<options>]
--call-graph <record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]>
setup and enables call-graph (stack chain/backtrace):
record_mode: call graph recording mode (fp|dwarf|lbr)
record_size: if record_mode is 'dwarf', max size of stack recording (<bytes>)
default: 8192 (bytes)
print_type: call graph printing style (graph|flat|fractal|none)
threshold: minimum call graph inclusion threshold (<percent>)
print_limit: maximum number of call graph entry (<number>)
order: call graph order (caller|callee)
sort_key: call graph sort key (function|address)
branch: include last branch info to call graph (branch)
Default: fp,graph,0.5,caller,function
Requested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Chandler Carruth <chandlerc@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1445524112-5201-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-10-22 17:28:32 +03:00
|
|
|
- graph: use a graph tree, displaying absolute overhead rates. (default)
|
2009-08-31 05:32:03 +04:00
|
|
|
- fractal: like graph, but displays relative rates. Each branch of
|
perf tools: Improve call graph documents and help messages
The --call-graph option is complex so we should provide better guide for
users. Also change help message to be consistent with config option
names. Now perf top will show help like below:
$ perf top --call-graph
Error: option `call-graph' requires a value
Usage: perf top [<options>]
--call-graph <record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]>
setup and enables call-graph (stack chain/backtrace):
record_mode: call graph recording mode (fp|dwarf|lbr)
record_size: if record_mode is 'dwarf', max size of stack recording (<bytes>)
default: 8192 (bytes)
print_type: call graph printing style (graph|flat|fractal|none)
threshold: minimum call graph inclusion threshold (<percent>)
print_limit: maximum number of call graph entry (<number>)
order: call graph order (caller|callee)
sort_key: call graph sort key (function|address)
branch: include last branch info to call graph (branch)
Default: fp,graph,0.5,caller,function
Requested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Chandler Carruth <chandlerc@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1445524112-5201-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-10-22 17:28:32 +03:00
|
|
|
the tree is considered as a new profiled object.
|
2015-11-09 08:45:37 +03:00
|
|
|
- folded: call chains are displayed in a line, separated by semicolons
|
perf tools: Improve call graph documents and help messages
The --call-graph option is complex so we should provide better guide for
users. Also change help message to be consistent with config option
names. Now perf top will show help like below:
$ perf top --call-graph
Error: option `call-graph' requires a value
Usage: perf top [<options>]
--call-graph <record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]>
setup and enables call-graph (stack chain/backtrace):
record_mode: call graph recording mode (fp|dwarf|lbr)
record_size: if record_mode is 'dwarf', max size of stack recording (<bytes>)
default: 8192 (bytes)
print_type: call graph printing style (graph|flat|fractal|none)
threshold: minimum call graph inclusion threshold (<percent>)
print_limit: maximum number of call graph entry (<number>)
order: call graph order (caller|callee)
sort_key: call graph sort key (function|address)
branch: include last branch info to call graph (branch)
Default: fp,graph,0.5,caller,function
Requested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Chandler Carruth <chandlerc@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1445524112-5201-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-10-22 17:28:32 +03:00
|
|
|
- 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).
|
2011-06-07 19:49:46 +04:00
|
|
|
|
|
|
|
order can be either:
|
|
|
|
- callee: callee based call graph.
|
|
|
|
- caller: inverted caller based call graph.
|
perf tools: Improve call graph documents and help messages
The --call-graph option is complex so we should provide better guide for
users. Also change help message to be consistent with config option
names. Now perf top will show help like below:
$ perf top --call-graph
Error: option `call-graph' requires a value
Usage: perf top [<options>]
--call-graph <record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]>
setup and enables call-graph (stack chain/backtrace):
record_mode: call graph recording mode (fp|dwarf|lbr)
record_size: if record_mode is 'dwarf', max size of stack recording (<bytes>)
default: 8192 (bytes)
print_type: call graph printing style (graph|flat|fractal|none)
threshold: minimum call graph inclusion threshold (<percent>)
print_limit: maximum number of call graph entry (<number>)
order: call graph order (caller|callee)
sort_key: call graph sort key (function|address)
branch: include last branch info to call graph (branch)
Default: fp,graph,0.5,caller,function
Requested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Chandler Carruth <chandlerc@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1445524112-5201-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-10-22 17:28:32 +03:00
|
|
|
Default is 'caller' when --children is used, otherwise 'callee'.
|
2011-06-07 19:49:46 +04:00
|
|
|
|
perf tools: Improve call graph documents and help messages
The --call-graph option is complex so we should provide better guide for
users. Also change help message to be consistent with config option
names. Now perf top will show help like below:
$ perf top --call-graph
Error: option `call-graph' requires a value
Usage: perf top [<options>]
--call-graph <record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]>
setup and enables call-graph (stack chain/backtrace):
record_mode: call graph recording mode (fp|dwarf|lbr)
record_size: if record_mode is 'dwarf', max size of stack recording (<bytes>)
default: 8192 (bytes)
print_type: call graph printing style (graph|flat|fractal|none)
threshold: minimum call graph inclusion threshold (<percent>)
print_limit: maximum number of call graph entry (<number>)
order: call graph order (caller|callee)
sort_key: call graph sort key (function|address)
branch: include last branch info to call graph (branch)
Default: fp,graph,0.5,caller,function
Requested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Chandler Carruth <chandlerc@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1445524112-5201-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-10-22 17:28:32 +03:00
|
|
|
sort_key can be:
|
|
|
|
- function: compare on functions (default)
|
2013-07-19 02:33:57 +04:00
|
|
|
- address: compare on individual code addresses
|
2017-03-19 00:49:28 +03:00
|
|
|
- srcline: compare on source filename and line number
|
2013-07-19 02:33:57 +04:00
|
|
|
|
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 05:05:20 +03:00
|
|
|
branch can be:
|
perf tools: Improve call graph documents and help messages
The --call-graph option is complex so we should provide better guide for
users. Also change help message to be consistent with config option
names. Now perf top will show help like below:
$ perf top --call-graph
Error: option `call-graph' requires a value
Usage: perf top [<options>]
--call-graph <record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]>
setup and enables call-graph (stack chain/backtrace):
record_mode: call graph recording mode (fp|dwarf|lbr)
record_size: if record_mode is 'dwarf', max size of stack recording (<bytes>)
default: 8192 (bytes)
print_type: call graph printing style (graph|flat|fractal|none)
threshold: minimum call graph inclusion threshold (<percent>)
print_limit: maximum number of call graph entry (<number>)
order: call graph order (caller|callee)
sort_key: call graph sort key (function|address)
branch: include last branch info to call graph (branch)
Default: fp,graph,0.5,caller,function
Requested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Chandler Carruth <chandlerc@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1445524112-5201-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-10-22 17:28:32 +03:00
|
|
|
- branch: include last branch information in callgraph when available.
|
|
|
|
Usually more convenient to use --branch-history for this.
|
2011-06-07 19:49:46 +04:00
|
|
|
|
2015-11-09 08:45:41 +03:00
|
|
|
value can be:
|
|
|
|
- percent: diplay overhead percent (default)
|
|
|
|
- period: display event period
|
|
|
|
- count: display event count
|
|
|
|
|
2013-10-30 12:05:55 +04: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.
|
2016-12-02 19:07:32 +03:00
|
|
|
See the `overhead calculation' section for more details. Enabled by
|
|
|
|
default, disable with --no-children.
|
2013-10-30 12:05:55 +04: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 18:38:48 +04: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.
|
2015-09-29 11:52:37 +03:00
|
|
|
Note that when using the --itrace option the synthesized callchain size
|
|
|
|
will override this value if the synthesized callchain size is bigger.
|
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 18:38:48 +04:00
|
|
|
|
2016-05-19 17:34:06 +03:00
|
|
|
Default: 127
|
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 18:38:48 +04:00
|
|
|
|
2011-06-07 19:49:46 +04:00
|
|
|
-G::
|
|
|
|
--inverted::
|
|
|
|
alias for inverted caller based call graph.
|
2009-08-31 05:32:03 +04:00
|
|
|
|
2012-12-07 09:48:05 +04: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 04:57:17 +03:00
|
|
|
--pretty=<key>::
|
|
|
|
Pretty printing style. key: normal, raw
|
|
|
|
|
2010-08-21 17:38:16 +04:00
|
|
|
--stdio:: Use the stdio interface.
|
|
|
|
|
2016-07-05 17:14:38 +03:00
|
|
|
--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'.
|
|
|
|
|
2010-08-21 17:38:16 +04:00
|
|
|
--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-19 22:13:29 +04:00
|
|
|
--gtk:: Use the GTK2 interface.
|
|
|
|
|
2010-12-01 04:57:17 +03:00
|
|
|
-k::
|
|
|
|
--vmlinux=<file>::
|
|
|
|
vmlinux pathname
|
|
|
|
|
2010-12-08 05:39:46 +03:00
|
|
|
--kallsyms=<file>::
|
|
|
|
kallsyms pathname
|
|
|
|
|
2010-12-01 04:57:17 +03:00
|
|
|
-m::
|
|
|
|
--modules::
|
|
|
|
Load module symbols. WARNING: This should only be used with -k and
|
|
|
|
a LIVE kernel.
|
|
|
|
|
|
|
|
-f::
|
|
|
|
--force::
|
2016-03-24 15:52:19 +03:00
|
|
|
Don't do ownership validation.
|
2010-12-01 04:57:17 +03:00
|
|
|
|
2010-12-09 23:27:07 +03:00
|
|
|
--symfs=<directory>::
|
|
|
|
Look for files with symbols relative to this directory.
|
|
|
|
|
2011-11-13 22:30:08 +04:00
|
|
|
-C::
|
2011-07-04 15:57:50 +04: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 01:31:41 +04:00
|
|
|
-M::
|
|
|
|
--disassembler-style=:: Set disassembler style for objdump.
|
|
|
|
|
2011-10-06 19:48:31 +04: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-05 23:10:06 +04: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 17:40:40 +04: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 02:21:03 +04: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 02:47:47 +04: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 02:21:03 +04:00
|
|
|
|
2014-11-13 05:05:22 +03: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 14:32:30 +04:00
|
|
|
--objdump=<path>::
|
|
|
|
Path to objdump binary.
|
|
|
|
|
2013-01-22 13:09:45 +04:00
|
|
|
--group::
|
|
|
|
Show event group information together.
|
|
|
|
|
2013-03-25 13:18:18 +04:00
|
|
|
--demangle::
|
|
|
|
Demangle symbol names to human readable form. It's enabled by default,
|
|
|
|
disable with --no-demangle.
|
|
|
|
|
2014-09-13 08:15:05 +04:00
|
|
|
--demangle-kernel::
|
|
|
|
Demangle kernel symbol names to human readable form (for C++ kernels).
|
|
|
|
|
2014-05-23 20:41:23 +04: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 06:09:04 +04:00
|
|
|
--percent-limit::
|
|
|
|
Do not show entries which have an overhead under that percent.
|
2016-02-03 17:11:21 +03:00
|
|
|
(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.
|
2013-05-14 06:09:04 +04:00
|
|
|
|
2014-01-14 06:52:48 +04: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 14:02:49 +04: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).
|
|
|
|
|
perf report: Add option to specify time window of interest
Add option to allow user to control analysis window. e.g., collect data
for time window and analyze a segment of interest within that window.
Committer notes:
Testing it:
Using the perf.data file captured via 'perf kmem record':
# perf report --header-only
# ========
# captured on: Tue Nov 29 16:01:53 2016
# hostname : jouet
# os release : 4.8.8-300.fc25.x86_64
# perf version : 4.9.rc6.g5a6aca
# arch : x86_64
# nrcpus online : 4
# nrcpus avail : 4
# cpudesc : Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
# cpuid : GenuineIntel,6,61,4
# total memory : 20254660 kB
# cmdline : /home/acme/bin/perf kmem record usleep 1
# event : name = kmem:kmalloc, , id = { 931980, 931981, 931982, 931983 }, type = 2, size = 112, config = 0x1b9, { sample_period, sample_freq } = 1, sample_typ
# event : name = kmem:kmalloc_node, , id = { 931984, 931985, 931986, 931987 }, type = 2, size = 112, config = 0x1b7, { sample_period, sample_freq } = 1, sampl
# event : name = kmem:kfree, , id = { 931988, 931989, 931990, 931991 }, type = 2, size = 112, config = 0x1b5, { sample_period, sample_freq } = 1, sample_type
# event : name = kmem:kmem_cache_alloc, , id = { 931992, 931993, 931994, 931995 }, type = 2, size = 112, config = 0x1b8, { sample_period, sample_freq } = 1, s
# event : name = kmem:kmem_cache_alloc_node, , id = { 931996, 931997, 931998, 931999 }, type = 2, size = 112, config = 0x1b6, { sample_period, sample_freq } =
# event : name = kmem:kmem_cache_free, , id = { 932000, 932001, 932002, 932003 }, type = 2, size = 112, config = 0x1b4, { sample_period, sample_freq } = 1, sa
# HEADER_CPU_TOPOLOGY info available, use -I to display
# HEADER_NUMA_TOPOLOGY info available, use -I to display
# pmu mappings: cpu = 4, intel_pt = 7, intel_bts = 6, uncore_arb = 13, cstate_pkg = 15, breakpoint = 5, uncore_cbox_1 = 12, power = 9, software = 1, uncore_im
# HEADER_CACHE info available, use -I to display
# missing features: HEADER_BRANCH_STACK HEADER_GROUP_DESC HEADER_AUXTRACE HEADER_STAT
# ========
#
# # Looking at just the histogram entries for the first event:
#
# perf report | head -33
# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 40 of event 'kmem:kmalloc'
# Event count (approx.): 40
#
# Overhead Trace output
# ........ ...............................................................................................................
#
37.50% call_site=ffffffffb91ad3c7 ptr=0xffff88895fc05000 bytes_req=4096 bytes_alloc=4096 gfp_flags=GFP_KERNEL
10.00% call_site=ffffffffb9258416 ptr=0xffff888a1dc61f00 bytes_req=240 bytes_alloc=256 gfp_flags=GFP_KERNEL|__GFP_ZERO
7.50% call_site=ffffffffb9258416 ptr=0xffff888a2640ac00 bytes_req=240 bytes_alloc=256 gfp_flags=GFP_KERNEL|__GFP_ZERO
2.50% call_site=ffffffffb92759ba ptr=0xffff888a26776000 bytes_req=4096 bytes_alloc=4096 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb9276864 ptr=0xffff8886f6b82600 bytes_req=136 bytes_alloc=192 gfp_flags=GFP_KERNEL|__GFP_ZERO
2.50% call_site=ffffffffb9276903 ptr=0xffff888aefcf0460 bytes_req=32 bytes_alloc=32 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb92ad0ce ptr=0xffff888756c98a00 bytes_req=392 bytes_alloc=512 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb92ad0ce ptr=0xffff888756c9ba00 bytes_req=504 bytes_alloc=512 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb92ad301 ptr=0xffff888a31747600 bytes_req=128 bytes_alloc=128 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb92ad511 ptr=0xffff888a9d26a2a0 bytes_req=28 bytes_alloc=32 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c11a0 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c12c0 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c1540 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c15a0 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c15e0 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c16e0 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c1c20 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb936a7fb ptr=0xffff888a9d26a2a0 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
2.50% call_site=ffffffffb9373e66 ptr=0xffff8889f1931240 bytes_req=64 bytes_alloc=64 gfp_flags=GFP_ATOMIC|__GFP_ZERO
2.50% call_site=ffffffffb9373e66 ptr=0xffff8889f1931980 bytes_req=64 bytes_alloc=64 gfp_flags=GFP_ATOMIC|__GFP_ZERO
2.50% call_site=ffffffffb9373e66 ptr=0xffff8889f1931a00 bytes_req=64 bytes_alloc=64 gfp_flags=GFP_ATOMIC|__GFP_ZERO
#
# # And then limiting using the example for 'perf kmem stat --time' used
# # in the previous changeset committer note we see that there were no
# # kmem:kmalloc in that last part of the file, but there were some
# # kmem:kmem_cache_alloc ones:
#
# perf report --time 20119.782088, --stdio
#
# Total Lost Samples: 0
#
# Samples: 0 of event 'kmem:kmalloc'
# Event count (approx.): 0
#
# Overhead Trace output
# ........ ............
#
# Samples: 0 of event 'kmem:kmalloc_node'
# Event count (approx.): 0
#
# Overhead Trace output
# ........ ............
#
# Samples: 0 of event 'kmem:kfree'
# Event count (approx.): 0
#
# Overhead Trace output
# ........ ............
#
# Samples: 8 of event 'kmem:kmem_cache_alloc'
# Event count (approx.): 8
#
# Overhead Trace output
# ........ ..................................................................................................................
#
75.00% call_site=ffffffffb9333b42 ptr=0xffff888bdf1a39c0 bytes_req=48 bytes_alloc=48 gfp_flags=GFP_NOFS|__GFP_ZERO
12.50% call_site=ffffffffb90ad33a ptr=0xffff8889f071f6e0 bytes_req=160 bytes_alloc=160 gfp_flags=GFP_ATOMIC|__GFP_NOTRACK
12.50% call_site=ffffffffb9287cc1 ptr=0xffff8889b12722d8 bytes_req=104 bytes_alloc=104 gfp_flags=GFP_NOFS|__GFP_ZERO
#
Signed-off-by: David Ahern <dsahern@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1480439746-42695-7-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-11-29 20:15:46 +03:00
|
|
|
--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.
|
|
|
|
|
2017-12-08 16:13:45 +03:00
|
|
|
Also support time percent with multiple time range. Time string is
|
|
|
|
'a%/n,b%/m,...' or 'a%-b%,c%-%d,...'. The maximum number of slices is 10.
|
|
|
|
|
|
|
|
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%
|
|
|
|
|
2015-04-24 22:29:45 +03:00
|
|
|
--itrace::
|
|
|
|
Options for decoding instruction tracing data. The options are:
|
|
|
|
|
2015-07-17 19:33:44 +03:00
|
|
|
include::itrace.txt[]
|
2015-04-24 22:29:45 +03:00
|
|
|
|
|
|
|
To disable decoding entirely, use --no-itrace.
|
|
|
|
|
2015-08-08 01:24:05 +03:00
|
|
|
--full-source-path::
|
|
|
|
Show the full path for source files for srcline output.
|
2015-04-30 17:37:24 +03:00
|
|
|
|
2015-08-11 13:30:49 +03:00
|
|
|
--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.
|
|
|
|
|
2015-09-04 17:45:44 +03:00
|
|
|
--socket-filter::
|
|
|
|
Only report the samples on the processor socket that match with this filter
|
|
|
|
|
2015-12-22 20:07:05 +03:00
|
|
|
--raw-trace::
|
|
|
|
When displaying traceevent output, do not use print fmt or plugins.
|
|
|
|
|
2016-02-24 18:13:48 +03:00
|
|
|
--hierarchy::
|
|
|
|
Enable hierarchical output.
|
|
|
|
|
2017-03-25 23:34:27 +03:00
|
|
|
--inline::
|
|
|
|
If a callgraph address belongs to an inlined function, the inline stack
|
2017-10-19 14:38:36 +03:00
|
|
|
will be printed. Each entry is function name or file/line. Enabled by
|
|
|
|
default, disable with --no-inline.
|
2017-03-25 23:34:27 +03:00
|
|
|
|
2018-01-07 19:03:55 +03:00
|
|
|
--stats::
|
|
|
|
Display overall events statistics without any further processing.
|
|
|
|
(like the one at the end of the perf report -D command)
|
|
|
|
|
2015-04-30 17:37:24 +03:00
|
|
|
include::callchain-overhead-calculation.txt[]
|
|
|
|
|
2009-05-26 11:17:18 +04:00
|
|
|
SEE ALSO
|
|
|
|
--------
|
2011-10-06 19:48:31 +04:00
|
|
|
linkperf:perf-stat[1], linkperf:perf-annotate[1]
|