perf intel-pt: Fix sample instruction bytes
[linux-2.6-microblaze.git] / tools / perf / util / intel-pt.c
index 8658d42..beae5cb 100644 (file)
@@ -707,8 +707,10 @@ static int intel_pt_walk_next_insn(struct intel_pt_insn *intel_pt_insn,
 
                        *ip += intel_pt_insn->length;
 
-                       if (to_ip && *ip == to_ip)
+                       if (to_ip && *ip == to_ip) {
+                               intel_pt_insn->length = 0;
                                goto out_no_cache;
+                       }
 
                        if (*ip >= al.map->end)
                                break;
@@ -1198,6 +1200,7 @@ static void intel_pt_set_pid_tid_cpu(struct intel_pt *pt,
 
 static void intel_pt_sample_flags(struct intel_pt_queue *ptq)
 {
+       ptq->insn_len = 0;
        if (ptq->state->flags & INTEL_PT_ABORT_TX) {
                ptq->flags = PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_TX_ABORT;
        } else if (ptq->state->flags & INTEL_PT_ASYNC) {