6 perf-diff - Read perf.data files and display the differential profile
11 'perf diff' [baseline file] [data file1] [[data file2] ... ]
15 This command displays the performance difference amongst two or more perf.data
16 files captured via perf record.
18 If no parameters are passed it will assume perf.data.old and perf.data.
20 The differential profile is displayed only for events matching both
21 specified perf.data files.
23 If no parameters are passed the samples will be sorted by dso and symbol.
24 As the perf.data files could come from different binaries, the symbols addresses
25 could vary. So perf diff is based on the comparison of the files and
32 Dump raw trace in ASCII.
39 Load module symbols. WARNING: use only with -k and LIVE kernel
43 Only consider symbols in these dsos. CSV that understands
44 file://filename entries. This option will affect the percentage
45 of the Baseline/Delta column. See --percentage for more info.
49 Only consider symbols in these comms. CSV that understands
50 file://filename entries. This option will affect the percentage
51 of the Baseline/Delta column. See --percentage for more info.
55 Only consider these symbols. CSV that understands
56 file://filename entries. This option will affect the percentage
57 of the Baseline/Delta column. See --percentage for more info.
61 Sort by key(s): pid, comm, dso, symbol, cpu, parent, srcline.
62 Please see description of --sort in the perf-report man page.
67 Use a special separator character and don't pad with spaces, replacing
68 all occurrences of this separator in symbol names (and other output)
69 with a '.' character, that thus it's the only non valid separator.
73 Be verbose, for instance, show the raw counts in addition to the
78 Don't do ownership validation.
81 Look for files with symbols relative to this directory.
85 Show only items with match in baseline.
89 Differential computation selection - delta,ratio,wdiff,delta-abs (default is delta).
90 See COMPARISON METHODS section for more info.
94 Show period values for both compared hist entries.
98 Show formula for given computation.
102 Specify compute sorting column number. 0 means sorting by baseline
103 overhead (default) and 1 means sorting by computed value of column 1
104 (data from the first file other base baseline). Values more than 1
105 can be used only if enough data files are provided.
106 The default value can be set using the diff.order config option.
109 Determine how to display the overhead percentage of filtered entries.
110 Filters can be applied by --comms, --dsos and/or --symbols options.
112 "relative" means it's relative to filtered entries only so that the
113 sum of shown entries will be always 100%. "absolute" means it retains
114 the original value before and after the filter is applied.
118 The comparison is governed by the baseline file. The baseline perf.data
119 file is iterated for samples. All other perf.data files specified on
120 the command line are searched for the baseline sample pair. If the pair
121 is found, specified computation is made and result is displayed.
123 All samples from non-baseline perf.data files, that do not match any
124 baseline entry, are displayed with empty space within baseline column
125 and possible computation results (delta) in their related column.
127 Example files samples:
128 - file A with samples f1, f2, f3, f4, f6
129 - file B with samples f2, f4, f5
130 - file C with samples f1, f2, f5
133 x - computation takes place for pair
134 b - baseline sample percentage
138 baseline/A compute/B compute/C samples
139 ---------------------------------------
149 baseline/B compute/A compute/C samples
150 ---------------------------------------
160 baseline/C compute/B compute/A samples
161 ---------------------------------------
173 If specified the 'Delta' column is displayed with value 'd' computed as:
175 d = A->period_percent - B->period_percent
178 - A/B being matching hist entry from data/baseline file specified
179 (or perf.data/perf.data.old) respectively.
181 - period_percent being the % of the hist entry period value within
184 - with filtering by -C, -d and/or -S, period_percent might be changed
185 relative to how entries are filtered. Use --percentage=absolute to
186 prevent such fluctuation.
190 Same as 'delta` method, but sort the result with the absolute values.
194 If specified the 'Ratio' column is displayed with value 'r' computed as:
196 r = A->period / B->period
199 - A/B being matching hist entry from data/baseline file specified
200 (or perf.data/perf.data.old) respectively.
202 - period being the hist entry period value
204 wdiff:WEIGHT-B,WEIGHT-A
205 ~~~~~~~~~~~~~~~~~~~~~~~
206 If specified the 'Weighted diff' column is displayed with value 'd' computed as:
208 d = B->period * WEIGHT-A - A->period * WEIGHT-B
210 - A/B being matching hist entry from data/baseline file specified
211 (or perf.data/perf.data.old) respectively.
213 - period being the hist entry period value
215 - WEIGHT-A/WEIGHT-B being user supplied weights in the the '-c' option
216 behind ':' separator like '-c wdiff:1,2'.
217 - WEIGHT-A being the weight of the data file
218 - WEIGHT-B being the weight of the baseline data file
222 linkperf:perf-record[1], linkperf:perf-report[1]