|
|
@@ -58,6 +58,7 @@ enum intel_pt_pkt_state {
|
|
|
INTEL_PT_STATE_NO_IP,
|
|
|
INTEL_PT_STATE_ERR_RESYNC,
|
|
|
INTEL_PT_STATE_IN_SYNC,
|
|
|
+ INTEL_PT_STATE_TNT_CONT,
|
|
|
INTEL_PT_STATE_TNT,
|
|
|
INTEL_PT_STATE_TIP,
|
|
|
INTEL_PT_STATE_TIP_PGD,
|
|
|
@@ -72,8 +73,9 @@ static inline bool intel_pt_sample_time(enum intel_pt_pkt_state pkt_state)
|
|
|
case INTEL_PT_STATE_NO_IP:
|
|
|
case INTEL_PT_STATE_ERR_RESYNC:
|
|
|
case INTEL_PT_STATE_IN_SYNC:
|
|
|
- case INTEL_PT_STATE_TNT:
|
|
|
+ case INTEL_PT_STATE_TNT_CONT:
|
|
|
return true;
|
|
|
+ case INTEL_PT_STATE_TNT:
|
|
|
case INTEL_PT_STATE_TIP:
|
|
|
case INTEL_PT_STATE_TIP_PGD:
|
|
|
case INTEL_PT_STATE_FUP:
|
|
|
@@ -1256,7 +1258,9 @@ static int intel_pt_walk_tnt(struct intel_pt_decoder *decoder)
|
|
|
return -ENOENT;
|
|
|
}
|
|
|
decoder->tnt.count -= 1;
|
|
|
- if (!decoder->tnt.count)
|
|
|
+ if (decoder->tnt.count)
|
|
|
+ decoder->pkt_state = INTEL_PT_STATE_TNT_CONT;
|
|
|
+ else
|
|
|
decoder->pkt_state = INTEL_PT_STATE_IN_SYNC;
|
|
|
decoder->tnt.payload <<= 1;
|
|
|
decoder->state.from_ip = decoder->ip;
|
|
|
@@ -1287,7 +1291,9 @@ static int intel_pt_walk_tnt(struct intel_pt_decoder *decoder)
|
|
|
|
|
|
if (intel_pt_insn.branch == INTEL_PT_BR_CONDITIONAL) {
|
|
|
decoder->tnt.count -= 1;
|
|
|
- if (!decoder->tnt.count)
|
|
|
+ if (decoder->tnt.count)
|
|
|
+ decoder->pkt_state = INTEL_PT_STATE_TNT_CONT;
|
|
|
+ else
|
|
|
decoder->pkt_state = INTEL_PT_STATE_IN_SYNC;
|
|
|
if (decoder->tnt.payload & BIT63) {
|
|
|
decoder->tnt.payload <<= 1;
|
|
|
@@ -2356,6 +2362,7 @@ const struct intel_pt_state *intel_pt_decode(struct intel_pt_decoder *decoder)
|
|
|
err = intel_pt_walk_trace(decoder);
|
|
|
break;
|
|
|
case INTEL_PT_STATE_TNT:
|
|
|
+ case INTEL_PT_STATE_TNT_CONT:
|
|
|
err = intel_pt_walk_tnt(decoder);
|
|
|
if (err == -EAGAIN)
|
|
|
err = intel_pt_walk_trace(decoder);
|