2009-12-15 06:09:31 +08:00
|
|
|
perf-diff(1)
|
2010-05-05 22:23:27 +08:00
|
|
|
============
|
2009-12-15 06:09:31 +08:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2009-12-15 17:24:08 +08:00
|
|
|
perf-diff - Read two perf.data files and display the differential profile
|
2009-12-15 06:09:31 +08:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
[verse]
|
|
|
|
'perf diff' [oldfile] [newfile]
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2009-12-15 17:24:08 +08:00
|
|
|
This command displays the performance difference amongst two perf.data files
|
2009-12-15 06:09:31 +08:00
|
|
|
captured via perf record.
|
|
|
|
|
|
|
|
If no parameters are passed it will assume perf.data.old and perf.data.
|
|
|
|
|
2012-09-06 23:46:55 +08:00
|
|
|
The differential profile is displayed only for events matching both
|
|
|
|
specified perf.data files.
|
|
|
|
|
2009-12-15 06:09:31 +08:00
|
|
|
OPTIONS
|
|
|
|
-------
|
2010-12-01 09:57:12 +08:00
|
|
|
-M::
|
|
|
|
--displacement::
|
|
|
|
Show position displacement relative to baseline.
|
|
|
|
|
|
|
|
-D::
|
|
|
|
--dump-raw-trace::
|
|
|
|
Dump raw trace in ASCII.
|
|
|
|
|
|
|
|
-m::
|
|
|
|
--modules::
|
|
|
|
Load module symbols. WARNING: use only with -k and LIVE kernel
|
|
|
|
|
perf diff: Use perf_session__fprintf_hists just like 'perf record'
That means that almost everything you can do with 'perf report'
can be done with 'perf diff', for instance:
$ perf record -f find / > /dev/null
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.062 MB perf.data (~2699
samples) ] $ perf record -f find / > /dev/null
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.062 MB perf.data (~2687
samples) ] perf diff | head -8
9.02% +1.00% find libc-2.10.1.so [.] _IO_vfprintf_internal
2.91% -1.00% find [kernel] [k] __kmalloc
2.85% -1.00% find [kernel] [k] ext4_htree_store_dirent
1.99% -1.00% find [kernel] [k] _atomic_dec_and_lock
2.44% find [kernel] [k] half_md4_transform
$
So if you want to zoom into libc:
$ perf diff --dsos libc-2.10.1.so | head -8
37.34% find [.] _IO_vfprintf_internal
10.34% find [.] __GI_memmove
8.25% +2.00% find [.] _int_malloc
5.07% -1.00% find [.] __GI_mempcpy
7.62% +2.00% find [.] _int_free
$
And if there were multiple commands using libc, it is also
possible to aggregate them all by using --sort symbol:
$ perf diff --dsos libc-2.10.1.so --sort symbol | head -8
37.34% [.] _IO_vfprintf_internal
10.34% [.] __GI_memmove
8.25% +2.00% [.] _int_malloc
5.07% -1.00% [.] __GI_mempcpy
7.62% +2.00% [.] _int_free
$
The displacement column now is off by default, to use it:
perf diff -m --dsos libc-2.10.1.so --sort symbol | head -8
37.34% [.] _IO_vfprintf_internal
10.34% [.] __GI_memmove
8.25% +2.00% [.] _int_malloc
5.07% -1.00% +2 [.] __GI_mempcpy
7.62% +2.00% -1 [.] _int_free
$
Using -t/--field-separator can be used for scripting:
$ perf diff -t, -m --dsos libc-2.10.1.so --sort symbol | head -8
37.34, , ,[.] _IO_vfprintf_internal
10.34, , ,[.] __GI_memmove
8.25,+2.00%, ,[.] _int_malloc
5.07,-1.00%, +2,[.] __GI_mempcpy
7.62,+2.00%, -1,[.] _int_free
6.99,+1.00%, -1,[.] _IO_new_file_xsputn
1.89,-2.00%, +4,[.] __readdir64
$
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1260978567-550-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-12-16 23:49:27 +08:00
|
|
|
-d::
|
|
|
|
--dsos=::
|
|
|
|
Only consider symbols in these dsos. CSV that understands
|
|
|
|
file://filename entries.
|
|
|
|
|
|
|
|
-C::
|
|
|
|
--comms=::
|
|
|
|
Only consider symbols in these comms. CSV that understands
|
|
|
|
file://filename entries.
|
|
|
|
|
|
|
|
-S::
|
|
|
|
--symbols=::
|
|
|
|
Only consider these symbols. CSV that understands
|
|
|
|
file://filename entries.
|
|
|
|
|
|
|
|
-s::
|
|
|
|
--sort=::
|
|
|
|
Sort by key(s): pid, comm, dso, symbol.
|
|
|
|
|
|
|
|
-t::
|
|
|
|
--field-separator=::
|
|
|
|
|
|
|
|
Use a special separator character and don't pad with spaces, replacing
|
2010-12-01 09:57:12 +08:00
|
|
|
all occurrences of this separator in symbol names (and other output)
|
perf diff: Use perf_session__fprintf_hists just like 'perf record'
That means that almost everything you can do with 'perf report'
can be done with 'perf diff', for instance:
$ perf record -f find / > /dev/null
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.062 MB perf.data (~2699
samples) ] $ perf record -f find / > /dev/null
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.062 MB perf.data (~2687
samples) ] perf diff | head -8
9.02% +1.00% find libc-2.10.1.so [.] _IO_vfprintf_internal
2.91% -1.00% find [kernel] [k] __kmalloc
2.85% -1.00% find [kernel] [k] ext4_htree_store_dirent
1.99% -1.00% find [kernel] [k] _atomic_dec_and_lock
2.44% find [kernel] [k] half_md4_transform
$
So if you want to zoom into libc:
$ perf diff --dsos libc-2.10.1.so | head -8
37.34% find [.] _IO_vfprintf_internal
10.34% find [.] __GI_memmove
8.25% +2.00% find [.] _int_malloc
5.07% -1.00% find [.] __GI_mempcpy
7.62% +2.00% find [.] _int_free
$
And if there were multiple commands using libc, it is also
possible to aggregate them all by using --sort symbol:
$ perf diff --dsos libc-2.10.1.so --sort symbol | head -8
37.34% [.] _IO_vfprintf_internal
10.34% [.] __GI_memmove
8.25% +2.00% [.] _int_malloc
5.07% -1.00% [.] __GI_mempcpy
7.62% +2.00% [.] _int_free
$
The displacement column now is off by default, to use it:
perf diff -m --dsos libc-2.10.1.so --sort symbol | head -8
37.34% [.] _IO_vfprintf_internal
10.34% [.] __GI_memmove
8.25% +2.00% [.] _int_malloc
5.07% -1.00% +2 [.] __GI_mempcpy
7.62% +2.00% -1 [.] _int_free
$
Using -t/--field-separator can be used for scripting:
$ perf diff -t, -m --dsos libc-2.10.1.so --sort symbol | head -8
37.34, , ,[.] _IO_vfprintf_internal
10.34, , ,[.] __GI_memmove
8.25,+2.00%, ,[.] _int_malloc
5.07,-1.00%, +2,[.] __GI_mempcpy
7.62,+2.00%, -1,[.] _int_free
6.99,+1.00%, -1,[.] _IO_new_file_xsputn
1.89,-2.00%, +4,[.] __readdir64
$
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1260978567-550-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-12-16 23:49:27 +08:00
|
|
|
with a '.' character, that thus it's the only non valid separator.
|
|
|
|
|
2009-12-15 06:09:31 +08:00
|
|
|
-v::
|
|
|
|
--verbose::
|
2009-12-15 17:24:08 +08:00
|
|
|
Be verbose, for instance, show the raw counts in addition to the
|
2009-12-15 06:09:31 +08:00
|
|
|
diff.
|
2009-12-15 21:01:22 +08:00
|
|
|
|
2010-12-01 09:57:12 +08:00
|
|
|
-f::
|
|
|
|
--force::
|
|
|
|
Don't complain, do it.
|
|
|
|
|
2010-12-10 04:27:07 +08:00
|
|
|
--symfs=<directory>::
|
|
|
|
Look for files with symbols relative to this directory.
|
2010-12-01 09:57:12 +08:00
|
|
|
|
2012-10-05 22:44:40 +08:00
|
|
|
-b::
|
|
|
|
--baseline-only::
|
|
|
|
Show only items with match in baseline.
|
|
|
|
|
2012-10-05 22:44:41 +08:00
|
|
|
-c::
|
|
|
|
--compute::
|
2012-10-05 22:44:43 +08:00
|
|
|
Differential computation selection - delta,ratio,wdiff (default is delta).
|
2012-10-05 22:44:42 +08:00
|
|
|
If '+' is specified as a first character, the output is sorted based
|
|
|
|
on the computation results.
|
2012-10-05 22:44:41 +08:00
|
|
|
See COMPARISON METHODS section for more info.
|
|
|
|
|
|
|
|
COMPARISON METHODS
|
|
|
|
------------------
|
|
|
|
delta
|
|
|
|
~~~~~
|
|
|
|
If specified the 'Delta' column is displayed with value 'd' computed as:
|
|
|
|
|
|
|
|
d = A->period_percent - B->period_percent
|
|
|
|
|
|
|
|
with:
|
|
|
|
- A/B being matching hist entry from first/second file specified
|
|
|
|
(or perf.data/perf.data.old) respectively.
|
|
|
|
|
|
|
|
- period_percent being the % of the hist entry period value within
|
|
|
|
single data file
|
|
|
|
|
|
|
|
ratio
|
|
|
|
~~~~~
|
|
|
|
If specified the 'Ratio' column is displayed with value 'r' computed as:
|
|
|
|
|
|
|
|
r = A->period / B->period
|
|
|
|
|
|
|
|
with:
|
|
|
|
- A/B being matching hist entry from first/second file specified
|
|
|
|
(or perf.data/perf.data.old) respectively.
|
|
|
|
|
|
|
|
- period being the hist entry period value
|
|
|
|
|
2012-10-05 22:44:43 +08:00
|
|
|
wdiff
|
|
|
|
~~~~~
|
|
|
|
If specified the 'Weighted diff' column is displayed with value 'd' computed as:
|
|
|
|
|
|
|
|
d = B->period * WEIGHT-A - A->period * WEIGHT-B
|
|
|
|
|
|
|
|
- A/B being matching hist entry from first/second file specified
|
|
|
|
(or perf.data/perf.data.old) respectively.
|
|
|
|
|
|
|
|
- period being the hist entry period value
|
|
|
|
|
|
|
|
- WEIGHT-A/WEIGHT-B being user suplied weights in the the '-c' option
|
|
|
|
behind ':' separator like '-c wdiff:1,2'.
|
2012-10-05 22:44:41 +08:00
|
|
|
|
2009-12-15 06:09:31 +08:00
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
linkperf:perf-record[1]
|