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, delta-abs
78           (default is delta-abs). Default can be changed using diff.compute
79           config option. See COMPARISON METHODS section for more info.
80
81       -p, --period
82           Show period values for both compared hist entries.
83
84       -F, --formula
85           Show formula for given computation.
86
87       -o, --order
88           Specify compute sorting column number. 0 means sorting by baseline
89           overhead and 1 (default) means sorting by computed value of column
90           1 (data from the first file other base baseline). Values more than
91           1 can be used only if enough data files are provided. The default
92           value can be set using the diff.order config option.
93
94       --percentage
95           Determine how to display the overhead percentage of filtered
96           entries. Filters can be applied by --comms, --dsos and/or --symbols
97           options.
98
99               "relative" means it's relative to filtered entries only so that the
100               sum of shown entries will be always 100%.  "absolute" means it retains
101               the original value before and after the filter is applied.
102

COMPARISON

104       The comparison is governed by the baseline file. The baseline perf.data
105       file is iterated for samples. All other perf.data files specified on
106       the command line are searched for the baseline sample pair. If the pair
107       is found, specified computation is made and result is displayed.
108
109       All samples from non-baseline perf.data files, that do not match any
110       baseline entry, are displayed with empty space within baseline column
111       and possible computation results (delta) in their related column.
112
113       Example files samples: - file A with samples f1, f2, f3, f4, f6 - file
114       B with samples f2, f4, f5 - file C with samples f1, f2, f5
115
116       Example output: x - computation takes place for pair b - baseline
117       sample percentage
118
119       ·   perf diff A B C
120
121               baseline/A compute/B compute/C  samples
122               ---------------------------------------
123               b                    x          f1
124               b          x         x          f2
125               b                               f3
126               b          x                    f4
127               b                               f6
128                          x         x          f5
129
130       ·   perf diff B A C
131
132               baseline/B compute/A compute/C  samples
133               ---------------------------------------
134               b          x         x          f2
135               b          x                    f4
136               b                    x          f5
137                          x         x          f1
138                          x                    f3
139                          x                    f6
140
141       ·   perf diff C B A
142
143               baseline/C compute/B compute/A  samples
144               ---------------------------------------
145               b                    x          f1
146               b          x         x          f2
147               b          x                    f5
148                                    x          f3
149                          x         x          f4
150                                    x          f6
151

COMPARISON METHODS

153   delta
154       If specified the Delta column is displayed with value d computed as:
155
156           d = A->period_percent - B->period_percent
157
158       with: - A/B being matching hist entry from data/baseline file specified
159       (or perf.data/perf.data.old) respectively.
160
161       ·   period_percent being the % of the hist entry period value within
162           single data file
163
164       ·   with filtering by -C, -d and/or -S, period_percent might be changed
165           relative to how entries are filtered. Use --percentage=absolute to
166           prevent such fluctuation.
167
168   delta-abs
169       Same as 'delta` method, but sort the result with the absolute values.
170
171   ratio
172       If specified the Ratio column is displayed with value r computed as:
173
174           r = A->period / B->period
175
176       with: - A/B being matching hist entry from data/baseline file specified
177       (or perf.data/perf.data.old) respectively.
178
179       ·   period being the hist entry period value
180
181   wdiff:WEIGHT-B,WEIGHT-A
182       If specified the Weighted diff column is displayed with value d
183       computed as:
184
185           d = B->period * WEIGHT-A - A->period * WEIGHT-B
186
187       ·   A/B being matching hist entry from data/baseline file specified (or
188           perf.data/perf.data.old) respectively.
189
190       ·   period being the hist entry period value
191
192       ·   WEIGHT-A/WEIGHT-B being user supplied weights in the the -c option
193           behind : separator like -c wdiff:1,2.
194
195       ·   WEIGHT-A being the weight of the data file
196
197       ·   WEIGHT-B being the weight of the baseline data file
198

SEE ALSO

200       perf-record(1), perf-report(1)
201
202
203
204perf                              06/18/2019                      PERF-DIFF(1)
Impressum