]>
Commit | Line | Data |
---|---|---|
37554d48 SL |
1 | From c35afa09949a596a06aba156d67afe720444cdd4 Mon Sep 17 00:00:00 2001 |
2 | From: Stephane Eranian <eranian@google.com> | |
3 | Date: Mon, 13 May 2019 17:34:00 -0700 | |
4 | Subject: perf/x86/intel: Allow PEBS multi-entry in watermark mode | |
5 | ||
6 | [ Upstream commit c7a286577d7592720c2f179aadfb325a1ff48c95 ] | |
7 | ||
8 | This patch fixes a restriction/bug introduced by: | |
9 | ||
10 | 583feb08e7f7 ("perf/x86/intel: Fix handling of wakeup_events for multi-entry PEBS") | |
11 | ||
12 | The original patch prevented using multi-entry PEBS when wakeup_events != 0. | |
13 | However given that wakeup_events is part of a union with wakeup_watermark, it | |
14 | means that in watermark mode, PEBS multi-entry is also disabled which is not the | |
15 | intent. This patch fixes this by checking is watermark mode is enabled. | |
16 | ||
17 | Signed-off-by: Stephane Eranian <eranian@google.com> | |
18 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | |
19 | Cc: Peter Zijlstra <peterz@infradead.org> | |
20 | Cc: Thomas Gleixner <tglx@linutronix.de> | |
21 | Cc: jolsa@redhat.com | |
22 | Cc: kan.liang@intel.com | |
23 | Cc: vincent.weaver@maine.edu | |
24 | Fixes: 583feb08e7f7 ("perf/x86/intel: Fix handling of wakeup_events for multi-entry PEBS") | |
25 | Link: http://lkml.kernel.org/r/20190514003400.224340-1-eranian@google.com | |
26 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | |
27 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
28 | --- | |
29 | arch/x86/events/intel/core.c | 2 +- | |
30 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
31 | ||
32 | diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c | |
33 | index 09c53bcbd497..c8b0bf2b0d5e 100644 | |
34 | --- a/arch/x86/events/intel/core.c | |
35 | +++ b/arch/x86/events/intel/core.c | |
36 | @@ -3072,7 +3072,7 @@ static int intel_pmu_hw_config(struct perf_event *event) | |
37 | return ret; | |
38 | ||
39 | if (event->attr.precise_ip) { | |
40 | - if (!(event->attr.freq || event->attr.wakeup_events)) { | |
41 | + if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) { | |
42 | event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD; | |
43 | if (!(event->attr.sample_type & | |
44 | ~intel_pmu_large_pebs_flags(event))) | |
45 | -- | |
46 | 2.20.1 | |
47 |