Patch "perf intel-pt: Fix corrupt data after perf inject from" has been added to the 5.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf intel-pt: Fix corrupt data after perf inject from

to the 5.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-intel-pt-fix-corrupt-data-after-perf-inject-fro.patch
and it can be found in the queue-5.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f8157dab92eca0d1cfeed08065ed2afa8890ac4c
Author: Al Grant <al.grant@xxxxxxx>
Date:   Wed Aug 19 16:47:51 2020 +0800

    perf intel-pt: Fix corrupt data after perf inject from
    
    [ Upstream commit a347306fbec5dcaf7c276777b11d530eab6a4526 ]
    
    Commit 42bbabed09ce6208 ("perf tools: Add hw_idx in struct branch_stack")
    changed the format of branch stacks in perf samples. When samples use
    this new format, a flag must be set in the corresponding event.
    
    Synthesized branch stacks generated from Intel PT were using the new
    format, but not setting the event attribute, leading to consumers
    seeing corrupt data. This patch fixes the issue by setting the event
    attribute to indicate use of the new format.
    
    Fixes: 42bbabed09ce6208 ("perf tools: Add hw_idx in struct branch_stack")
    Signed-off-by: Al Grant <al.grant@xxxxxxx>
    Acked-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
    Reviewed-by: Mathieu Poirier <mathieu.poirier@xxxxxxxxxx>
    Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
    Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
    Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
    Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
    Cc: Leo Yan <leo.yan@xxxxxxxxxx>
    Cc: Mark Rutland <mark.rutland@xxxxxxx>
    Cc: Mike Leach <mike.leach@xxxxxxxxxx>
    Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
    Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
    Cc: Suzuki Poulouse <suzuki.poulose@xxxxxxx>
    Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
    Link: http://lore.kernel.org/lkml/20200819084751.17686-2-leo.yan@xxxxxxxxxx
    Signed-off-by: Leo Yan <leo.yan@xxxxxxxxxx>
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index cb3c1e569a2db..9357b5f62c273 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -2913,8 +2913,15 @@ static int intel_pt_synth_events(struct intel_pt *pt,
 
 	if (pt->synth_opts.callchain)
 		attr.sample_type |= PERF_SAMPLE_CALLCHAIN;
-	if (pt->synth_opts.last_branch)
+	if (pt->synth_opts.last_branch) {
 		attr.sample_type |= PERF_SAMPLE_BRANCH_STACK;
+		/*
+		 * We don't use the hardware index, but the sample generation
+		 * code uses the new format branch_stack with this field,
+		 * so the event attributes must indicate that it's present.
+		 */
+		attr.branch_sample_type |= PERF_SAMPLE_BRANCH_HW_INDEX;
+	}
 
 	if (pt->synth_opts.instructions) {
 		attr.config = PERF_COUNT_HW_INSTRUCTIONS;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux