blob: 518266192d67f11f627c46e73f240b86be87561d [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
34-m::
35--modules::
36 Load module symbols. WARNING: use only with -k and LIVE kernel
37
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020038-d::
39--dsos=::
40 Only consider symbols in these dsos. CSV that understands
Namhyung Kim8810f6c2014-02-07 12:06:07 +090041 file://filename entries. This option will affect the percentage
42 of the Baseline/Delta column. See --percentage for more info.
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020043
44-C::
45--comms=::
46 Only consider symbols in these comms. CSV that understands
Namhyung Kim8810f6c2014-02-07 12:06:07 +090047 file://filename entries. This option will affect the percentage
48 of the Baseline/Delta column. See --percentage for more info.
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020049
50-S::
51--symbols=::
52 Only consider these symbols. CSV that understands
Namhyung Kim8810f6c2014-02-07 12:06:07 +090053 file://filename entries. This option will affect the percentage
54 of the Baseline/Delta column. See --percentage for more info.
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020055
56-s::
57--sort=::
Namhyung Kima2ce0672014-03-04 09:06:42 +090058 Sort by key(s): pid, comm, dso, symbol, cpu, parent, srcline.
59 Please see description of --sort in the perf-report man page.
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020060
61-t::
62--field-separator=::
63
64 Use a special separator character and don't pad with spaces, replacing
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060065 all occurrences of this separator in symbol names (and other output)
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020066 with a '.' character, that thus it's the only non valid separator.
67
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020068-v::
69--verbose::
Ingo Molnard30531c2009-12-15 10:24:08 +010070 Be verbose, for instance, show the raw counts in addition to the
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020071 diff.
Arnaldo Carvalho de Melocdccc692009-12-15 11:01:22 -020072
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060073-f::
74--force::
75 Don't complain, do it.
76
David Ahernec5761e2010-12-09 13:27:07 -070077--symfs=<directory>::
78 Look for files with symbols relative to this directory.
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060079
Jiri Olsaa06d1432012-10-05 16:44:40 +020080-b::
81--baseline-only::
82 Show only items with match in baseline.
83
Jiri Olsa7aaf6b32012-10-05 16:44:41 +020084-c::
85--compute::
Jiri Olsa81d5f952012-10-05 16:44:43 +020086 Differential computation selection - delta,ratio,wdiff (default is delta).
Jiri Olsa7aaf6b32012-10-05 16:44:41 +020087 See COMPARISON METHODS section for more info.
88
Jiri Olsa61949b22012-10-05 16:44:44 +020089-p::
90--period::
91 Show period values for both compared hist entries.
92
Jiri Olsaed279da2012-10-05 16:44:45 +020093-F::
94--formula::
95 Show formula for given computation.
96
Jiri Olsa5f3f8d32012-11-25 23:10:20 +010097-o::
98--order::
99 Specify compute sorting column number.
100
Namhyung Kim8810f6c2014-02-07 12:06:07 +0900101--percentage::
102 Determine how to display the overhead percentage of filtered entries.
103 Filters can be applied by --comms, --dsos and/or --symbols options.
104
105 "relative" means it's relative to filtered entries only so that the
106 sum of shown entries will be always 100%. "absolute" means it retains
107 the original value before and after the filter is applied.
108
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200109COMPARISON
110----------
111The comparison is governed by the baseline file. The baseline perf.data
112file is iterated for samples. All other perf.data files specified on
113the command line are searched for the baseline sample pair. If the pair
114is found, specified computation is made and result is displayed.
115
116All samples from non-baseline perf.data files, that do not match any
117baseline entry, are displayed with empty space within baseline column
118and possible computation results (delta) in their related column.
119
120Example files samples:
121- file A with samples f1, f2, f3, f4, f6
122- file B with samples f2, f4, f5
123- file C with samples f1, f2, f5
124
125Example output:
126 x - computation takes place for pair
127 b - baseline sample percentage
128
129- perf diff A B C
130
131 baseline/A compute/B compute/C samples
132 ---------------------------------------
133 b x f1
134 b x x f2
135 b f3
136 b x f4
137 b f6
138 x x f5
139
140- perf diff B A C
141
142 baseline/B compute/A compute/C samples
143 ---------------------------------------
144 b x x f2
145 b x f4
146 b x f5
147 x x f1
148 x f3
149 x f6
150
151- perf diff C B A
152
153 baseline/C compute/B compute/A samples
154 ---------------------------------------
155 b x f1
156 b x x f2
157 b x f5
158 x f3
159 x x f4
160 x f6
161
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200162COMPARISON METHODS
163------------------
164delta
165~~~~~
166If specified the 'Delta' column is displayed with value 'd' computed as:
167
168 d = A->period_percent - B->period_percent
169
170with:
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200171 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200172 (or perf.data/perf.data.old) respectively.
173
174 - period_percent being the % of the hist entry period value within
175 single data file
176
Namhyung Kim8810f6c2014-02-07 12:06:07 +0900177 - with filtering by -C, -d and/or -S, period_percent might be changed
178 relative to how entries are filtered. Use --percentage=absolute to
179 prevent such fluctuation.
180
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200181ratio
182~~~~~
183If specified the 'Ratio' column is displayed with value 'r' computed as:
184
185 r = A->period / B->period
186
187with:
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200188 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200189 (or perf.data/perf.data.old) respectively.
190
191 - period being the hist entry period value
192
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200193wdiff:WEIGHT-B,WEIGHT-A
194~~~~~~~~~~~~~~~~~~~~~~~
Jiri Olsa81d5f952012-10-05 16:44:43 +0200195If specified the 'Weighted diff' column is displayed with value 'd' computed as:
196
197 d = B->period * WEIGHT-A - A->period * WEIGHT-B
198
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200199 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa81d5f952012-10-05 16:44:43 +0200200 (or perf.data/perf.data.old) respectively.
201
202 - period being the hist entry period value
203
Masanari Iida96355f22014-09-10 00:18:50 +0900204 - WEIGHT-A/WEIGHT-B being user supplied weights in the the '-c' option
Jiri Olsa81d5f952012-10-05 16:44:43 +0200205 behind ':' separator like '-c wdiff:1,2'.
Masanari Iida96355f22014-09-10 00:18:50 +0900206 - WEIGHT-A being the weight of the data file
207 - WEIGHT-B being the weight of the baseline data file
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200208
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -0200209SEE ALSO
210--------
Namhyung Kima2ce0672014-03-04 09:06:42 +0900211linkperf:perf-record[1], linkperf:perf-report[1]