blob: b3b8abae62b8d523134490c9f6d01396a78c3cfd [file] [log] [blame]
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -02001perf-diff(1)
Arnaldo Carvalho de Melo4778e0e2010-05-05 11:23:27 -03002============
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -02003
4NAME
5----
Jiri Olsa3a3beae2012-10-24 14:56:51 +02006perf-diff - Read perf.data files and display the differential profile
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -02007
8SYNOPSIS
9--------
10[verse]
Jiri Olsa3a3beae2012-10-24 14:56:51 +020011'perf diff' [baseline file] [data file1] [[data file2] ... ]
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020012
13DESCRIPTION
14-----------
Jiri Olsa3a3beae2012-10-24 14:56:51 +020015This command displays the performance difference amongst two or more perf.data
16files captured via perf record.
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020017
18If no parameters are passed it will assume perf.data.old and perf.data.
19
Jiri Olsa863e4512012-09-06 17:46:55 +020020The differential profile is displayed only for events matching both
21specified perf.data files.
22
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020023OPTIONS
24-------
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060025-D::
26--dump-raw-trace::
27 Dump raw trace in ASCII.
28
29-m::
30--modules::
31 Load module symbols. WARNING: use only with -k and LIVE kernel
32
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020033-d::
34--dsos=::
35 Only consider symbols in these dsos. CSV that understands
Namhyung Kim8810f6c2014-02-07 12:06:07 +090036 file://filename entries. This option will affect the percentage
37 of the Baseline/Delta column. See --percentage for more info.
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020038
39-C::
40--comms=::
41 Only consider symbols in these comms. CSV that understands
Namhyung Kim8810f6c2014-02-07 12:06:07 +090042 file://filename entries. This option will affect the percentage
43 of the Baseline/Delta column. See --percentage for more info.
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020044
45-S::
46--symbols=::
47 Only consider these symbols. CSV that understands
Namhyung Kim8810f6c2014-02-07 12:06:07 +090048 file://filename entries. This option will affect the percentage
49 of the Baseline/Delta column. See --percentage for more info.
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020050
51-s::
52--sort=::
Namhyung Kima2ce0672014-03-04 09:06:42 +090053 Sort by key(s): pid, comm, dso, symbol, cpu, parent, srcline.
54 Please see description of --sort in the perf-report man page.
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020055
56-t::
57--field-separator=::
58
59 Use a special separator character and don't pad with spaces, replacing
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060060 all occurrences of this separator in symbol names (and other output)
Arnaldo Carvalho de Meloc351c282009-12-16 13:49:27 -020061 with a '.' character, that thus it's the only non valid separator.
62
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020063-v::
64--verbose::
Ingo Molnard30531c2009-12-15 10:24:08 +010065 Be verbose, for instance, show the raw counts in addition to the
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -020066 diff.
Arnaldo Carvalho de Melocdccc692009-12-15 11:01:22 -020067
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060068-f::
69--force::
70 Don't complain, do it.
71
David Ahernec5761e2010-12-09 13:27:07 -070072--symfs=<directory>::
73 Look for files with symbols relative to this directory.
Shawn Bohrer5ea4f852010-11-30 19:57:12 -060074
Jiri Olsaa06d1432012-10-05 16:44:40 +020075-b::
76--baseline-only::
77 Show only items with match in baseline.
78
Jiri Olsa7aaf6b32012-10-05 16:44:41 +020079-c::
80--compute::
Jiri Olsa81d5f952012-10-05 16:44:43 +020081 Differential computation selection - delta,ratio,wdiff (default is delta).
Jiri Olsa7aaf6b32012-10-05 16:44:41 +020082 See COMPARISON METHODS section for more info.
83
Jiri Olsa61949b22012-10-05 16:44:44 +020084-p::
85--period::
86 Show period values for both compared hist entries.
87
Jiri Olsaed279da2012-10-05 16:44:45 +020088-F::
89--formula::
90 Show formula for given computation.
91
Jiri Olsa5f3f8d32012-11-25 23:10:20 +010092-o::
93--order::
94 Specify compute sorting column number.
95
Namhyung Kim8810f6c2014-02-07 12:06:07 +090096--percentage::
97 Determine how to display the overhead percentage of filtered entries.
98 Filters can be applied by --comms, --dsos and/or --symbols options.
99
100 "relative" means it's relative to filtered entries only so that the
101 sum of shown entries will be always 100%. "absolute" means it retains
102 the original value before and after the filter is applied.
103
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200104COMPARISON
105----------
106The comparison is governed by the baseline file. The baseline perf.data
107file is iterated for samples. All other perf.data files specified on
108the command line are searched for the baseline sample pair. If the pair
109is found, specified computation is made and result is displayed.
110
111All samples from non-baseline perf.data files, that do not match any
112baseline entry, are displayed with empty space within baseline column
113and possible computation results (delta) in their related column.
114
115Example files samples:
116- file A with samples f1, f2, f3, f4, f6
117- file B with samples f2, f4, f5
118- file C with samples f1, f2, f5
119
120Example output:
121 x - computation takes place for pair
122 b - baseline sample percentage
123
124- perf diff A B C
125
126 baseline/A compute/B compute/C samples
127 ---------------------------------------
128 b x f1
129 b x x f2
130 b f3
131 b x f4
132 b f6
133 x x f5
134
135- perf diff B A C
136
137 baseline/B compute/A compute/C samples
138 ---------------------------------------
139 b x x f2
140 b x f4
141 b x f5
142 x x f1
143 x f3
144 x f6
145
146- perf diff C B A
147
148 baseline/C compute/B compute/A samples
149 ---------------------------------------
150 b x f1
151 b x x f2
152 b x f5
153 x f3
154 x x f4
155 x f6
156
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200157COMPARISON METHODS
158------------------
159delta
160~~~~~
161If specified the 'Delta' column is displayed with value 'd' computed as:
162
163 d = A->period_percent - B->period_percent
164
165with:
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200166 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200167 (or perf.data/perf.data.old) respectively.
168
169 - period_percent being the % of the hist entry period value within
170 single data file
171
Namhyung Kim8810f6c2014-02-07 12:06:07 +0900172 - with filtering by -C, -d and/or -S, period_percent might be changed
173 relative to how entries are filtered. Use --percentage=absolute to
174 prevent such fluctuation.
175
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200176ratio
177~~~~~
178If specified the 'Ratio' column is displayed with value 'r' computed as:
179
180 r = A->period / B->period
181
182with:
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200183 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200184 (or perf.data/perf.data.old) respectively.
185
186 - period being the hist entry period value
187
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200188wdiff:WEIGHT-B,WEIGHT-A
189~~~~~~~~~~~~~~~~~~~~~~~
Jiri Olsa81d5f952012-10-05 16:44:43 +0200190If specified the 'Weighted diff' column is displayed with value 'd' computed as:
191
192 d = B->period * WEIGHT-A - A->period * WEIGHT-B
193
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200194 - A/B being matching hist entry from data/baseline file specified
Jiri Olsa81d5f952012-10-05 16:44:43 +0200195 (or perf.data/perf.data.old) respectively.
196
197 - period being the hist entry period value
198
199 - WEIGHT-A/WEIGHT-B being user suplied weights in the the '-c' option
200 behind ':' separator like '-c wdiff:1,2'.
Jiri Olsa3a3beae2012-10-24 14:56:51 +0200201 - WIEGHT-A being the weight of the data file
202 - WIEGHT-B being the weight of the baseline data file
Jiri Olsa7aaf6b32012-10-05 16:44:41 +0200203
Arnaldo Carvalho de Melo86a9eee2009-12-14 20:09:31 -0200204SEE ALSO
205--------
Namhyung Kima2ce0672014-03-04 09:06:42 +0900206linkperf:perf-record[1], linkperf:perf-report[1]