Commit 7b4b4f8
perf intel-pt: Accumulate cycle count from CYC packets
In preparation for providing instructions-per-cycle (IPC) information,
accumulate cycle count from CYC packets.
Although CYC packets are optional (requires config term 'cyc' to enable
cycle-accurate mode when recording), the simplest way to count cycles is
with CYC packets.
The first complication is that cycles must be counted only when also
counting instructions.
That means when control flow packet generation is enabled i.e. between
TIP.PGE and TIP.PGD packets.
Also, sampling the cycle count follows the same rules as sampling the
timestamp, that is, not before the instruction to which the decoder is
walking is reached.
In addition, the cycle count is not accurate for any but the first
branch of a TNT packet.
Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>1 parent 948e9dc commit 7b4b4f8
File tree
2 files changed
+14
-1
lines changed- tools/perf/util/intel-pt-decoder
2 files changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| 172 | + | |
170 | 173 | | |
171 | 174 | | |
172 | 175 | | |
| |||
1323 | 1326 | | |
1324 | 1327 | | |
1325 | 1328 | | |
| 1329 | + | |
1326 | 1330 | | |
1327 | 1331 | | |
1328 | 1332 | | |
| |||
1515 | 1519 | | |
1516 | 1520 | | |
1517 | 1521 | | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
1518 | 1525 | | |
1519 | 1526 | | |
1520 | 1527 | | |
| |||
2419 | 2426 | | |
2420 | 2427 | | |
2421 | 2428 | | |
| 2429 | + | |
2422 | 2430 | | |
2423 | 2431 | | |
2424 | 2432 | | |
2425 | 2433 | | |
2426 | 2434 | | |
2427 | 2435 | | |
2428 | 2436 | | |
2429 | | - | |
| 2437 | + | |
2430 | 2438 | | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
2431 | 2442 | | |
2432 | 2443 | | |
2433 | 2444 | | |
2434 | 2445 | | |
2435 | 2446 | | |
2436 | 2447 | | |
| 2448 | + | |
2437 | 2449 | | |
2438 | 2450 | | |
2439 | 2451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
0 commit comments