blob: fdfceee0ffd0ee3d046ca6bd5beef633fd619199 [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 Olsa7aaf6b32012-10-05 16:44:41 +020078 See COMPARISON METHODS section for more info.
79
Jiri Olsa61949b22012-10-05 16:44:44 +020080-p::
81--period::
82 Show period values for both compared hist entries.
83
Jiri Olsaed279da2012-10-05 16:44:45 +020084-F::
85--formula::
86 Show formula for given computation.
87
Jiri Olsa5f3f8d32012-11-25 23:10:20 +010088-o::
89--order::
90 Specify compute sorting column number.
91
Jiri Olsa3a3beae2012-10-24 14:56:51 +020092COMPARISON
93----------
94The comparison is governed by the baseline file. The baseline perf.data
95file is iterated for samples. All other perf.data files specified on
96the command line are searched for the baseline sample pair. If the pair
97is found, specified computation is made and result is displayed.
98
99All samples from non-baseline perf.data files, that do not match any
100baseline entry, are displayed with empty space within baseline column
101and possible computation results (delta) in their related column.
102
103Example files samples:
104- file A with samples f1, f2, f3, f4, f6
105- file B with samples f2, f4, f5
106- file C with samples f1, f2, f5
107
108Example output:
109 x - computation takes place for pair
110 b - baseline sample percentage
111
112- perf diff A B C
113
114 baseline/A compute/B compute/C samples
115 ---------------------------------------
116 b x f1
117 b x x f2
118 b f3
119 b x f4
120 b f6
121 x x f5
122
123- perf diff B A C
124
125 baseline/B compute/A compute/C samples
126 ---------------------------------------
127 b x x f2
128 b x f4
129 b x f5
130 x x f1
131 x f3
132 x f6
133
134- perf diff C B A
135
136 baseline/C compute/B compute/A samples
137 ---------------------------------------
138 b x f1
139 b x x f2
140 b x f5
141 x f3
142 x x f4
143 x f6
144
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200145COMPARISON METHODS
146------------------
147delta
148~~~~~
149If specified the 'Delta' column is displayed with value 'd' computed as:
150
151 d = A->period_percent - B->period_percent
152
153with:
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200154 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200155 (or perf.data/perf.data.old) respectively.
156
157 - period_percent being the % of the hist entry period value within
158 single data file
159
160ratio
161~~~~~
162If specified the 'Ratio' column is displayed with value 'r' computed as:
163
164 r = A->period / B->period
165
166with:
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200167 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200168 (or perf.data/perf.data.old) respectively.
169
170 - period being the hist entry period value
171
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200172wdiff:WEIGHT-B,WEIGHT-A
173~~~~~~~~~~~~~~~~~~~~~~~
Jiri Olsa81d5f952012-10-05 16:44:43 +0200174If specified the 'Weighted diff' column is displayed with value 'd' computed as:
175
176 d = B->period * WEIGHT-A - A->period * WEIGHT-B
177
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200178 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa81d5f952012-10-05 16:44:43 +0200179 (or perf.data/perf.data.old) respectively.
180
181 - period being the hist entry period value
182
183 - WEIGHT-A/WEIGHT-B being user suplied weights in the the '-c' option
184 behind ':' separator like '-c wdiff:1,2'.
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200185 - WIEGHT-A being the weight of the data file
186 - WIEGHT-B being the weight of the baseline data file
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200187
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -0200188SEE ALSO
189--------
190linkperf:perf-record[1]