blob: 2d134f3f1c9d2d74a6c426ef1a830c470d5f58f5 [file] [log] [blame]
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -02001perf-diff(1)
Arnaldo Carvalho de Melo4778e0e2010-05-05 11:23:27 -03002============
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -02003
4NAME
5----
Jiri Olsa3a3beae2012-10-24 14:56:51 +02006perf-diff - Read perf.data files and display the differential profile
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -02007
8SYNOPSIS
9--------
10[verse]
Jiri Olsa3a3beae2012-10-24 14:56:51 +020011'perf diff' [baseline file] [data file1] [[data file2] ... ]
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020012
13DESCRIPTION
14-----------
Jiri Olsa3a3beae2012-10-24 14:56:51 +020015This command displays the performance difference amongst two or more perf.data
16files captured via perf record.
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020017
18If no parameters are passed it will assume perf.data.old and perf.data.
19
Jiri Olsa863e4512012-09-06 17:46:55 +020020The differential profile is displayed only for events matching both
21specified perf.data files.
22
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020023OPTIONS
24-------
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060025-D::
26--dump-raw-trace::
27 Dump raw trace in ASCII.
28
29-m::
30--modules::
31 Load module symbols. WARNING: use only with -k and LIVE kernel
32
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020033-d::
34--dsos=::
35 Only consider symbols in these dsos. CSV that understands
36 file://filename entries.
37
38-C::
39--comms=::
40 Only consider symbols in these comms. CSV that understands
41 file://filename entries.
42
43-S::
44--symbols=::
45 Only consider these symbols. CSV that understands
46 file://filename entries.
47
48-s::
49--sort=::
50 Sort by key(s): pid, comm, dso, symbol.
51
52-t::
53--field-separator=::
54
55 Use a special separator character and don't pad with spaces, replacing
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060056 all occurrences of this separator in symbol names (and other output)
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020057 with a '.' character, that thus it's the only non valid separator.
58
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020059-v::
60--verbose::
Ingo Molnard30531c2009-12-15 10:24:08 +010061 Be verbose, for instance, show the raw counts in addition to the
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020062 diff.
Arnaldo Carvalho de Melocdccc692009-12-15 11:01:22 -020063
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060064-f::
65--force::
66 Don't complain, do it.
67
David Ahernec5761e2010-12-09 13:27:07 -070068--symfs=<directory>::
69 Look for files with symbols relative to this directory.
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060070
Jiri Olsaa06d1432012-10-05 16:44:40 +020071-b::
72--baseline-only::
73 Show only items with match in baseline.
74
Jiri Olsa7aaf6b32012-10-05 16:44:41 +020075-c::
76--compute::
Jiri Olsa81d5f952012-10-05 16:44:43 +020077 Differential computation selection - delta,ratio,wdiff (default is delta).
Jiri Olsa96c47f12012-10-05 16:44:42 +020078 If '+' is specified as a first character, the output is sorted based
79 on the computation results.
Jiri Olsa7aaf6b32012-10-05 16:44:41 +020080 See COMPARISON METHODS section for more info.
81
Jiri Olsa61949b22012-10-05 16:44:44 +020082-p::
83--period::
84 Show period values for both compared hist entries.
85
Jiri Olsaed279da2012-10-05 16:44:45 +020086-F::
87--formula::
88 Show formula for given computation.
89
Jiri Olsa3a3beae2012-10-24 14:56:51 +020090COMPARISON
91----------
92The comparison is governed by the baseline file. The baseline perf.data
93file is iterated for samples. All other perf.data files specified on
94the command line are searched for the baseline sample pair. If the pair
95is found, specified computation is made and result is displayed.
96
97All samples from non-baseline perf.data files, that do not match any
98baseline entry, are displayed with empty space within baseline column
99and possible computation results (delta) in their related column.
100
101Example files samples:
102- file A with samples f1, f2, f3, f4, f6
103- file B with samples f2, f4, f5
104- file C with samples f1, f2, f5
105
106Example output:
107 x - computation takes place for pair
108 b - baseline sample percentage
109
110- perf diff A B C
111
112 baseline/A compute/B compute/C samples
113 ---------------------------------------
114 b x f1
115 b x x f2
116 b f3
117 b x f4
118 b f6
119 x x f5
120
121- perf diff B A C
122
123 baseline/B compute/A compute/C samples
124 ---------------------------------------
125 b x x f2
126 b x f4
127 b x f5
128 x x f1
129 x f3
130 x f6
131
132- perf diff C B A
133
134 baseline/C compute/B compute/A samples
135 ---------------------------------------
136 b x f1
137 b x x f2
138 b x f5
139 x f3
140 x x f4
141 x f6
142
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200143COMPARISON METHODS
144------------------
145delta
146~~~~~
147If specified the 'Delta' column is displayed with value 'd' computed as:
148
149 d = A->period_percent - B->period_percent
150
151with:
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200152 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200153 (or perf.data/perf.data.old) respectively.
154
155 - period_percent being the % of the hist entry period value within
156 single data file
157
158ratio
159~~~~~
160If specified the 'Ratio' column is displayed with value 'r' computed as:
161
162 r = A->period / B->period
163
164with:
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200165 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200166 (or perf.data/perf.data.old) respectively.
167
168 - period being the hist entry period value
169
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200170wdiff:WEIGHT-B,WEIGHT-A
171~~~~~~~~~~~~~~~~~~~~~~~
Jiri Olsa81d5f952012-10-05 16:44:43 +0200172If specified the 'Weighted diff' column is displayed with value 'd' computed as:
173
174 d = B->period * WEIGHT-A - A->period * WEIGHT-B
175
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200176 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa81d5f952012-10-05 16:44:43 +0200177 (or perf.data/perf.data.old) respectively.
178
179 - period being the hist entry period value
180
181 - WEIGHT-A/WEIGHT-B being user suplied weights in the the '-c' option
182 behind ':' separator like '-c wdiff:1,2'.
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200183 - WIEGHT-A being the weight of the data file
184 - WIEGHT-B being the weight of the baseline data file
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200185
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -0200186SEE ALSO
187--------
188linkperf:perf-record[1]