1PERF-DIFF(1) perf Manual PERF-DIFF(1)
2
3
4
6 perf-diff - Read perf.data files and display the differential profile
7
9 perf diff [baseline file] [data file1] [[data file2] ... ]
10
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
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
103 --time
104 Analyze samples within given time window. It supports time percent
105 with multiple time ranges. Time string is a%/n,b%/m,... or
106 a%-b%,c%-%d,....
107
108 For example:
109
110 Select the second 10% time slice to diff:
111
112 perf diff --time 10%/2
113
114 Select from 0% to 10% time slice to diff:
115
116 perf diff --time 0%-10%
117
118 Select the first and the second 10% time slices to diff:
119
120 perf diff --time 10%/1,10%/2
121
122 Select from 0% to 10% and 30% to 40% slices to diff:
123
124 perf diff --time 0%-10%,30%-40%
125
126 It also supports analyzing samples within a given time window
127 <start>,<stop>. Times have the format seconds.microseconds. If 'start'
128 is not given (i.e., time string is ',x.y') then analysis starts at
129 the beginning of the file. If stop time is not given (i.e, time
130 string is 'x.y,') then analysis goes to the end of the file. Time string is
131 'a1.b1,c1.d1:a2.b2,c2.d2'. Use ':' to separate timestamps for different
132 perf.data files.
133
134 For example, we get the timestamp information from 'perf script'.
135
136 perf script -i perf.data.old
137 mgen 13940 [000] 3946.361400: ...
138
139 perf script -i perf.data
140 mgen 13940 [000] 3971.150589 ...
141
142 perf diff --time 3946.361400,:3971.150589,
143
144 It analyzes the perf.data.old from the timestamp 3946.361400 to
145 the end of perf.data.old and analyzes the perf.data from the
146 timestamp 3971.150589 to the end of perf.data.
147
148 --cpu
149 Only diff samples for the list of CPUs provided. Multiple CPUs can
150 be provided as a comma-separated list with no space: 0,1. Ranges of
151 CPUs are specified with -: 0-2. Default is to report samples on all
152 CPUs.
153
154 --pid=
155 Only diff samples for given process ID (comma separated list).
156
157 --tid=
158 Only diff samples for given thread ID (comma separated list).
159
161 The comparison is governed by the baseline file. The baseline perf.data
162 file is iterated for samples. All other perf.data files specified on
163 the command line are searched for the baseline sample pair. If the pair
164 is found, specified computation is made and result is displayed.
165
166 All samples from non-baseline perf.data files, that do not match any
167 baseline entry, are displayed with empty space within baseline column
168 and possible computation results (delta) in their related column.
169
170 Example files samples: - file A with samples f1, f2, f3, f4, f6 - file
171 B with samples f2, f4, f5 - file C with samples f1, f2, f5
172
173 Example output: x - computation takes place for pair b - baseline
174 sample percentage
175
176 · perf diff A B C
177
178 baseline/A compute/B compute/C samples
179 ---------------------------------------
180 b x f1
181 b x x f2
182 b f3
183 b x f4
184 b f6
185 x x f5
186
187 · perf diff B A C
188
189 baseline/B compute/A compute/C samples
190 ---------------------------------------
191 b x x f2
192 b x f4
193 b x f5
194 x x f1
195 x f3
196 x f6
197
198 · perf diff C B A
199
200 baseline/C compute/B compute/A samples
201 ---------------------------------------
202 b x f1
203 b x x f2
204 b x f5
205 x f3
206 x x f4
207 x f6
208
210 delta
211 If specified the Delta column is displayed with value d computed as:
212
213 d = A->period_percent - B->period_percent
214
215 with: - A/B being matching hist entry from data/baseline file specified
216 (or perf.data/perf.data.old) respectively.
217
218 · period_percent being the % of the hist entry period value within
219 single data file
220
221 · with filtering by -C, -d and/or -S, period_percent might be changed
222 relative to how entries are filtered. Use --percentage=absolute to
223 prevent such fluctuation.
224
225 delta-abs
226 Same as 'delta` method, but sort the result with the absolute values.
227
228 ratio
229 If specified the Ratio column is displayed with value r computed as:
230
231 r = A->period / B->period
232
233 with: - A/B being matching hist entry from data/baseline file specified
234 (or perf.data/perf.data.old) respectively.
235
236 · period being the hist entry period value
237
238 wdiff:WEIGHT-B,WEIGHT-A
239 If specified the Weighted diff column is displayed with value d
240 computed as:
241
242 d = B->period * WEIGHT-A - A->period * WEIGHT-B
243
244 · A/B being matching hist entry from data/baseline file specified (or
245 perf.data/perf.data.old) respectively.
246
247 · period being the hist entry period value
248
249 · WEIGHT-A/WEIGHT-B being user supplied weights in the the -c option
250 behind : separator like -c wdiff:1,2.
251
252 · WEIGHT-A being the weight of the data file
253
254 · WEIGHT-B being the weight of the baseline data file
255
257 perf-record(1), perf-report(1)
258
259
260
261perf 06/03/2019 PERF-DIFF(1)