~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/Documentation/perf-diff.txt

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/perf/Documentation/perf-diff.txt (Version linux-6.12-rc7) and /tools/perf/Documentation/perf-diff.txt (Version linux-5.3.18)


  1 perf-diff(1)                                        1 perf-diff(1)
  2 ============                                        2 ============
  3                                                     3 
  4 NAME                                                4 NAME
  5 ----                                                5 ----
  6 perf-diff - Read perf.data files and display t      6 perf-diff - Read perf.data files and display the differential profile
  7                                                     7 
  8 SYNOPSIS                                            8 SYNOPSIS
  9 --------                                            9 --------
 10 [verse]                                            10 [verse]
 11 'perf diff' [baseline file] [data file1] [[dat     11 'perf diff' [baseline file] [data file1] [[data file2] ... ]
 12                                                    12 
 13 DESCRIPTION                                        13 DESCRIPTION
 14 -----------                                        14 -----------
 15 This command displays the performance differen     15 This command displays the performance difference amongst two or more perf.data
 16 files captured via perf record.                    16 files captured via perf record.
 17                                                    17 
 18 If no parameters are passed it will assume per     18 If no parameters are passed it will assume perf.data.old and perf.data.
 19                                                    19 
 20 The differential profile is displayed only for     20 The differential profile is displayed only for events matching both
 21 specified perf.data files.                         21 specified perf.data files.
 22                                                    22 
 23 If no parameters are passed the samples will b     23 If no parameters are passed the samples will be sorted by dso and symbol.
 24 As the perf.data files could come from differe     24 As the perf.data files could come from different binaries, the symbols addresses
 25 could vary. So perf diff is based on the compa     25 could vary. So perf diff is based on the comparison of the files and
 26 symbols name.                                      26 symbols name.
 27                                                    27 
 28 OPTIONS                                            28 OPTIONS
 29 -------                                            29 -------
 30 -D::                                               30 -D::
 31 --dump-raw-trace::                                 31 --dump-raw-trace::
 32         Dump raw trace in ASCII.                   32         Dump raw trace in ASCII.
 33                                                    33 
 34 --kallsyms=<file>::                                34 --kallsyms=<file>::
 35         kallsyms pathname                          35         kallsyms pathname
 36                                                    36 
 37 -m::                                               37 -m::
 38 --modules::                                        38 --modules::
 39         Load module symbols. WARNING: use only     39         Load module symbols. WARNING: use only with -k and LIVE kernel
 40                                                    40 
 41 -d::                                               41 -d::
 42 --dsos=::                                          42 --dsos=::
 43         Only consider symbols in these dsos. C     43         Only consider symbols in these dsos. CSV that understands
 44         file://filename entries.  This option      44         file://filename entries.  This option will affect the percentage
 45         of the Baseline/Delta column.  See --p     45         of the Baseline/Delta column.  See --percentage for more info.
 46                                                    46 
 47 -C::                                               47 -C::
 48 --comms=::                                         48 --comms=::
 49         Only consider symbols in these comms.      49         Only consider symbols in these comms. CSV that understands
 50         file://filename entries.  This option      50         file://filename entries.  This option will affect the percentage
 51         of the Baseline/Delta column.  See --p     51         of the Baseline/Delta column.  See --percentage for more info.
 52                                                    52 
 53 -S::                                               53 -S::
 54 --symbols=::                                       54 --symbols=::
 55         Only consider these symbols. CSV that      55         Only consider these symbols. CSV that understands
 56         file://filename entries.  This option      56         file://filename entries.  This option will affect the percentage
 57         of the Baseline/Delta column.  See --p     57         of the Baseline/Delta column.  See --percentage for more info.
 58                                                    58 
 59 -s::                                               59 -s::
 60 --sort=::                                          60 --sort=::
 61         Sort by key(s): pid, comm, dso, symbol     61         Sort by key(s): pid, comm, dso, symbol, cpu, parent, srcline.
 62         Please see description of --sort in th     62         Please see description of --sort in the perf-report man page.
 63                                                    63 
 64 -t::                                               64 -t::
 65 --field-separator=::                               65 --field-separator=::
 66                                                    66 
 67         Use a special separator character and      67         Use a special separator character and don't pad with spaces, replacing
 68         all occurrences of this separator in s     68         all occurrences of this separator in symbol names (and other output)
 69         with a '.' character, that thus it's t     69         with a '.' character, that thus it's the only non valid separator.
 70                                                    70 
 71 -v::                                               71 -v::
 72 --verbose::                                        72 --verbose::
 73         Be verbose, for instance, show the raw     73         Be verbose, for instance, show the raw counts in addition to the
 74         diff.                                      74         diff.
 75                                                    75 
 76 -q::                                               76 -q::
 77 --quiet::                                          77 --quiet::
 78         Do not show any warnings or messages.  !!  78         Do not show any message.  (Suppress -v)
 79                                                    79 
 80 -f::                                               80 -f::
 81 --force::                                          81 --force::
 82         Don't do ownership validation.             82         Don't do ownership validation.
 83                                                    83 
 84 --symfs=<directory>::                              84 --symfs=<directory>::
 85         Look for files with symbols relative t     85         Look for files with symbols relative to this directory.
 86                                                    86 
 87 -b::                                               87 -b::
 88 --baseline-only::                                  88 --baseline-only::
 89         Show only items with match in baseline     89         Show only items with match in baseline.
 90                                                    90 
 91 -c::                                               91 -c::
 92 --compute::                                        92 --compute::
 93         Differential computation selection - d     93         Differential computation selection - delta, ratio, wdiff, cycles,
 94         delta-abs (default is delta-abs).  Def     94         delta-abs (default is delta-abs).  Default can be changed using
 95         diff.compute config option.  See COMPA     95         diff.compute config option.  See COMPARISON METHODS section for
 96         more info.                                 96         more info.
 97                                                    97 
 98 --cycles-hist::                                << 
 99         Report a histogram and the standard de << 
100         It can help us to judge if the reporte << 
101         not. This option should be used with ' << 
102                                                << 
103 -p::                                               98 -p::
104 --period::                                         99 --period::
105         Show period values for both compared h    100         Show period values for both compared hist entries.
106                                                   101 
107 -F::                                              102 -F::
108 --formula::                                       103 --formula::
109         Show formula for given computation.       104         Show formula for given computation.
110                                                   105 
111 -o::                                              106 -o::
112 --order::                                         107 --order::
113        Specify compute sorting column number.     108        Specify compute sorting column number.  0 means sorting by baseline
114        overhead and 1 (default) means sorting     109        overhead and 1 (default) means sorting by computed value of column 1
115        (data from the first file other base ba    110        (data from the first file other base baseline).  Values more than 1
116        can be used only if enough data files a    111        can be used only if enough data files are provided.
117        The default value can be set using the     112        The default value can be set using the diff.order config option.
118                                                   113 
119 --percentage::                                    114 --percentage::
120         Determine how to display the overhead     115         Determine how to display the overhead percentage of filtered entries.
121         Filters can be applied by --comms, --d    116         Filters can be applied by --comms, --dsos and/or --symbols options.
122                                                   117 
123         "relative" means it's relative to filt    118         "relative" means it's relative to filtered entries only so that the
124         sum of shown entries will be always 10    119         sum of shown entries will be always 100%.  "absolute" means it retains
125         the original value before and after th    120         the original value before and after the filter is applied.
126                                                   121 
127 --time::                                          122 --time::
128         Analyze samples within given time wind    123         Analyze samples within given time window. It supports time
129         percent with multiple time ranges. Tim    124         percent with multiple time ranges. Time string is 'a%/n,b%/m,...'
130         or 'a%-b%,c%-%d,...'.                     125         or 'a%-b%,c%-%d,...'.
131                                                   126 
132         For example:                              127         For example:
133                                                   128 
134         Select the second 10% time slice to di    129         Select the second 10% time slice to diff:
135                                                   130 
136           perf diff --time 10%/2                  131           perf diff --time 10%/2
137                                                   132 
138         Select from 0% to 10% time slice to di    133         Select from 0% to 10% time slice to diff:
139                                                   134 
140           perf diff --time 0%-10%                 135           perf diff --time 0%-10%
141                                                   136 
142         Select the first and the second 10% ti    137         Select the first and the second 10% time slices to diff:
143                                                   138 
144           perf diff --time 10%/1,10%/2            139           perf diff --time 10%/1,10%/2
145                                                   140 
146         Select from 0% to 10% and 30% to 40% s    141         Select from 0% to 10% and 30% to 40% slices to diff:
147                                                   142 
148           perf diff --time 0%-10%,30%-40%         143           perf diff --time 0%-10%,30%-40%
149                                                   144 
150         It also supports analyzing samples wit    145         It also supports analyzing samples within a given time window
151         <start>,<stop>. Times have the format     146         <start>,<stop>. Times have the format seconds.nanoseconds. If 'start'
152         is not given (i.e. time string is ',x.    147         is not given (i.e. time string is ',x.y') then analysis starts at
153         the beginning of the file. If stop tim    148         the beginning of the file. If stop time is not given (i.e. time
154         string is 'x.y,') then analysis goes t    149         string is 'x.y,') then analysis goes to the end of the file.
155         Multiple ranges can be separated by sp    150         Multiple ranges can be separated by spaces, which requires the argument
156         to be quoted e.g. --time "1234.567,123    151         to be quoted e.g. --time "1234.567,1234.789 1235,"
157         Time string is'a1.b1,c1.d1:a2.b2,c2.d2    152         Time string is'a1.b1,c1.d1:a2.b2,c2.d2'. Use ':' to separate timestamps
158         for different perf.data files.            153         for different perf.data files.
159                                                   154 
160         For example, we get the timestamp info    155         For example, we get the timestamp information from 'perf script'.
161                                                   156 
162           perf script -i perf.data.old            157           perf script -i perf.data.old
163             mgen 13940 [000]  3946.361400: ...    158             mgen 13940 [000]  3946.361400: ...
164                                                   159 
165           perf script -i perf.data                160           perf script -i perf.data
166             mgen 13940 [000]  3971.150589 ...     161             mgen 13940 [000]  3971.150589 ...
167                                                   162 
168           perf diff --time 3946.361400,:3971.1    163           perf diff --time 3946.361400,:3971.150589,
169                                                   164 
170         It analyzes the perf.data.old from the    165         It analyzes the perf.data.old from the timestamp 3946.361400 to
171         the end of perf.data.old and analyzes     166         the end of perf.data.old and analyzes the perf.data from the
172         timestamp 3971.150589 to the end of pe    167         timestamp 3971.150589 to the end of perf.data.
173                                                   168 
174 --cpu:: Only diff samples for the list of CPUs    169 --cpu:: Only diff samples for the list of CPUs provided. Multiple CPUs can
175         be provided as a comma-separated list     170         be provided as a comma-separated list with no space: 0,1. Ranges of
176         CPUs are specified with -: 0-2. Defaul    171         CPUs are specified with -: 0-2. Default is to report samples on all
177         CPUs.                                     172         CPUs.
178                                                   173 
179 --pid=::                                          174 --pid=::
180         Only diff samples for given process ID    175         Only diff samples for given process ID (comma separated list).
181                                                   176 
182 --tid=::                                          177 --tid=::
183         Only diff samples for given thread ID     178         Only diff samples for given thread ID (comma separated list).
184                                                << 
185 --stream::                                     << 
186         Enable hot streams comparison. Stream  << 
187         aggregated by the branch records from  << 
188                                                   179 
189 COMPARISON                                        180 COMPARISON
190 ----------                                        181 ----------
191 The comparison is governed by the baseline fil    182 The comparison is governed by the baseline file. The baseline perf.data
192 file is iterated for samples. All other perf.d    183 file is iterated for samples. All other perf.data files specified on
193 the command line are searched for the baseline    184 the command line are searched for the baseline sample pair. If the pair
194 is found, specified computation is made and re    185 is found, specified computation is made and result is displayed.
195                                                   186 
196 All samples from non-baseline perf.data files,    187 All samples from non-baseline perf.data files, that do not match any
197 baseline entry, are displayed with empty space    188 baseline entry, are displayed with empty space within baseline column
198 and possible computation results (delta) in th    189 and possible computation results (delta) in their related column.
199                                                   190 
200 Example files samples:                            191 Example files samples:
201 - file A with samples f1, f2, f3, f4,    f6       192 - file A with samples f1, f2, f3, f4,    f6
202 - file B with samples     f2,     f4, f5          193 - file B with samples     f2,     f4, f5
203 - file C with samples f1, f2,         f5          194 - file C with samples f1, f2,         f5
204                                                   195 
205 Example output:                                   196 Example output:
206   x - computation takes place for pair            197   x - computation takes place for pair
207   b - baseline sample percentage                  198   b - baseline sample percentage
208                                                   199 
209 - perf diff A B C                                 200 - perf diff A B C
210                                                   201 
211   baseline/A compute/B compute/C  samples         202   baseline/A compute/B compute/C  samples
212   ---------------------------------------         203   ---------------------------------------
213   b                    x          f1              204   b                    x          f1
214   b          x         x          f2              205   b          x         x          f2
215   b                               f3              206   b                               f3
216   b          x                    f4              207   b          x                    f4
217   b                               f6              208   b                               f6
218              x         x          f5              209              x         x          f5
219                                                   210 
220 - perf diff B A C                                 211 - perf diff B A C
221                                                   212 
222   baseline/B compute/A compute/C  samples         213   baseline/B compute/A compute/C  samples
223   ---------------------------------------         214   ---------------------------------------
224   b          x         x          f2              215   b          x         x          f2
225   b          x                    f4              216   b          x                    f4
226   b                    x          f5              217   b                    x          f5
227              x         x          f1              218              x         x          f1
228              x                    f3              219              x                    f3
229              x                    f6              220              x                    f6
230                                                   221 
231 - perf diff C B A                                 222 - perf diff C B A
232                                                   223 
233   baseline/C compute/B compute/A  samples         224   baseline/C compute/B compute/A  samples
234   ---------------------------------------         225   ---------------------------------------
235   b                    x          f1              226   b                    x          f1
236   b          x         x          f2              227   b          x         x          f2
237   b          x                    f5              228   b          x                    f5
238                        x          f3              229                        x          f3
239              x         x          f4              230              x         x          f4
240                        x          f6              231                        x          f6
241                                                   232 
242 COMPARISON METHODS                                233 COMPARISON METHODS
243 ------------------                                234 ------------------
244 delta                                             235 delta
245 ~~~~~                                             236 ~~~~~
246 If specified the 'Delta' column is displayed w    237 If specified the 'Delta' column is displayed with value 'd' computed as:
247                                                   238 
248   d = A->period_percent - B->period_percent       239   d = A->period_percent - B->period_percent
249                                                   240 
250 with:                                             241 with:
251   - A/B being matching hist entry from data/ba    242   - A/B being matching hist entry from data/baseline file specified
252     (or perf.data/perf.data.old) respectively.    243     (or perf.data/perf.data.old) respectively.
253                                                   244 
254   - period_percent being the % of the hist ent    245   - period_percent being the % of the hist entry period value within
255     single data file                              246     single data file
256                                                   247 
257   - with filtering by -C, -d and/or -S, period    248   - with filtering by -C, -d and/or -S, period_percent might be changed
258     relative to how entries are filtered.  Use    249     relative to how entries are filtered.  Use --percentage=absolute to
259     prevent such fluctuation.                     250     prevent such fluctuation.
260                                                   251 
261 delta-abs                                         252 delta-abs
262 ~~~~~~~~~                                         253 ~~~~~~~~~
263 Same as 'delta` method, but sort the result wi    254 Same as 'delta` method, but sort the result with the absolute values.
264                                                   255 
265 ratio                                             256 ratio
266 ~~~~~                                             257 ~~~~~
267 If specified the 'Ratio' column is displayed w    258 If specified the 'Ratio' column is displayed with value 'r' computed as:
268                                                   259 
269   r = A->period / B->period                       260   r = A->period / B->period
270                                                   261 
271 with:                                             262 with:
272   - A/B being matching hist entry from data/ba    263   - A/B being matching hist entry from data/baseline file specified
273     (or perf.data/perf.data.old) respectively.    264     (or perf.data/perf.data.old) respectively.
274                                                   265 
275   - period being the hist entry period value      266   - period being the hist entry period value
276                                                   267 
277 wdiff:WEIGHT-B,WEIGHT-A                           268 wdiff:WEIGHT-B,WEIGHT-A
278 ~~~~~~~~~~~~~~~~~~~~~~~                           269 ~~~~~~~~~~~~~~~~~~~~~~~
279 If specified the 'Weighted diff' column is dis    270 If specified the 'Weighted diff' column is displayed with value 'd' computed as:
280                                                   271 
281    d = B->period * WEIGHT-A - A->period * WEIG    272    d = B->period * WEIGHT-A - A->period * WEIGHT-B
282                                                   273 
283   - A/B being matching hist entry from data/ba    274   - A/B being matching hist entry from data/baseline file specified
284     (or perf.data/perf.data.old) respectively.    275     (or perf.data/perf.data.old) respectively.
285                                                   276 
286   - period being the hist entry period value      277   - period being the hist entry period value
287                                                   278 
288   - WEIGHT-A/WEIGHT-B being user supplied weig    279   - WEIGHT-A/WEIGHT-B being user supplied weights in the the '-c' option
289     behind ':' separator like '-c wdiff:1,2'.     280     behind ':' separator like '-c wdiff:1,2'.
290     - WEIGHT-A being the weight of the data fi    281     - WEIGHT-A being the weight of the data file
291     - WEIGHT-B being the weight of the baselin    282     - WEIGHT-B being the weight of the baseline data file
292                                                   283 
293 cycles                                            284 cycles
294 ~~~~~~                                            285 ~~~~~~
295 If specified the '[Program Block Range] Cycles    286 If specified the '[Program Block Range] Cycles Diff' column is displayed.
296 It displays the cycles difference of same prog    287 It displays the cycles difference of same program basic block amongst
297 two perf.data. The program basic block is the     288 two perf.data. The program basic block is the code between two branches.
298                                                   289 
299 '[Program Block Range]' indicates the range of    290 '[Program Block Range]' indicates the range of a program basic block.
300 Source line is reported if it can be found oth    291 Source line is reported if it can be found otherwise uses symbol+offset
301 instead.                                          292 instead.
302                                                   293 
303 SEE ALSO                                          294 SEE ALSO
304 --------                                          295 --------
305 linkperf:perf-record[1], linkperf:perf-report[    296 linkperf:perf-record[1], linkperf:perf-report[1]
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php