From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: mingo@elte.hu, eranian@google.com
Cc: linux-kernel@vger.kernel.org, Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [PATCH 1/4] perf_events: x86: Fix event constraint masks
Date: Wed, 27 Jan 2010 23:07:46 +0100 [thread overview]
Message-ID: <20100127221121.967610372@chello.nl> (raw)
In-Reply-To: <20100127220745.027096123@chello.nl>
[-- Attachment #1: perf-fix-constraint-mask.patch --]
[-- Type: text/plain, Size: 1874 bytes --]
Since constraints are specified on the event number, not number and
unit mask shorten the constraint masks so that we'll actually match
something.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
---
arch/x86/include/asm/perf_event.h | 2 +-
arch/x86/kernel/cpu/perf_event.c | 13 +++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
Index: linux-2.6/arch/x86/kernel/cpu/perf_event.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/perf_event.c
+++ linux-2.6/arch/x86/kernel/cpu/perf_event.c
@@ -100,12 +100,17 @@ struct cpu_hw_events {
.weight = HWEIGHT64((u64)(n)), \
}
-#define INTEL_EVENT_CONSTRAINT(c, n) EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK)
-#define FIXED_EVENT_CONSTRAINT(c, n) EVENT_CONSTRAINT(c, n, INTEL_ARCH_FIXED_MASK)
+#define INTEL_EVENT_CONSTRAINT(c, n) \
+ EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVTSEL_MASK)
-#define EVENT_CONSTRAINT_END EVENT_CONSTRAINT(0, 0, 0)
+#define FIXED_EVENT_CONSTRAINT(c, n) \
+ EVENT_CONSTRAINT(c, n, INTEL_ARCH_FIXED_MASK)
-#define for_each_event_constraint(e, c) for ((e) = (c); (e)->cmask; (e)++)
+#define EVENT_CONSTRAINT_END \
+ EVENT_CONSTRAINT(0, 0, 0)
+
+#define for_each_event_constraint(e, c) \
+ for ((e) = (c); (e)->cmask; (e)++)
/*
* struct x86_pmu - generic x86 pmu
Index: linux-2.6/arch/x86/include/asm/perf_event.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/perf_event.h
+++ linux-2.6/arch/x86/include/asm/perf_event.h
@@ -50,7 +50,7 @@
INTEL_ARCH_INV_MASK| \
INTEL_ARCH_EDGE_MASK|\
INTEL_ARCH_UNIT_MASK|\
- INTEL_ARCH_EVENT_MASK)
+ INTEL_ARCH_EVTSEL_MASK)
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL 0x3c
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8)
--
next prev parent reply other threads:[~2010-01-27 22:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 22:07 [PATCH 0/4] perf x86 fixes Peter Zijlstra
2010-01-27 22:07 ` Peter Zijlstra [this message]
2010-01-29 9:29 ` [tip:perf/core] perf_events, x86: Fix event constraint masks tip-bot for Peter Zijlstra
2010-01-27 22:07 ` [PATCH 2/4] perf_events: x86: Clean up hw_perf_*_all() implementation Peter Zijlstra
2010-01-29 9:30 ` [tip:perf/core] perf_events, " tip-bot for Peter Zijlstra
2010-01-27 22:07 ` [PATCH 3/4] perf_events: x86: Implement westmere support Peter Zijlstra
2010-01-29 9:30 ` [tip:perf/core] perf_events, x86: Implement Intel Westmere support tip-bot for Peter Zijlstra
2010-01-27 22:07 ` [PATCH 4/4] perf_events: x86: Remove spurious counter reset from x86_pmu_enable() Peter Zijlstra
2010-01-29 9:30 ` [tip:perf/core] perf_events, " tip-bot for Peter Zijlstra
2010-01-29 7:55 ` [PATCH 0/4] perf x86 fixes Ingo Molnar
2010-01-29 8:04 ` [PATCH 5/4] perf_events: Fix sample_period transfer on inherit Peter Zijlstra
2010-01-29 9:30 ` [tip:perf/core] " tip-bot for Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100127221121.967610372@chello.nl \
--to=a.p.zijlstra@chello.nl \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome