1PERF-DIFF(1)                      perf Manual                     PERF-DIFF(1)
2
3
4

NAME

6       perf-diff - Read perf.data files and display the differential profile
7

SYNOPSIS

9       perf diff [baseline file] [data file1] [[data file2] ... ]
10

DESCRIPTION

12       This command displays the performance difference amongst two or more
13       perf.data files captured via perf record.
14
15       If no parameters are passed it will assume perf.data.old and perf.data.
16
17       The differential profile is displayed only for events matching both
18       specified perf.data files.
19
20       If no parameters are passed the samples will be sorted by dso and
21       symbol. As the perf.data files could come from different binaries, the
22       symbols addresses could vary. So perf diff is based on the comparison
23       of the files and symbols name.
24

OPTIONS

26       -D, --dump-raw-trace
27           Dump raw trace in ASCII.
28
29       --kallsyms=<file>
30           kallsyms pathname
31
32       -m, --modules
33           Load module symbols. WARNING: use only with -k and LIVE kernel
34
35       -d, --dsos=
36           Only consider symbols in these dsos. CSV that understands
37           file://filename entries. This option will affect the percentage of
38           the Baseline/Delta column. See --percentage for more info.
39
40       -C, --comms=
41           Only consider symbols in these comms. CSV that understands
42           file://filename entries. This option will affect the percentage of
43           the Baseline/Delta column. See --percentage for more info.
44
45       -S, --symbols=
46           Only consider these symbols. CSV that understands file://filename
47           entries. This option will affect the percentage of the
48           Baseline/Delta column. See --percentage for more info.
49
50       -s, --sort=
51           Sort by key(s): pid, comm, dso, symbol, cpu, parent, srcline.
52           Please see description of --sort in the perf-report man page.
53
54       -t, --field-separator=
55           Use a special separator character and don’t pad with spaces,
56           replacing all occurrences of this separator in symbol names (and
57           other output) with a .  character, that thus it’s the only non
58           valid separator.
59
60       -v, --verbose
61           Be verbose, for instance, show the raw counts in addition to the
62           diff.
63
64       -q, --quiet
65           Do not show any message. (Suppress -v)
66
67       -f, --force
68           Don’t do ownership validation.
69
70       --symfs=<directory>
71           Look for files with symbols relative to this directory.
72
73       -b, --baseline-only
74           Show only items with match in baseline.
75
76       -c, --compute
77           Differential computation selection - delta, ratio, wdiff, cycles,
78           delta-abs (default is delta-abs). Default can be changed using
79           diff.compute config option. See COMPARISON METHODS section for more
80           info.
81
82       --cycles-hist
83           Report a histogram and the standard deviation for cycles data. It
84           can help us to judge if the reported cycles data is noisy or not.
85           This option should be used with -c cycles.
86
87       -p, --period
88           Show period values for both compared hist entries.
89
90       -F, --formula
91           Show formula for given computation.
92
93       -o, --order
94           Specify compute sorting column number. 0 means sorting by baseline
95           overhead and 1 (default) means sorting by computed value of column
96           1 (data from the first file other base baseline). Values more than
97           1 can be used only if enough data files are provided. The default
98           value can be set using the diff.order config option.
99
100       --percentage
101           Determine how to display the overhead percentage of filtered
102           entries. Filters can be applied by --comms, --dsos and/or --symbols
103           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
109       --time
110           Analyze samples within given time window. It supports time percent
111           with multiple time ranges. Time string is a%/n,b%/m,...  or
112           a%-b%,c%-%d,....
113
114               For example:
115
116               Select the second 10% time slice to diff:
117
118               perf diff --time 10%/2
119
120               Select from 0% to 10% time slice to diff:
121
122               perf diff --time 0%-10%
123
124               Select the first and the second 10% time slices to diff:
125
126               perf diff --time 10%/1,10%/2
127
128               Select from 0% to 10% and 30% to 40% slices to diff:
129
130               perf diff --time 0%-10%,30%-40%
131
132               It also supports analyzing samples within a given time window
133               <start>,<stop>. Times have the format seconds.nanoseconds. If 'start'
134               is not given (i.e. time string is ',x.y') then analysis starts at
135               the beginning of the file. If stop time is not given (i.e. time
136               string is 'x.y,') then analysis goes to the end of the file.
137               Multiple ranges can be separated by spaces, which requires the argument
138               to be quoted e.g. --time "1234.567,1234.789 1235,"
139               Time string is'a1.b1,c1.d1:a2.b2,c2.d2'. Use ':' to separate timestamps
140               for different perf.data files.
141
142               For example, we get the timestamp information from 'perf script'.
143
144               perf script -i perf.data.old
145                 mgen 13940 [000]  3946.361400: ...
146
147               perf script -i perf.data
148                 mgen 13940 [000]  3971.150589 ...
149
150               perf diff --time 3946.361400,:3971.150589,
151
152               It analyzes the perf.data.old from the timestamp 3946.361400 to
153               the end of perf.data.old and analyzes the perf.data from the
154               timestamp 3971.150589 to the end of perf.data.
155
156       --cpu
157           Only diff samples for the list of CPUs provided. Multiple CPUs can
158           be provided as a comma-separated list with no space: 0,1. Ranges of
159           CPUs are specified with -: 0-2. Default is to report samples on all
160           CPUs.
161
162       --pid=
163           Only diff samples for given process ID (comma separated list).
164
165       --tid=
166           Only diff samples for given thread ID (comma separated list).
167

COMPARISON

169       The comparison is governed by the baseline file. The baseline perf.data
170       file is iterated for samples. All other perf.data files specified on
171       the command line are searched for the baseline sample pair. If the pair
172       is found, specified computation is made and result is displayed.
173
174       All samples from non-baseline perf.data files, that do not match any
175       baseline entry, are displayed with empty space within baseline column
176       and possible computation results (delta) in their related column.
177
178       Example files samples: - file A with samples f1, f2, f3, f4, f6 - file
179       B with samples f2, f4, f5 - file C with samples f1, f2, f5
180
181       Example output: x - computation takes place for pair b - baseline
182       sample percentage
183
184       ·   perf diff A B C
185
186               baseline/A compute/B compute/C  samples
187               ---------------------------------------
188               b                    x          f1
189               b          x         x          f2
190               b                               f3
191               b          x                    f4
192               b                               f6
193                          x         x          f5
194
195       ·   perf diff B A C
196
197               baseline/B compute/A compute/C  samples
198               ---------------------------------------
199               b          x         x          f2
200               b          x                    f4
201               b                    x          f5
202                          x         x          f1
203                          x                    f3
204                          x                    f6
205
206       ·   perf diff C B A
207
208               baseline/C compute/B compute/A  samples
209               ---------------------------------------
210               b                    x          f1
211               b          x         x          f2
212               b          x                    f5
213                                    x          f3
214                          x         x          f4
215                                    x          f6
216

COMPARISON METHODS

218   delta
219       If specified the Delta column is displayed with value d computed as:
220
221           d = A->period_percent - B->period_percent
222
223       with: - A/B being matching hist entry from data/baseline file specified
224       (or perf.data/perf.data.old) respectively.
225
226       ·   period_percent being the % of the hist entry period value within
227           single data file
228
229       ·   with filtering by -C, -d and/or -S, period_percent might be changed
230           relative to how entries are filtered. Use --percentage=absolute to
231           prevent such fluctuation.
232
233   delta-abs
234       Same as 'delta` method, but sort the result with the absolute values.
235
236   ratio
237       If specified the Ratio column is displayed with value r computed as:
238
239           r = A->period / B->period
240
241       with: - A/B being matching hist entry from data/baseline file specified
242       (or perf.data/perf.data.old) respectively.
243
244       ·   period being the hist entry period value
245
246   wdiff:WEIGHT-B,WEIGHT-A
247       If specified the Weighted diff column is displayed with value d
248       computed as:
249
250           d = B->period * WEIGHT-A - A->period * WEIGHT-B
251
252       ·   A/B being matching hist entry from data/baseline file specified (or
253           perf.data/perf.data.old) respectively.
254
255       ·   period being the hist entry period value
256
257       ·   WEIGHT-A/WEIGHT-B being user supplied weights in the the -c option
258           behind : separator like -c wdiff:1,2.
259
260       ·   WEIGHT-A being the weight of the data file
261
262       ·   WEIGHT-B being the weight of the baseline data file
263
264   cycles
265       If specified the [Program Block Range] Cycles Diff column is displayed.
266       It displays the cycles difference of same program basic block amongst
267       two perf.data. The program basic block is the code between two
268       branches.
269
270       [Program Block Range] indicates the range of a program basic block.
271       Source line is reported if it can be found otherwise uses symbol+offset
272       instead.
273

SEE ALSO

275       perf-record(1), perf-report(1)
276
277
278
279perf                              04/23/2020                      PERF-DIFF(1)
Impressum