]> git.karo-electronics.de Git - karo-tx-linux.git/blob - tools/perf/Documentation/perf-diff.txt
66dbe3dee74bcaae5b523bf3f80741b8608c87e2
[karo-tx-linux.git] / tools / perf / Documentation / perf-diff.txt
1 perf-diff(1)
2 ============
3
4 NAME
5 ----
6 perf-diff - Read perf.data files and display the differential profile
7
8 SYNOPSIS
9 --------
10 [verse]
11 'perf diff' [baseline file] [data file1] [[data file2] ... ]
12
13 DESCRIPTION
14 -----------
15 This command displays the performance difference amongst two or more perf.data
16 files captured via perf record.
17
18 If no parameters are passed it will assume perf.data.old and perf.data.
19
20 The differential profile is displayed only for events matching both
21 specified perf.data files.
22
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
26 symbols name.
27
28 OPTIONS
29 -------
30 -D::
31 --dump-raw-trace::
32         Dump raw trace in ASCII.
33
34 --kallsyms=<file>::
35         kallsyms pathname
36
37 -m::
38 --modules::
39         Load module symbols. WARNING: use only with -k and LIVE kernel
40
41 -d::
42 --dsos=::
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.
46
47 -C::
48 --comms=::
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.
52
53 -S::
54 --symbols=::
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.
58
59 -s::
60 --sort=::
61         Sort by key(s): pid, comm, dso, symbol, cpu, parent, srcline.
62         Please see description of --sort in the perf-report man page.
63
64 -t::
65 --field-separator=::
66
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.
70
71 -v::
72 --verbose::
73         Be verbose, for instance, show the raw counts in addition to the
74         diff.
75
76 -f::
77 --force::
78         Don't do ownership validation.
79
80 --symfs=<directory>::
81         Look for files with symbols relative to this directory.
82
83 -b::
84 --baseline-only::
85         Show only items with match in baseline.
86
87 -c::
88 --compute::
89         Differential computation selection - delta, ratio, wdiff, delta-abs
90         (default is delta-abs).  Default can be changed using diff.compute
91         config option.  See COMPARISON METHODS section for more info.
92
93 -p::
94 --period::
95         Show period values for both compared hist entries.
96
97 -F::
98 --formula::
99         Show formula for given computation.
100
101 -o::
102 --order::
103        Specify compute sorting column number.  0 means sorting by baseline
104        overhead and 1 (default) means sorting by computed value of column 1
105        (data from the first file other base baseline).  Values more than 1
106        can be used only if enough data files are provided.
107        The default value can be set using the diff.order config option.
108
109 --percentage::
110         Determine how to display the overhead percentage of filtered entries.
111         Filters can be applied by --comms, --dsos and/or --symbols options.
112
113         "relative" means it's relative to filtered entries only so that the
114         sum of shown entries will be always 100%.  "absolute" means it retains
115         the original value before and after the filter is applied.
116
117 COMPARISON
118 ----------
119 The comparison is governed by the baseline file. The baseline perf.data
120 file is iterated for samples. All other perf.data files specified on
121 the command line are searched for the baseline sample pair. If the pair
122 is found, specified computation is made and result is displayed.
123
124 All samples from non-baseline perf.data files, that do not match any
125 baseline entry, are displayed with empty space within baseline column
126 and possible computation results (delta) in their related column.
127
128 Example files samples:
129 - file A with samples f1, f2, f3, f4,    f6
130 - file B with samples     f2,     f4, f5
131 - file C with samples f1, f2,         f5
132
133 Example output:
134   x - computation takes place for pair
135   b - baseline sample percentage
136
137 - perf diff A B C
138
139   baseline/A compute/B compute/C  samples
140   ---------------------------------------
141   b                    x          f1
142   b          x         x          f2
143   b                               f3
144   b          x                    f4
145   b                               f6
146              x         x          f5
147
148 - perf diff B A C
149
150   baseline/B compute/A compute/C  samples
151   ---------------------------------------
152   b          x         x          f2
153   b          x                    f4
154   b                    x          f5
155              x         x          f1
156              x                    f3
157              x                    f6
158
159 - perf diff C B A
160
161   baseline/C compute/B compute/A  samples
162   ---------------------------------------
163   b                    x          f1
164   b          x         x          f2
165   b          x                    f5
166                        x          f3
167              x         x          f4
168                        x          f6
169
170 COMPARISON METHODS
171 ------------------
172 delta
173 ~~~~~
174 If specified the 'Delta' column is displayed with value 'd' computed as:
175
176   d = A->period_percent - B->period_percent
177
178 with:
179   - A/B being matching hist entry from data/baseline file specified
180     (or perf.data/perf.data.old) respectively.
181
182   - period_percent being the % of the hist entry period value within
183     single data file
184
185   - with filtering by -C, -d and/or -S, period_percent might be changed
186     relative to how entries are filtered.  Use --percentage=absolute to
187     prevent such fluctuation.
188
189 delta-abs
190 ~~~~~~~~~
191 Same as 'delta` method, but sort the result with the absolute values.
192
193 ratio
194 ~~~~~
195 If specified the 'Ratio' column is displayed with value 'r' computed as:
196
197   r = A->period / B->period
198
199 with:
200   - A/B being matching hist entry from data/baseline file specified
201     (or perf.data/perf.data.old) respectively.
202
203   - period being the hist entry period value
204
205 wdiff:WEIGHT-B,WEIGHT-A
206 ~~~~~~~~~~~~~~~~~~~~~~~
207 If specified the 'Weighted diff' column is displayed with value 'd' computed as:
208
209    d = B->period * WEIGHT-A - A->period * WEIGHT-B
210
211   - A/B being matching hist entry from data/baseline file specified
212     (or perf.data/perf.data.old) respectively.
213
214   - period being the hist entry period value
215
216   - WEIGHT-A/WEIGHT-B being user supplied weights in the the '-c' option
217     behind ':' separator like '-c wdiff:1,2'.
218     - WEIGHT-A being the weight of the data file
219     - WEIGHT-B being the weight of the baseline data file
220
221 SEE ALSO
222 --------
223 linkperf:perf-record[1], linkperf:perf-report[1]