perf intel-pt: Fix sample instruction bytes
[linux-2.6-microblaze.git] / tools / perf / util / intel-pt.c
index f6e28ac..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) {
@@ -3569,7 +3572,7 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
        /*
         * Since this thread will not be kept in any rbtree not in a
         * list, initialize its list node so that at thread__put() the
-        * current thread lifetime assuption is kept and we don't segfault
+        * current thread lifetime assumption is kept and we don't segfault
         * at list_del_init().
         */
        INIT_LIST_HEAD(&pt->unknown_thread->node);