Commit | Line | Data |
---|---|---|
86a9eee0 | 1 | perf-diff(1) |
4778e0e8 | 2 | ============ |
86a9eee0 ACM |
3 | |
4 | NAME | |
5 | ---- | |
3a3beae8 | 6 | perf-diff - Read perf.data files and display the differential profile |
86a9eee0 ACM |
7 | |
8 | SYNOPSIS | |
9 | -------- | |
10 | [verse] | |
3a3beae8 | 11 | 'perf diff' [baseline file] [data file1] [[data file2] ... ] |
86a9eee0 ACM |
12 | |
13 | DESCRIPTION | |
14 | ----------- | |
3a3beae8 JO |
15 | This command displays the performance difference amongst two or more perf.data |
16 | files captured via perf record. | |
86a9eee0 ACM |
17 | |
18 | If no parameters are passed it will assume perf.data.old and perf.data. | |
19 | ||
863e451f JO |
20 | The differential profile is displayed only for events matching both |
21 | specified perf.data files. | |
22 | ||
94ba462d KL |
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 | ||
86a9eee0 ACM |
28 | OPTIONS |
29 | ------- | |
5ea4f857 SB |
30 | -D:: |
31 | --dump-raw-trace:: | |
32 | Dump raw trace in ASCII. | |
33 | ||
34 | -m:: | |
35 | --modules:: | |
36 | Load module symbols. WARNING: use only with -k and LIVE kernel | |
37 | ||
c351c281 ACM |
38 | -d:: |
39 | --dsos=:: | |
40 | Only consider symbols in these dsos. CSV that understands | |
8810f6ce NK |
41 | file://filename entries. This option will affect the percentage |
42 | of the Baseline/Delta column. See --percentage for more info. | |
c351c281 ACM |
43 | |
44 | -C:: | |
45 | --comms=:: | |
46 | Only consider symbols in these comms. CSV that understands | |
8810f6ce NK |
47 | file://filename entries. This option will affect the percentage |
48 | of the Baseline/Delta column. See --percentage for more info. | |
c351c281 ACM |
49 | |
50 | -S:: | |
51 | --symbols=:: | |
52 | Only consider these symbols. CSV that understands | |
8810f6ce NK |
53 | file://filename entries. This option will affect the percentage |
54 | of the Baseline/Delta column. See --percentage for more info. | |
c351c281 ACM |
55 | |
56 | -s:: | |
57 | --sort=:: | |
a2ce067e NK |
58 | Sort by key(s): pid, comm, dso, symbol, cpu, parent, srcline. |
59 | Please see description of --sort in the perf-report man page. | |
c351c281 ACM |
60 | |
61 | -t:: | |
62 | --field-separator=:: | |
63 | ||
64 | Use a special separator character and don't pad with spaces, replacing | |
5ea4f857 | 65 | all occurrences of this separator in symbol names (and other output) |
c351c281 ACM |
66 | with a '.' character, that thus it's the only non valid separator. |
67 | ||
86a9eee0 ACM |
68 | -v:: |
69 | --verbose:: | |
d30531c6 | 70 | Be verbose, for instance, show the raw counts in addition to the |
86a9eee0 | 71 | diff. |
cdccc690 | 72 | |
5ea4f857 SB |
73 | -f:: |
74 | --force:: | |
75 | Don't complain, do it. | |
76 | ||
ec5761ea DA |
77 | --symfs=<directory>:: |
78 | Look for files with symbols relative to this directory. | |
5ea4f857 | 79 | |
a06d143e JO |
80 | -b:: |
81 | --baseline-only:: | |
82 | Show only items with match in baseline. | |
83 | ||
7aaf6b35 JO |
84 | -c:: |
85 | --compute:: | |
81d5f958 | 86 | Differential computation selection - delta,ratio,wdiff (default is delta). |
7aaf6b35 JO |
87 | See COMPARISON METHODS section for more info. |
88 | ||
61949b21 JO |
89 | -p:: |
90 | --period:: | |
91 | Show period values for both compared hist entries. | |
92 | ||
ed279da2 JO |
93 | -F:: |
94 | --formula:: | |
95 | Show formula for given computation. | |
96 | ||
5f3f8d3b JO |
97 | -o:: |
98 | --order:: | |
99 | Specify compute sorting column number. | |
100 | ||
8810f6ce NK |
101 | --percentage:: |
102 | Determine how to display the overhead percentage of filtered entries. | |
103 | Filters can be applied by --comms, --dsos and/or --symbols options. | |
104 | ||
105 | "relative" means it's relative to filtered entries only so that the | |
106 | sum of shown entries will be always 100%. "absolute" means it retains | |
107 | the original value before and after the filter is applied. | |
108 | ||
3a3beae8 JO |
109 | COMPARISON |
110 | ---------- | |
111 | The comparison is governed by the baseline file. The baseline perf.data | |
112 | file is iterated for samples. All other perf.data files specified on | |
113 | the command line are searched for the baseline sample pair. If the pair | |
114 | is found, specified computation is made and result is displayed. | |
115 | ||
116 | All samples from non-baseline perf.data files, that do not match any | |
117 | baseline entry, are displayed with empty space within baseline column | |
118 | and possible computation results (delta) in their related column. | |
119 | ||
120 | Example files samples: | |
121 | - file A with samples f1, f2, f3, f4, f6 | |
122 | - file B with samples f2, f4, f5 | |
123 | - file C with samples f1, f2, f5 | |
124 | ||
125 | Example output: | |
126 | x - computation takes place for pair | |
127 | b - baseline sample percentage | |
128 | ||
129 | - perf diff A B C | |
130 | ||
131 | baseline/A compute/B compute/C samples | |
132 | --------------------------------------- | |
133 | b x f1 | |
134 | b x x f2 | |
135 | b f3 | |
136 | b x f4 | |
137 | b f6 | |
138 | x x f5 | |
139 | ||
140 | - perf diff B A C | |
141 | ||
142 | baseline/B compute/A compute/C samples | |
143 | --------------------------------------- | |
144 | b x x f2 | |
145 | b x f4 | |
146 | b x f5 | |
147 | x x f1 | |
148 | x f3 | |
149 | x f6 | |
150 | ||
151 | - perf diff C B A | |
152 | ||
153 | baseline/C compute/B compute/A samples | |
154 | --------------------------------------- | |
155 | b x f1 | |
156 | b x x f2 | |
157 | b x f5 | |
158 | x f3 | |
159 | x x f4 | |
160 | x f6 | |
161 | ||
7aaf6b35 JO |
162 | COMPARISON METHODS |
163 | ------------------ | |
164 | delta | |
165 | ~~~~~ | |
166 | If specified the 'Delta' column is displayed with value 'd' computed as: | |
167 | ||
168 | d = A->period_percent - B->period_percent | |
169 | ||
170 | with: | |
3a3beae8 | 171 | - A/B being matching hist entry from data/baseline file specified |
7aaf6b35 JO |
172 | (or perf.data/perf.data.old) respectively. |
173 | ||
174 | - period_percent being the % of the hist entry period value within | |
175 | single data file | |
176 | ||
8810f6ce NK |
177 | - with filtering by -C, -d and/or -S, period_percent might be changed |
178 | relative to how entries are filtered. Use --percentage=absolute to | |
179 | prevent such fluctuation. | |
180 | ||
7aaf6b35 JO |
181 | ratio |
182 | ~~~~~ | |
183 | If specified the 'Ratio' column is displayed with value 'r' computed as: | |
184 | ||
185 | r = A->period / B->period | |
186 | ||
187 | with: | |
3a3beae8 | 188 | - A/B being matching hist entry from data/baseline file specified |
7aaf6b35 JO |
189 | (or perf.data/perf.data.old) respectively. |
190 | ||
191 | - period being the hist entry period value | |
192 | ||
3a3beae8 JO |
193 | wdiff:WEIGHT-B,WEIGHT-A |
194 | ~~~~~~~~~~~~~~~~~~~~~~~ | |
81d5f958 JO |
195 | If specified the 'Weighted diff' column is displayed with value 'd' computed as: |
196 | ||
197 | d = B->period * WEIGHT-A - A->period * WEIGHT-B | |
198 | ||
3a3beae8 | 199 | - A/B being matching hist entry from data/baseline file specified |
81d5f958 JO |
200 | (or perf.data/perf.data.old) respectively. |
201 | ||
202 | - period being the hist entry period value | |
203 | ||
96355f2c | 204 | - WEIGHT-A/WEIGHT-B being user supplied weights in the the '-c' option |
81d5f958 | 205 | behind ':' separator like '-c wdiff:1,2'. |
96355f2c MI |
206 | - WEIGHT-A being the weight of the data file |
207 | - WEIGHT-B being the weight of the baseline data file | |
7aaf6b35 | 208 | |
86a9eee0 ACM |
209 | SEE ALSO |
210 | -------- | |
a2ce067e | 211 | linkperf:perf-record[1], linkperf:perf-report[1] |