aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/intel-pt-decoder/intel-pt-decoder.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
index 26dbf11e071a..9cbd587489bf 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
@@ -58,6 +58,7 @@ enum intel_pt_pkt_state {
58 INTEL_PT_STATE_NO_IP, 58 INTEL_PT_STATE_NO_IP,
59 INTEL_PT_STATE_ERR_RESYNC, 59 INTEL_PT_STATE_ERR_RESYNC,
60 INTEL_PT_STATE_IN_SYNC, 60 INTEL_PT_STATE_IN_SYNC,
61 INTEL_PT_STATE_TNT_CONT,
61 INTEL_PT_STATE_TNT, 62 INTEL_PT_STATE_TNT,
62 INTEL_PT_STATE_TIP, 63 INTEL_PT_STATE_TIP,
63 INTEL_PT_STATE_TIP_PGD, 64 INTEL_PT_STATE_TIP_PGD,
@@ -72,8 +73,9 @@ static inline bool intel_pt_sample_time(enum intel_pt_pkt_state pkt_state)
72 case INTEL_PT_STATE_NO_IP: 73 case INTEL_PT_STATE_NO_IP:
73 case INTEL_PT_STATE_ERR_RESYNC: 74 case INTEL_PT_STATE_ERR_RESYNC:
74 case INTEL_PT_STATE_IN_SYNC: 75 case INTEL_PT_STATE_IN_SYNC:
75 case INTEL_PT_STATE_TNT: 76 case INTEL_PT_STATE_TNT_CONT:
76 return true; 77 return true;
78 case INTEL_PT_STATE_TNT:
77 case INTEL_PT_STATE_TIP: 79 case INTEL_PT_STATE_TIP:
78 case INTEL_PT_STATE_TIP_PGD: 80 case INTEL_PT_STATE_TIP_PGD:
79 case INTEL_PT_STATE_FUP: 81 case INTEL_PT_STATE_FUP:
@@ -1261,7 +1263,9 @@ static int intel_pt_walk_tnt(struct intel_pt_decoder *decoder)
1261 return -ENOENT; 1263 return -ENOENT;
1262 } 1264 }
1263 decoder->tnt.count -= 1; 1265 decoder->tnt.count -= 1;
1264 if (!decoder->tnt.count) 1266 if (decoder->tnt.count)
1267 decoder->pkt_state = INTEL_PT_STATE_TNT_CONT;
1268 else
1265 decoder->pkt_state = INTEL_PT_STATE_IN_SYNC; 1269 decoder->pkt_state = INTEL_PT_STATE_IN_SYNC;
1266 decoder->tnt.payload <<= 1; 1270 decoder->tnt.payload <<= 1;
1267 decoder->state.from_ip = decoder->ip; 1271 decoder->state.from_ip = decoder->ip;
@@ -1292,7 +1296,9 @@ static int intel_pt_walk_tnt(struct intel_pt_decoder *decoder)
1292 1296
1293 if (intel_pt_insn.branch == INTEL_PT_BR_CONDITIONAL) { 1297 if (intel_pt_insn.branch == INTEL_PT_BR_CONDITIONAL) {
1294 decoder->tnt.count -= 1; 1298 decoder->tnt.count -= 1;
1295 if (!decoder->tnt.count) 1299 if (decoder->tnt.count)
1300 decoder->pkt_state = INTEL_PT_STATE_TNT_CONT;
1301 else
1296 decoder->pkt_state = INTEL_PT_STATE_IN_SYNC; 1302 decoder->pkt_state = INTEL_PT_STATE_IN_SYNC;
1297 if (decoder->tnt.payload & BIT63) { 1303 if (decoder->tnt.payload & BIT63) {
1298 decoder->tnt.payload <<= 1; 1304 decoder->tnt.payload <<= 1;
@@ -2372,6 +2378,7 @@ const struct intel_pt_state *intel_pt_decode(struct intel_pt_decoder *decoder)
2372 err = intel_pt_walk_trace(decoder); 2378 err = intel_pt_walk_trace(decoder);
2373 break; 2379 break;
2374 case INTEL_PT_STATE_TNT: 2380 case INTEL_PT_STATE_TNT:
2381 case INTEL_PT_STATE_TNT_CONT:
2375 err = intel_pt_walk_tnt(decoder); 2382 err = intel_pt_walk_tnt(decoder);
2376 if (err == -EAGAIN) 2383 if (err == -EAGAIN)
2377 err = intel_pt_walk_trace(decoder); 2384 err = intel_pt_walk_trace(decoder);