lkml.org 
[lkml]   [2017]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 01/12] perf, tools, pt: Clear instruction for ptwrite samples
Date
From: Andi Kleen <ak@linux.intel.com>

When a PTWRITE sample is synthesized the PT decoder already
ran ahead and sample->insn contains the next branch instruction,
not the PTWRITE.

Clear it for PTWRITE samples to avoid confusion.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/util/intel-pt.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 23f9ba676df0..485c8040484e 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -1262,6 +1262,12 @@ static void intel_pt_prep_p_sample(struct intel_pt *pt,
*/
if (!sample->ip)
sample->flags = 0;
+
+ /*
+ * Don't have valid instructions because decoder already ran ahead.
+ */
+ sample->insn_len = 0;
+ memset(sample->insn, 0, INTEL_PT_INSN_BUF_SZ);
}

static int intel_pt_synth_ptwrite_sample(struct intel_pt_queue *ptq)
--
2.13.6
\
 
 \ /
  Last update: 2017-11-28 01:23    [W:0.157 / U:5.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site