2009-04-20 21:52:29 +08:00
|
|
|
perf-top(1)
|
2008-04-16 04:39:31 +08:00
|
|
|
===========
|
2009-04-20 21:52:29 +08:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2009-08-04 16:24:41 +08:00
|
|
|
perf-top - System profiling tool.
|
2009-04-20 21:52:29 +08:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
[verse]
|
2009-08-04 16:24:41 +08:00
|
|
|
'perf top' [-e <EVENT> | --event=EVENT] [<options>]
|
2009-04-20 21:52:29 +08:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2010-12-01 09:57:21 +08:00
|
|
|
This command generates and displays a performance counter profile in real time.
|
2009-04-20 21:52:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
2009-08-04 16:24:41 +08:00
|
|
|
-a::
|
|
|
|
--all-cpus::
|
|
|
|
System-wide collection. (default)
|
|
|
|
|
|
|
|
-c <count>::
|
|
|
|
--count=<count>::
|
|
|
|
Event period to sample.
|
|
|
|
|
2010-05-28 18:00:01 +08:00
|
|
|
-C <cpu-list>::
|
|
|
|
--cpu=<cpu>::
|
2010-12-01 09:57:21 +08:00
|
|
|
Monitor only on 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.
|
2010-05-28 18:00:01 +08:00
|
|
|
Default is to monitor all CPUS.
|
2009-08-04 16:24:41 +08:00
|
|
|
|
|
|
|
-d <seconds>::
|
|
|
|
--delay=<seconds>::
|
|
|
|
Number of seconds to delay between refreshes.
|
2009-04-20 21:52:29 +08:00
|
|
|
|
2009-08-04 16:24:41 +08:00
|
|
|
-e <event>::
|
|
|
|
--event=<event>::
|
2009-06-06 20:56:33 +08:00
|
|
|
Select the PMU event. Selection can be a symbolic event name
|
2021-11-23 16:46:12 +08:00
|
|
|
(use 'perf list' to list all events) or a raw PMU event in the form
|
|
|
|
of rN where N is a hexadecimal value that represents the raw register
|
|
|
|
encoding with the layout of the event control registers as described
|
2022-06-03 12:57:44 +08:00
|
|
|
by entries in /sys/bus/event_source/devices/cpu/format/*.
|
2009-04-20 21:52:29 +08:00
|
|
|
|
2009-08-04 16:24:41 +08:00
|
|
|
-E <entries>::
|
|
|
|
--entries=<entries>::
|
|
|
|
Display this many functions.
|
|
|
|
|
|
|
|
-f <count>::
|
|
|
|
--count-filter=<count>::
|
|
|
|
Only display functions with more events than this.
|
|
|
|
|
2010-12-01 09:57:21 +08:00
|
|
|
--group::
|
|
|
|
Put the counters into a counter group.
|
|
|
|
|
2020-03-25 06:07:10 +08:00
|
|
|
--group-sort-idx::
|
|
|
|
Sort the output by the event at the index n in group. If n is invalid,
|
|
|
|
sort by the first event. It can support multiple groups with different
|
|
|
|
amount of events. WARNING: This should be used on grouped events.
|
|
|
|
|
2009-08-04 16:24:41 +08:00
|
|
|
-F <freq>::
|
|
|
|
--freq=<freq>::
|
2018-03-02 01:25:56 +08:00
|
|
|
Profile at this frequency. Use 'max' to use the currently maximum
|
|
|
|
allowed frequency, i.e. the value in the kernel.perf_event_max_sample_rate
|
|
|
|
sysctl.
|
2009-08-04 16:24:41 +08:00
|
|
|
|
|
|
|
-i::
|
|
|
|
--inherit::
|
2012-12-12 03:48:41 +08:00
|
|
|
Child tasks do not inherit counters.
|
2009-08-04 16:24:41 +08:00
|
|
|
|
|
|
|
-k <path>::
|
|
|
|
--vmlinux=<path>::
|
|
|
|
Path to vmlinux. Required for annotation functionality.
|
|
|
|
|
2018-03-17 03:24:34 +08:00
|
|
|
--ignore-vmlinux::
|
|
|
|
Ignore vmlinux files.
|
|
|
|
|
2018-11-27 21:31:03 +08:00
|
|
|
--kallsyms=<file>::
|
|
|
|
kallsyms pathname
|
|
|
|
|
2009-08-04 16:24:41 +08:00
|
|
|
-m <pages>::
|
|
|
|
--mmap-pages=<pages>::
|
2013-09-01 18:36:13 +08:00
|
|
|
Number of mmap data pages (must be a power of two) or size
|
|
|
|
specification with appended unit character - B/K/M/G. The
|
|
|
|
size is rounded up to have nearest pages power of two value.
|
2009-08-04 16:24:41 +08:00
|
|
|
|
|
|
|
-p <pid>::
|
|
|
|
--pid=<pid>::
|
2012-02-09 00:32:52 +08:00
|
|
|
Profile events on existing Process ID (comma separated list).
|
2010-12-01 09:57:21 +08:00
|
|
|
|
|
|
|
-t <tid>::
|
|
|
|
--tid=<tid>::
|
2012-02-09 00:32:52 +08:00
|
|
|
Profile events on existing thread ID (comma separated list).
|
2009-08-04 16:24:41 +08:00
|
|
|
|
2012-01-20 00:08:15 +08:00
|
|
|
-u::
|
|
|
|
--uid=::
|
|
|
|
Record events in threads owned by uid. Name or number.
|
|
|
|
|
2009-08-04 16:24:41 +08:00
|
|
|
-r <priority>::
|
|
|
|
--realtime=<priority>::
|
|
|
|
Collect data with this RT SCHED_FIFO priority.
|
|
|
|
|
|
|
|
--sym-annotate=<symbol>::
|
2010-02-04 02:52:08 +08:00
|
|
|
Annotate this symbol.
|
2009-08-04 16:24:41 +08:00
|
|
|
|
2010-12-01 09:57:21 +08:00
|
|
|
-K::
|
|
|
|
--hide_kernel_symbols::
|
|
|
|
Hide kernel symbols.
|
|
|
|
|
|
|
|
-U::
|
|
|
|
--hide_user_symbols::
|
|
|
|
Hide user symbols.
|
|
|
|
|
2014-09-13 12:15:05 +08:00
|
|
|
--demangle-kernel::
|
|
|
|
Demangle kernel symbols.
|
|
|
|
|
2010-12-01 09:57:21 +08:00
|
|
|
-D::
|
|
|
|
--dump-symtab::
|
|
|
|
Dump the symbol table used for profiling.
|
|
|
|
|
2009-08-04 16:24:41 +08:00
|
|
|
-v::
|
|
|
|
--verbose::
|
|
|
|
Be more verbose (show counter open errors, etc).
|
|
|
|
|
|
|
|
-z::
|
|
|
|
--zero::
|
|
|
|
Zero history across display updates.
|
|
|
|
|
perf top: Reuse the 'report' hist_entry/hists classes
This actually fixes several problems we had in the old 'perf top':
1. Unresolved symbols not show, limitation that came from the old
"KernelTop" codebase, to solve it we would need to do changes
that would make sym_entry have most of the hist_entry fields.
2. It was using the number of samples, not the sum of sample->period.
And brings the --sort code that allows us to have all the views in
'perf report', for instance:
[root@emilia ~]# perf top --sort dso
PerfTop: 5903 irqs/sec kernel:77.5% exact: 0.0% [1000Hz cycles], (all, 8 CPUs)
------------------------------------------------------------------------------
31.59% libcrypto.so.1.0.0
21.55% [kernel]
18.57% libpython2.6.so.1.0
7.04% libc-2.12.so
6.99% _backend_agg.so
4.72% sshd
1.48% multiarray.so
1.39% libfreetype.so.6.3.22
1.37% perf
0.71% libgobject-2.0.so.0.2200.5
0.53% [tg3]
0.48% libglib-2.0.so.0.2200.5
0.44% libstdc++.so.6.0.13
0.40% libcairo.so.2.10800.8
0.38% libm-2.12.so
0.34% umath.so
0.30% libgdk-x11-2.0.so.0.1800.9
0.22% libpthread-2.12.so
0.20% libgtk-x11-2.0.so.0.1800.9
0.20% librt-2.12.so
0.15% _path.so
0.13% libpango-1.0.so.0.2800.1
0.11% libatlas.so.3.0
0.09% ft2font.so
0.09% libpangoft2-1.0.so.0.2800.1
0.08% libX11.so.6.3.0
0.07% [vdso]
0.06% cyclictest
^C
All the filter lists can be used as well: --dsos, --comms, --symbols,
etc.
The 'perf report' TUI is also reused, being possible to apply all the
zoom operations, do annotation, etc.
This change will allow multiple simplifications in the symbol system as
well, that will be detailed in upcoming changesets.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-xzaaldxq7zhqrrxdxjifk1mh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-10-06 06:16:15 +08:00
|
|
|
-s::
|
|
|
|
--sort::
|
2013-09-20 22:40:41 +08:00
|
|
|
Sort by key(s): pid, comm, dso, symbol, parent, srcline, weight,
|
2014-03-04 08:06:42 +08:00
|
|
|
local_weight, abort, in_tx, transaction, overhead, sample, period.
|
|
|
|
Please see description of --sort in the perf-report man page.
|
perf top: Reuse the 'report' hist_entry/hists classes
This actually fixes several problems we had in the old 'perf top':
1. Unresolved symbols not show, limitation that came from the old
"KernelTop" codebase, to solve it we would need to do changes
that would make sym_entry have most of the hist_entry fields.
2. It was using the number of samples, not the sum of sample->period.
And brings the --sort code that allows us to have all the views in
'perf report', for instance:
[root@emilia ~]# perf top --sort dso
PerfTop: 5903 irqs/sec kernel:77.5% exact: 0.0% [1000Hz cycles], (all, 8 CPUs)
------------------------------------------------------------------------------
31.59% libcrypto.so.1.0.0
21.55% [kernel]
18.57% libpython2.6.so.1.0
7.04% libc-2.12.so
6.99% _backend_agg.so
4.72% sshd
1.48% multiarray.so
1.39% libfreetype.so.6.3.22
1.37% perf
0.71% libgobject-2.0.so.0.2200.5
0.53% [tg3]
0.48% libglib-2.0.so.0.2200.5
0.44% libstdc++.so.6.0.13
0.40% libcairo.so.2.10800.8
0.38% libm-2.12.so
0.34% umath.so
0.30% libgdk-x11-2.0.so.0.1800.9
0.22% libpthread-2.12.so
0.20% libgtk-x11-2.0.so.0.1800.9
0.20% librt-2.12.so
0.15% _path.so
0.13% libpango-1.0.so.0.2800.1
0.11% libatlas.so.3.0
0.09% ft2font.so
0.09% libpangoft2-1.0.so.0.2800.1
0.08% libX11.so.6.3.0
0.07% [vdso]
0.06% cyclictest
^C
All the filter lists can be used as well: --dsos, --comms, --symbols,
etc.
The 'perf report' TUI is also reused, being possible to apply all the
zoom operations, do annotation, etc.
This change will allow multiple simplifications in the symbol system as
well, that will be detailed in upcoming changesets.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-xzaaldxq7zhqrrxdxjifk1mh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-10-06 06:16:15 +08:00
|
|
|
|
2014-03-04 10:01:41 +08:00
|
|
|
--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 10:01:41 +08:00
|
|
|
Also it can contain any sort key(s).
|
|
|
|
|
|
|
|
By default, every sort keys not specified in --field will be appended
|
|
|
|
automatically.
|
|
|
|
|
perf top: Reuse the 'report' hist_entry/hists classes
This actually fixes several problems we had in the old 'perf top':
1. Unresolved symbols not show, limitation that came from the old
"KernelTop" codebase, to solve it we would need to do changes
that would make sym_entry have most of the hist_entry fields.
2. It was using the number of samples, not the sum of sample->period.
And brings the --sort code that allows us to have all the views in
'perf report', for instance:
[root@emilia ~]# perf top --sort dso
PerfTop: 5903 irqs/sec kernel:77.5% exact: 0.0% [1000Hz cycles], (all, 8 CPUs)
------------------------------------------------------------------------------
31.59% libcrypto.so.1.0.0
21.55% [kernel]
18.57% libpython2.6.so.1.0
7.04% libc-2.12.so
6.99% _backend_agg.so
4.72% sshd
1.48% multiarray.so
1.39% libfreetype.so.6.3.22
1.37% perf
0.71% libgobject-2.0.so.0.2200.5
0.53% [tg3]
0.48% libglib-2.0.so.0.2200.5
0.44% libstdc++.so.6.0.13
0.40% libcairo.so.2.10800.8
0.38% libm-2.12.so
0.34% umath.so
0.30% libgdk-x11-2.0.so.0.1800.9
0.22% libpthread-2.12.so
0.20% libgtk-x11-2.0.so.0.1800.9
0.20% librt-2.12.so
0.15% _path.so
0.13% libpango-1.0.so.0.2800.1
0.11% libatlas.so.3.0
0.09% ft2font.so
0.09% libpangoft2-1.0.so.0.2800.1
0.08% libX11.so.6.3.0
0.07% [vdso]
0.06% cyclictest
^C
All the filter lists can be used as well: --dsos, --comms, --symbols,
etc.
The 'perf report' TUI is also reused, being possible to apply all the
zoom operations, do annotation, etc.
This change will allow multiple simplifications in the symbol system as
well, that will be detailed in upcoming changesets.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-xzaaldxq7zhqrrxdxjifk1mh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-10-06 06:16:15 +08:00
|
|
|
-n::
|
|
|
|
--show-nr-samples::
|
|
|
|
Show a column with the number of samples.
|
|
|
|
|
|
|
|
--show-total-period::
|
|
|
|
Show a column with the sum of periods.
|
|
|
|
|
|
|
|
--dsos::
|
2014-02-07 11:06:07 +08:00
|
|
|
Only consider symbols in these dsos. This option will affect the
|
|
|
|
percentage of the overhead column. See --percentage for more info.
|
perf top: Reuse the 'report' hist_entry/hists classes
This actually fixes several problems we had in the old 'perf top':
1. Unresolved symbols not show, limitation that came from the old
"KernelTop" codebase, to solve it we would need to do changes
that would make sym_entry have most of the hist_entry fields.
2. It was using the number of samples, not the sum of sample->period.
And brings the --sort code that allows us to have all the views in
'perf report', for instance:
[root@emilia ~]# perf top --sort dso
PerfTop: 5903 irqs/sec kernel:77.5% exact: 0.0% [1000Hz cycles], (all, 8 CPUs)
------------------------------------------------------------------------------
31.59% libcrypto.so.1.0.0
21.55% [kernel]
18.57% libpython2.6.so.1.0
7.04% libc-2.12.so
6.99% _backend_agg.so
4.72% sshd
1.48% multiarray.so
1.39% libfreetype.so.6.3.22
1.37% perf
0.71% libgobject-2.0.so.0.2200.5
0.53% [tg3]
0.48% libglib-2.0.so.0.2200.5
0.44% libstdc++.so.6.0.13
0.40% libcairo.so.2.10800.8
0.38% libm-2.12.so
0.34% umath.so
0.30% libgdk-x11-2.0.so.0.1800.9
0.22% libpthread-2.12.so
0.20% libgtk-x11-2.0.so.0.1800.9
0.20% librt-2.12.so
0.15% _path.so
0.13% libpango-1.0.so.0.2800.1
0.11% libatlas.so.3.0
0.09% ft2font.so
0.09% libpangoft2-1.0.so.0.2800.1
0.08% libX11.so.6.3.0
0.07% [vdso]
0.06% cyclictest
^C
All the filter lists can be used as well: --dsos, --comms, --symbols,
etc.
The 'perf report' TUI is also reused, being possible to apply all the
zoom operations, do annotation, etc.
This change will allow multiple simplifications in the symbol system as
well, that will be detailed in upcoming changesets.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-xzaaldxq7zhqrrxdxjifk1mh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-10-06 06:16:15 +08:00
|
|
|
|
|
|
|
--comms::
|
2014-02-07 11:06:07 +08:00
|
|
|
Only consider symbols in these comms. This option will affect the
|
|
|
|
percentage of the overhead column. See --percentage for more info.
|
perf top: Reuse the 'report' hist_entry/hists classes
This actually fixes several problems we had in the old 'perf top':
1. Unresolved symbols not show, limitation that came from the old
"KernelTop" codebase, to solve it we would need to do changes
that would make sym_entry have most of the hist_entry fields.
2. It was using the number of samples, not the sum of sample->period.
And brings the --sort code that allows us to have all the views in
'perf report', for instance:
[root@emilia ~]# perf top --sort dso
PerfTop: 5903 irqs/sec kernel:77.5% exact: 0.0% [1000Hz cycles], (all, 8 CPUs)
------------------------------------------------------------------------------
31.59% libcrypto.so.1.0.0
21.55% [kernel]
18.57% libpython2.6.so.1.0
7.04% libc-2.12.so
6.99% _backend_agg.so
4.72% sshd
1.48% multiarray.so
1.39% libfreetype.so.6.3.22
1.37% perf
0.71% libgobject-2.0.so.0.2200.5
0.53% [tg3]
0.48% libglib-2.0.so.0.2200.5
0.44% libstdc++.so.6.0.13
0.40% libcairo.so.2.10800.8
0.38% libm-2.12.so
0.34% umath.so
0.30% libgdk-x11-2.0.so.0.1800.9
0.22% libpthread-2.12.so
0.20% libgtk-x11-2.0.so.0.1800.9
0.20% librt-2.12.so
0.15% _path.so
0.13% libpango-1.0.so.0.2800.1
0.11% libatlas.so.3.0
0.09% ft2font.so
0.09% libpangoft2-1.0.so.0.2800.1
0.08% libX11.so.6.3.0
0.07% [vdso]
0.06% cyclictest
^C
All the filter lists can be used as well: --dsos, --comms, --symbols,
etc.
The 'perf report' TUI is also reused, being possible to apply all the
zoom operations, do annotation, etc.
This change will allow multiple simplifications in the symbol system as
well, that will be detailed in upcoming changesets.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-xzaaldxq7zhqrrxdxjifk1mh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-10-06 06:16:15 +08:00
|
|
|
|
|
|
|
--symbols::
|
2014-02-07 11:06:07 +08:00
|
|
|
Only consider these symbols. This option will affect the
|
|
|
|
percentage of the overhead column. See --percentage for more info.
|
perf top: Reuse the 'report' hist_entry/hists classes
This actually fixes several problems we had in the old 'perf top':
1. Unresolved symbols not show, limitation that came from the old
"KernelTop" codebase, to solve it we would need to do changes
that would make sym_entry have most of the hist_entry fields.
2. It was using the number of samples, not the sum of sample->period.
And brings the --sort code that allows us to have all the views in
'perf report', for instance:
[root@emilia ~]# perf top --sort dso
PerfTop: 5903 irqs/sec kernel:77.5% exact: 0.0% [1000Hz cycles], (all, 8 CPUs)
------------------------------------------------------------------------------
31.59% libcrypto.so.1.0.0
21.55% [kernel]
18.57% libpython2.6.so.1.0
7.04% libc-2.12.so
6.99% _backend_agg.so
4.72% sshd
1.48% multiarray.so
1.39% libfreetype.so.6.3.22
1.37% perf
0.71% libgobject-2.0.so.0.2200.5
0.53% [tg3]
0.48% libglib-2.0.so.0.2200.5
0.44% libstdc++.so.6.0.13
0.40% libcairo.so.2.10800.8
0.38% libm-2.12.so
0.34% umath.so
0.30% libgdk-x11-2.0.so.0.1800.9
0.22% libpthread-2.12.so
0.20% libgtk-x11-2.0.so.0.1800.9
0.20% librt-2.12.so
0.15% _path.so
0.13% libpango-1.0.so.0.2800.1
0.11% libatlas.so.3.0
0.09% ft2font.so
0.09% libpangoft2-1.0.so.0.2800.1
0.08% libX11.so.6.3.0
0.07% [vdso]
0.06% cyclictest
^C
All the filter lists can be used as well: --dsos, --comms, --symbols,
etc.
The 'perf report' TUI is also reused, being possible to apply all the
zoom operations, do annotation, etc.
This change will allow multiple simplifications in the symbol system as
well, that will be detailed in upcoming changesets.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-xzaaldxq7zhqrrxdxjifk1mh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-10-06 06:16:15 +08:00
|
|
|
|
2011-10-06 23:48:31 +08:00
|
|
|
-M::
|
|
|
|
--disassembler-style=:: Set disassembler style for objdump.
|
|
|
|
|
2020-01-08 05:04:44 +08:00
|
|
|
--prefix=PREFIX::
|
|
|
|
--prefix-strip=N::
|
|
|
|
Remove first N entries from source file path names in executables
|
|
|
|
and add PREFIX. This allows to display source code compiled on systems
|
|
|
|
with different file system layout.
|
|
|
|
|
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.
|
|
|
|
|
2013-11-15 11:51:30 +08:00
|
|
|
-g::
|
2013-10-26 22:25:34 +08:00
|
|
|
Enables call-graph (stack chain/backtrace) recording.
|
|
|
|
|
perf top: Support call-graph display options also
Currently 'perf top --call-graph' option is same as 'perf record'. But
'perf top' also need to receive display options in 'perf report'. To do
that, change parse_callchain_report_opt() to allow record options too.
Now perf top can receive display options like below:
$ perf top --call-graph
Error: option `call-graph' requires a value
Usage: perf top [<options>]
--call-graph
<mode[,dump_size],output_type,min_percent[,print_limit],call_order[,branch]>
setup and enables call-graph (stack chain/backtrace)
recording: fp dwarf lbr, output_type (graph, flat,
fractal, or none), min percent threshold, optional
print limit, callchain order, key (function or
address), add branches
$ perf top --call-graph callee,graph,fp
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
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: Frederic Weisbecker <fweisbec@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/1445495330-25416-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-10-22 14:28:49 +08:00
|
|
|
--call-graph [mode,type,min[,limit],order[,key][,branch]]::
|
2013-10-26 22:25:34 +08:00
|
|
|
Setup and enable call-graph (stack chain/backtrace) recording,
|
perf top: Support call-graph display options also
Currently 'perf top --call-graph' option is same as 'perf record'. But
'perf top' also need to receive display options in 'perf report'. To do
that, change parse_callchain_report_opt() to allow record options too.
Now perf top can receive display options like below:
$ perf top --call-graph
Error: option `call-graph' requires a value
Usage: perf top [<options>]
--call-graph
<mode[,dump_size],output_type,min_percent[,print_limit],call_order[,branch]>
setup and enables call-graph (stack chain/backtrace)
recording: fp dwarf lbr, output_type (graph, flat,
fractal, or none), min percent threshold, optional
print limit, callchain order, key (function or
address), add branches
$ perf top --call-graph callee,graph,fp
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
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: Frederic Weisbecker <fweisbec@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/1445495330-25416-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-10-22 14:28:49 +08:00
|
|
|
implies -g. See `--call-graph` section in perf-record and
|
|
|
|
perf-report man pages for details.
|
2011-10-06 06:30:22 +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 -g/--call-graph option
|
2015-04-22 14:33:45 +08:00
|
|
|
enabled. See the `overhead calculation' section for more details.
|
2016-12-03 00:07:32 +08:00
|
|
|
Enabled by default, disable with --no-children.
|
2013-10-30 16:05:55 +08:00
|
|
|
|
2013-10-18 22:38:49 +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.
|
|
|
|
|
2016-04-27 21:16:24 +08:00
|
|
|
Default: /proc/sys/kernel/perf_event_max_stack when present, 127 otherwise.
|
2013-10-18 22:38:49 +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.
|
|
|
|
|
2013-05-14 10:09:05 +08:00
|
|
|
--percent-limit::
|
|
|
|
Do not show entries which have an overhead under that percent.
|
|
|
|
(Default: 0).
|
|
|
|
|
2014-02-07 11:06:07 +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.
|
|
|
|
|
2014-07-31 13:47:39 +08:00
|
|
|
-w::
|
|
|
|
--column-widths=<width[,width...]>::
|
|
|
|
Force each column width to the provided list, for large terminal
|
|
|
|
readability. 0 means no limit (default behavior).
|
|
|
|
|
2015-06-17 21:51:11 +08:00
|
|
|
--proc-map-timeout::
|
|
|
|
When processing pre-existing threads /proc/XXX/mmap, it may take
|
|
|
|
a long time, because the file may be huge. A time out is needed
|
|
|
|
in such cases.
|
|
|
|
This option sets the time out limit. The default value is 500 ms.
|
|
|
|
|
2014-07-31 13:47:39 +08:00
|
|
|
|
2015-07-18 23:24:52 +08:00
|
|
|
-b::
|
|
|
|
--branch-any::
|
|
|
|
Enable taken branch stack sampling. Any type of taken branch may be sampled.
|
|
|
|
This is a shortcut for --branch-filter any. See --branch-filter for more infos.
|
|
|
|
|
|
|
|
-j::
|
|
|
|
--branch-filter::
|
|
|
|
Enable taken branch stack sampling. Each sample captures a series of consecutive
|
|
|
|
taken branches. The number of branches captured with each sample depends on the
|
|
|
|
underlying hardware, the type of branches of interest, and the executed code.
|
|
|
|
It is possible to select the types of branches captured by enabling filters.
|
|
|
|
For a full list of modifiers please see the perf record manpage.
|
|
|
|
|
|
|
|
The option requires at least one branch type among any, any_call, any_ret, ind_call, cond.
|
|
|
|
The privilege levels may be omitted, in which case, the privilege levels of the associated
|
|
|
|
event are applied to the branch filter. Both kernel (k) and hypervisor (hv) privilege
|
|
|
|
levels are subject to permissions. When sampling on multiple events, branch stack sampling
|
|
|
|
is enabled for all the sampling events. The sampled branch type is the same for all events.
|
|
|
|
The various filters must be specified as a comma separated list: --branch-filter any_ret,u,k
|
|
|
|
Note that this feature may not be available on all processors.
|
|
|
|
|
2015-12-23 01:07:05 +08:00
|
|
|
--raw-trace::
|
|
|
|
When displaying traceevent output, do not use print fmt or plugins.
|
|
|
|
|
2016-02-24 23:13:50 +08:00
|
|
|
--hierarchy::
|
|
|
|
Enable hierarchy output.
|
|
|
|
|
2018-10-27 02:55:23 +08:00
|
|
|
--overwrite::
|
2018-10-29 20:47:00 +08:00
|
|
|
Enable this to use just the most recent records, which helps in high core count
|
|
|
|
machines such as Knights Landing/Mill, but right now is disabled by default as
|
|
|
|
the pausing used in this technique is leading to loss of metadata events such
|
|
|
|
as PERF_RECORD_MMAP which makes 'perf top' unable to resolve samples, leading
|
|
|
|
to lots of unknown samples appearing on the UI. Enable this if you are in such
|
|
|
|
machines and profiling a workload that doesn't creates short lived threads and/or
|
|
|
|
doesn't uses many executable mmap operations. Work is being planed to solve
|
|
|
|
this situation, till then, this will remain disabled by default.
|
2018-10-27 02:55:23 +08:00
|
|
|
|
2017-07-06 09:48:12 +08:00
|
|
|
--force::
|
|
|
|
Don't do ownership validation.
|
|
|
|
|
perf top: Add option to set the number of thread for event synthesize
Using UINT_MAX to indicate the default thread#, which is the max number
of online CPU.
Committer testing:
# perf trace --no-inherit -e clone -o /tmp/output perf top --num-thread-synthesize 9
# cat /tmp/output
? ( ? ): ... [continued]: clone()) = 26651 (perf)
0.059 ( 0.010 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5bfac44f30, parent_tidptr: 0x7f5bfac459d0, child_tidptr: 0x7f5bfac459d0, tls: 0x7f5bfac45700) = 26652 (perf)
0.116 ( 0.014 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5bfa443f30, parent_tidptr: 0x7f5bfa4449d0, child_tidptr: 0x7f5bfa4449d0, tls: 0x7f5bfa444700) = 26653 (perf)
0.141 ( 0.009 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5bf9c42f30, parent_tidptr: 0x7f5bf9c439d0, child_tidptr: 0x7f5bf9c439d0, tls: 0x7f5bf9c43700) = 26654 (perf)
0.160 ( 0.012 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5bf9441f30, parent_tidptr: 0x7f5bf94429d0, child_tidptr: 0x7f5bf94429d0, tls: 0x7f5bf9442700) = 26655 (perf)
0.232 ( 0.013 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5bf8c40f30, parent_tidptr: 0x7f5bf8c419d0, child_tidptr: 0x7f5bf8c419d0, tls: 0x7f5bf8c41700) = 26656 (perf)
0.393 ( 0.011 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5be3ffef30, parent_tidptr: 0x7f5be3fff9d0, child_tidptr: 0x7f5be3fff9d0, tls: 0x7f5be3fff700) = 26657 (perf)
0.802 ( 0.012 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5be37fdf30, parent_tidptr: 0x7f5be37fe9d0, child_tidptr: 0x7f5be37fe9d0, tls: 0x7f5be37fe700) = 26658 (perf)
1.411 ( 0.022 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5be2ffcf30, parent_tidptr: 0x7f5be2ffd9d0, child_tidptr: 0x7f5be2ffd9d0, tls: 0x7f5be2ffd700) = 26659 (perf)
246.422 ( 0.042 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5be2ffcf30, parent_tidptr: 0x7f5be2ffd9d0, child_tidptr: 0x7f5be2ffd9d0, tls: 0x7f5be2ffd700) = 26660 (perf)
#
Signed-off-by: Kan Liang <kan.liang@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Lukasz Odzioba <lukasz.odzioba@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1506696477-146932-5-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-09-29 22:47:55 +08:00
|
|
|
--num-thread-synthesize::
|
|
|
|
The number of threads to run when synthesizing events for existing processes.
|
|
|
|
By default, the number of threads equals to the number of online CPUs.
|
2017-07-06 09:48:12 +08:00
|
|
|
|
2019-05-22 13:32:50 +08:00
|
|
|
--namespaces::
|
|
|
|
Record events of type PERF_RECORD_NAMESPACES and display it with the
|
|
|
|
'cgroup_id' sort key.
|
|
|
|
|
2021-06-17 07:18:29 +08:00
|
|
|
-G name::
|
|
|
|
--cgroup name::
|
|
|
|
monitor only in the container (cgroup) called "name". This option is available only
|
|
|
|
in per-cpu mode. The cgroup filesystem must be mounted. All threads belonging to
|
|
|
|
container "name" are monitored when they run on the monitored CPUs. Multiple cgroups
|
|
|
|
can be provided. Each cgroup is applied to the corresponding event, i.e., first cgroup
|
|
|
|
to first event, second cgroup to second event and so on. It is possible to provide
|
|
|
|
an empty cgroup (monitor all the time) using, e.g., -G foo,,bar. Cgroups must have
|
|
|
|
corresponding events, i.e., they always refer to events defined earlier on the command
|
|
|
|
line. If the user wants to track multiple events for a specific cgroup, the user can
|
|
|
|
use '-e e1 -e e2 -G foo,foo' or just use '-e e1 -e e2 -G foo'.
|
|
|
|
|
2020-03-25 20:45:35 +08:00
|
|
|
--all-cgroups::
|
|
|
|
Record events of type PERF_RECORD_CGROUP and display it with the
|
|
|
|
'cgroup' sort key.
|
|
|
|
|
perf top: Add --switch-on/--switch-off events
Just like 'perf trace' and 'perf script', should be useful for instance
to only consider samples after the initialization phase of some
workload.
The man page has some examples and considerations about its current
interface, that still doesn't handle the on/off events in a special way,
behaving just like when multiple events are specified, i.e.:
- In non-group mode (when the event list is not enclosed in {}) show a
a menu to allow choosing which event the user wants to see in the
histograms browser
- In group mode, be it using {} or asking for --group, show one column
per event.
Try for instance:
# perf top -e '{cycles,instructions,probe:icmp_rcv}' --switch-on=probe:icmp_rcv
Replace probe:icmp_rcv, that I put in place using:
# perf probe icmp_rcv:59
To hit when broadcast packets arrive, with a probe installed after an
initialization phase is over or after some other point of interest, some
garbage collection, etc, and also use --switch-off, for instance, on a
probe installed after said garbage collection is over.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: William Cohen <wcohen@redhat.com>
Link: https://lkml.kernel.org/n/tip-c7q7qjeqtyvc9mkeipxza6ne@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-08-16 03:03:26 +08:00
|
|
|
--switch-on EVENT_NAME::
|
|
|
|
Only consider events after this event is found.
|
|
|
|
|
|
|
|
E.g.:
|
|
|
|
|
|
|
|
Find out where broadcast packets are handled
|
|
|
|
|
|
|
|
perf probe -L icmp_rcv
|
|
|
|
|
|
|
|
Insert a probe there:
|
|
|
|
|
|
|
|
perf probe icmp_rcv:59
|
|
|
|
|
|
|
|
Start perf top and ask it to only consider the cycles events when a
|
|
|
|
broadcast packet arrives This will show a menu with two entries and
|
|
|
|
will start counting when a broadcast packet arrives:
|
|
|
|
|
|
|
|
perf top -e cycles,probe:icmp_rcv --switch-on=probe:icmp_rcv
|
|
|
|
|
|
|
|
Alternatively one can ask for --group and then two overhead columns
|
|
|
|
will appear, the first for cycles and the second for the switch-on event.
|
|
|
|
|
|
|
|
perf top --group -e cycles,probe:icmp_rcv --switch-on=probe:icmp_rcv
|
|
|
|
|
|
|
|
This may be interesting to measure a workload only after some initialization
|
|
|
|
phase is over, i.e. insert a perf probe at that point and use the above
|
|
|
|
examples replacing probe:icmp_rcv with the just-after-init probe.
|
|
|
|
|
|
|
|
--switch-off EVENT_NAME::
|
|
|
|
Stop considering events after this event is found.
|
|
|
|
|
|
|
|
--show-on-off-events::
|
|
|
|
Show the --switch-on/off events too. This has no effect in 'perf top' now
|
|
|
|
but probably we'll make the default not to show the switch-on/off events
|
|
|
|
on the --group mode and if there is only one event besides the off/on ones,
|
|
|
|
go straight to the histogram browser, just like 'perf top' with no events
|
2021-03-24 00:09:15 +08:00
|
|
|
explicitly specified does.
|
perf top: Add --switch-on/--switch-off events
Just like 'perf trace' and 'perf script', should be useful for instance
to only consider samples after the initialization phase of some
workload.
The man page has some examples and considerations about its current
interface, that still doesn't handle the on/off events in a special way,
behaving just like when multiple events are specified, i.e.:
- In non-group mode (when the event list is not enclosed in {}) show a
a menu to allow choosing which event the user wants to see in the
histograms browser
- In group mode, be it using {} or asking for --group, show one column
per event.
Try for instance:
# perf top -e '{cycles,instructions,probe:icmp_rcv}' --switch-on=probe:icmp_rcv
Replace probe:icmp_rcv, that I put in place using:
# perf probe icmp_rcv:59
To hit when broadcast packets arrive, with a probe installed after an
initialization phase is over or after some other point of interest, some
garbage collection, etc, and also use --switch-off, for instance, on a
probe installed after said garbage collection is over.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: William Cohen <wcohen@redhat.com>
Link: https://lkml.kernel.org/n/tip-c7q7qjeqtyvc9mkeipxza6ne@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-08-16 03:03:26 +08:00
|
|
|
|
2020-03-20 04:25:15 +08:00
|
|
|
--stitch-lbr::
|
|
|
|
Show callgraph with stitched LBRs, which may have more complete
|
|
|
|
callgraph. The option must be used with --call-graph lbr recording.
|
|
|
|
Disabled by default. In common cases with call stack overflows,
|
|
|
|
it can recreate better call stacks than the default lbr call stack
|
|
|
|
output. But this approach is not full proof. There can be cases
|
|
|
|
where it creates incorrect call stacks from incorrect matches.
|
|
|
|
The known limitations include exception handing such as
|
|
|
|
setjmp/longjmp will have calls/returns not match.
|
2019-05-22 13:32:50 +08:00
|
|
|
|
2020-05-06 02:29:43 +08:00
|
|
|
ifdef::HAVE_LIBPFM[]
|
|
|
|
--pfm-events events::
|
|
|
|
Select a PMU event using libpfm4 syntax (see http://perfmon2.sf.net)
|
|
|
|
including support for event filters. For example '--pfm-events
|
|
|
|
inst_retired:any_p:u:c=1:i'. More than one event can be passed to the
|
|
|
|
option using the comma separator. Hardware events and generic hardware
|
|
|
|
events cannot be mixed together. The latter must be used with the -e
|
|
|
|
option. The -e option and this one can be mixed and matched. Events
|
|
|
|
can be grouped using the {} notation.
|
|
|
|
endif::HAVE_LIBPFM[]
|
|
|
|
|
2009-08-04 16:24:41 +08:00
|
|
|
INTERACTIVE PROMPTING KEYS
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
[d]::
|
|
|
|
Display refresh delay.
|
|
|
|
|
|
|
|
[e]::
|
|
|
|
Number of entries to display.
|
|
|
|
|
|
|
|
[E]::
|
|
|
|
Event to display when multiple counters are active.
|
|
|
|
|
|
|
|
[f]::
|
|
|
|
Profile display filter (>= hit count).
|
|
|
|
|
|
|
|
[F]::
|
|
|
|
Annotation display filter (>= % of total).
|
|
|
|
|
|
|
|
[s]::
|
|
|
|
Annotate symbol.
|
|
|
|
|
|
|
|
[S]::
|
|
|
|
Stop annotation, return to full profile display.
|
|
|
|
|
2017-11-12 09:10:46 +08:00
|
|
|
[K]::
|
|
|
|
Hide kernel symbols.
|
|
|
|
|
|
|
|
[U]::
|
|
|
|
Hide user symbols.
|
|
|
|
|
2009-08-04 16:24:41 +08:00
|
|
|
[z]::
|
|
|
|
Toggle event count zeroing across display updates.
|
|
|
|
|
|
|
|
[qQ]::
|
|
|
|
Quit.
|
|
|
|
|
|
|
|
Pressing any unmapped key displays a menu, and prompts for input.
|
2009-04-20 21:52:29 +08:00
|
|
|
|
2015-04-22 14:33:45 +08:00
|
|
|
include::callchain-overhead-calculation.txt[]
|
2009-04-20 21:52:29 +08:00
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
2014-03-04 08:06:42 +08:00
|
|
|
linkperf:perf-stat[1], linkperf:perf-list[1], linkperf:perf-report[1]
|