Skip to contentSkip to conversation

Patch "perf intel-pt: Fix occasional decoding errors when tracing system-wide" has been added to the 4.7-stable tree

PATCH [email protected] 1 participant 1 message Aug 30, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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

perf intel-pt: Fix occasional decoding errors when tracing system-wide

to the 4.7-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-occasional-decoding-errors-when-tracing-system-wide.patch
and it can be found in the queue-4.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 3d918fb13abdbeca7947578f5d7e426eafad7f5e Mon Sep 17 00:00:00 2001

From: Adrian Hunter <[email protected]>
Date: Mon, 15 Aug 2016 10:23:04 +0300
Subject: perf intel-pt: Fix occasional decoding errors when tracing system-wide

From: Adrian Hunter <[email protected]>

commit 3d918fb13abdbeca7947578f5d7e426eafad7f5e upstream.

In order to successfully decode Intel PT traces, context switch events are needed from the moment the trace starts. Currently that is ensured by using the 'immediate' flag which enables the switch event when it is opened.

However, since commit 86c2786994bd ("perf intel-pt: Add support for PERF_RECORD_SWITCH") that might not always happen. When tracing system-wide the context switch event is added to the tracking event which was not set as 'immediate'. Change that so it is.

Cc Jiri Olsa <[email protected]>
Fixes 86c2786994bd ("perf intel-pt: Add support for PERF_RECORD_SWITCH")
---
 tools/perf/arch/x86/util/intel-pt.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/perf/arch/x86/util/intel-pt.c +5 -1
@@ -501,7 +501,7 @@ static int intel_pt_recording_options(st
 	struct intel_pt_recording *ptr =
 			container_of(itr, struct intel_pt_recording, itr);
 	struct perf_pmu *intel_pt_pmu = ptr->intel_pt_pmu;
-	bool have_timing_info;
+	bool have_timing_info, need_immediate = false;
 	struct perf_evsel *evsel, *intel_pt_evsel = NULL;
 	const struct cpu_map *cpus = evlist->cpus;
 	bool privileged = geteuid() == 0 || perf_event_paranoid() < 0;
@@ -655,6 +655,7 @@ static int intel_pt_recording_options(st
 				ptr->have_sched_switch = 3;
 			} else {
 				opts->record_switch_events = true;
+				need_immediate = true;
 				if (cpu_wide)
 					ptr->have_sched_switch = 3;
 				else
@@ -700,6 +701,9 @@ static int intel_pt_recording_options(st
 		tracking_evsel->attr.freq = 0;
 		tracking_evsel->attr.sample_period = 1;
 
+		if (need_immediate)
+			tracking_evsel->immediate = true;
+
 		/* In per-cpu case, always need the time of mmap events etc */
 		if (!cpu_map__empty(cpus)) {
 			perf_evsel__set_sample_bit(tracking_evsel, TIME);

Patches currently in stable-queue which might be from [email protected] are

queue-4.7/perf-intel-pt-fix-occasional-decoding-errors-when-tracing-system-wide.patch