blob: a79c84ae61aaf616b931385c31969911d1d530bd [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
Kan Liang94ba4622015-02-09 05:39:44 +000023If no parameters are passed the samples will be sorted by dso and symbol.
24As the perf.data files could come from different binaries, the symbols addresses
25could vary. So perf diff is based on the comparison of the files and
26symbols name.
27
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020028OPTIONS
29-------
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060030-D::
31--dump-raw-trace::
32 Dump raw trace in ASCII.
33
David Ahern6b1f3422015-03-24 09:51:57 -060034--kallsyms=<file>::
35 kallsyms pathname
36
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060037-m::
38--modules::
39 Load module symbols. WARNING: use only with -k and LIVE kernel
40
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020041-d::
42--dsos=::
43 Only consider symbols in these dsos. CSV that understands
Namhyung Kim8810f6c2014-02-07 12:06:07 +090044 file://filename entries. This option will affect the percentage
45 of the Baseline/Delta column. See --percentage for more info.
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020046
47-C::
48--comms=::
49 Only consider symbols in these comms. CSV that understands
Namhyung Kim8810f6c2014-02-07 12:06:07 +090050 file://filename entries. This option will affect the percentage
51 of the Baseline/Delta column. See --percentage for more info.
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020052
53-S::
54--symbols=::
55 Only consider these symbols. CSV that understands
Namhyung Kim8810f6c2014-02-07 12:06:07 +090056 file://filename entries. This option will affect the percentage
57 of the Baseline/Delta column. See --percentage for more info.
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020058
59-s::
60--sort=::
Namhyung Kima2ce0672014-03-04 09:06:42 +090061 Sort by key(s): pid, comm, dso, symbol, cpu, parent, srcline.
62 Please see description of --sort in the perf-report man page.
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020063
64-t::
65--field-separator=::
66
67 Use a special separator character and don't pad with spaces, replacing
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060068 all occurrences of this separator in symbol names (and other output)
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020069 with a '.' character, that thus it's the only non valid separator.
70
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020071-v::
72--verbose::
Ingo Molnard30531c2009-12-15 10:24:08 +010073 Be verbose, for instance, show the raw counts in addition to the
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020074 diff.
Arnaldo Carvalho de Melocdccc692009-12-15 11:01:22 -020075
Namhyung Kim63b42fc2017-02-17 17:17:40 +090076-q::
77--quiet::
78 Do not show any message. (Suppress -v)
79
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060080-f::
81--force::
Jiri Olsae0be62c2016-03-24 13:52:19 +010082 Don't do ownership validation.
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060083
David Ahernec5761e2010-12-09 13:27:07 -070084--symfs=<directory>::
85 Look for files with symbols relative to this directory.
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060086
Jiri Olsaa06d1432012-10-05 16:44:40 +020087-b::
88--baseline-only::
89 Show only items with match in baseline.
90
Jiri Olsa7aaf6b32012-10-05 16:44:41 +020091-c::
92--compute::
Namhyung Kim4b359942017-02-10 16:36:13 +090093 Differential computation selection - delta, ratio, wdiff, delta-abs
Namhyung Kimbe57b3f2017-02-11 01:18:56 +090094 (default is delta-abs). Default can be changed using diff.compute
Namhyung Kim4b359942017-02-10 16:36:13 +090095 config option. See COMPARISON METHODS section for more info.
Jiri Olsa7aaf6b32012-10-05 16:44:41 +020096
Jiri Olsa61949b22012-10-05 16:44:44 +020097-p::
98--period::
99 Show period values for both compared hist entries.
100
Jiri Olsaed279da2012-10-05 16:44:45 +0200101-F::
102--formula::
103 Show formula for given computation.
104
Jiri Olsa5f3f8d32012-11-25 23:10:20 +0100105-o::
106--order::
Namhyung Kimd49dd152017-02-10 16:36:12 +0900107 Specify compute sorting column number. 0 means sorting by baseline
Namhyung Kimbe57b3f2017-02-11 01:18:56 +0900108 overhead and 1 (default) means sorting by computed value of column 1
Namhyung Kimd49dd152017-02-10 16:36:12 +0900109 (data from the first file other base baseline). Values more than 1
110 can be used only if enough data files are provided.
111 The default value can be set using the diff.order config option.
Jiri Olsa5f3f8d32012-11-25 23:10:20 +0100112
Namhyung Kim8810f6c2014-02-07 12:06:07 +0900113--percentage::
114 Determine how to display the overhead percentage of filtered entries.
115 Filters can be applied by --comms, --dsos and/or --symbols options.
116
117 "relative" means it's relative to filtered entries only so that the
118 sum of shown entries will be always 100%. "absolute" means it retains
119 the original value before and after the filter is applied.
120
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200121COMPARISON
122----------
123The comparison is governed by the baseline file. The baseline perf.data
124file is iterated for samples. All other perf.data files specified on
125the command line are searched for the baseline sample pair. If the pair
126is found, specified computation is made and result is displayed.
127
128All samples from non-baseline perf.data files, that do not match any
129baseline entry, are displayed with empty space within baseline column
130and possible computation results (delta) in their related column.
131
132Example files samples:
133- file A with samples f1, f2, f3, f4, f6
134- file B with samples f2, f4, f5
135- file C with samples f1, f2, f5
136
137Example output:
138 x - computation takes place for pair
139 b - baseline sample percentage
140
141- perf diff A B C
142
143 baseline/A compute/B compute/C samples
144 ---------------------------------------
145 b x f1
146 b x x f2
147 b f3
148 b x f4
149 b f6
150 x x f5
151
152- perf diff B A C
153
154 baseline/B compute/A compute/C samples
155 ---------------------------------------
156 b x x f2
157 b x f4
158 b x f5
159 x x f1
160 x f3
161 x f6
162
163- perf diff C B A
164
165 baseline/C compute/B compute/A samples
166 ---------------------------------------
167 b x f1
168 b x x f2
169 b x f5
170 x f3
171 x x f4
172 x f6
173
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200174COMPARISON METHODS
175------------------
176delta
177~~~~~
178If specified the 'Delta' column is displayed with value 'd' computed as:
179
180 d = A->period_percent - B->period_percent
181
182with:
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200183 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200184 (or perf.data/perf.data.old) respectively.
185
186 - period_percent being the % of the hist entry period value within
187 single data file
188
Namhyung Kim8810f6c2014-02-07 12:06:07 +0900189 - with filtering by -C, -d and/or -S, period_percent might be changed
190 relative to how entries are filtered. Use --percentage=absolute to
191 prevent such fluctuation.
192
Namhyung Kima1668c22017-02-10 16:36:11 +0900193delta-abs
194~~~~~~~~~
195Same as 'delta` method, but sort the result with the absolute values.
196
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200197ratio
198~~~~~
199If specified the 'Ratio' column is displayed with value 'r' computed as:
200
201 r = A->period / B->period
202
203with:
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200204 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200205 (or perf.data/perf.data.old) respectively.
206
207 - period being the hist entry period value
208
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200209wdiff:WEIGHT-B,WEIGHT-A
210~~~~~~~~~~~~~~~~~~~~~~~
Jiri Olsa81d5f952012-10-05 16:44:43 +0200211If specified the 'Weighted diff' column is displayed with value 'd' computed as:
212
213 d = B->period * WEIGHT-A - A->period * WEIGHT-B
214
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200215 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa81d5f952012-10-05 16:44:43 +0200216 (or perf.data/perf.data.old) respectively.
217
218 - period being the hist entry period value
219
Masanari Iida96355f22014-09-10 00:18:50 +0900220 - WEIGHT-A/WEIGHT-B being user supplied weights in the the '-c' option
Jiri Olsa81d5f952012-10-05 16:44:43 +0200221 behind ':' separator like '-c wdiff:1,2'.
Masanari Iida96355f22014-09-10 00:18:50 +0900222 - WEIGHT-A being the weight of the data file
223 - WEIGHT-B being the weight of the baseline data file
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200224
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -0200225SEE ALSO
226--------
Namhyung Kima2ce0672014-03-04 09:06:42 +0900227linkperf:perf-record[1], linkperf:perf-report[1]