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       -f, --force
65           Don’t complain, do it.
66
67       --symfs=<directory>
68           Look for files with symbols relative to this directory.
69
70       -b, --baseline-only
71           Show only items with match in baseline.
72
73       -c, --compute
74           Differential computation selection - delta,ratio,wdiff (default is
75           delta). See COMPARISON METHODS section for more info.
76
77       -p, --period
78           Show period values for both compared hist entries.
79
80       -F, --formula
81           Show formula for given computation.
82
83       -o, --order
84           Specify compute sorting column number.
85
86       --percentage
87           Determine how to display the overhead percentage of filtered
88           entries. Filters can be applied by --comms, --dsos and/or --symbols
89           options.
90
91               "relative" means it´s relative to filtered entries only so that the
92               sum of shown entries will be always 100%.  "absolute" means it retains
93               the original value before and after the filter is applied.
94

COMPARISON

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

COMPARISON METHODS

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

SEE ALSO

189       perf-record(1), perf-report(1)
190
191
192
193perf                              06/18/2019                      PERF-DIFF(1)
Impressum