From: tip-bot for Peter Zijlstra <a.p.zijlstra@chello.nl>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, eranian@google.com, hpa@zytor.com,
mingo@redhat.com, a.p.zijlstra@chello.nl, tglx@linutronix.de,
mingo@elte.hu
Subject: [tip:perf/core] perf_events, x86: Fix event constraint masks
Date: Fri, 29 Jan 2010 09:29:53 GMT [thread overview]
Message-ID: <tip-ed8777fc132e589d48a0ba854fdbb5d8203b58e5@git.kernel.org> (raw)
In-Reply-To: <20100127221121.967610372@chello.nl>
Commit-ID: ed8777fc132e589d48a0ba854fdbb5d8203b58e5
Gitweb: http://git.kernel.org/tip/ed8777fc132e589d48a0ba854fdbb5d8203b58e5
Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Wed, 27 Jan 2010 23:07:46 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 29 Jan 2010 09:01:46 +0100
perf_events, x86: Fix event constraint masks
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>
LKML-Reference: <20100127221121.967610372@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/perf_event.h | 2 +-
arch/x86/kernel/cpu/perf_event.c | 13 +++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h
index dbc0826..ff5ede1 100644
--- a/arch/x86/include/asm/perf_event.h
+++ b/arch/x86/include/asm/perf_event.h
@@ -49,7 +49,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)
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 07fa0c2..951213a 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/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
next prev parent reply other threads:[~2010-01-29 9:30 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 ` [PATCH 1/4] perf_events: x86: Fix event constraint masks Peter Zijlstra
2010-01-29 9:29 ` tip-bot for Peter Zijlstra [this message]
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=tip-ed8777fc132e589d48a0ba854fdbb5d8203b58e5@git.kernel.org \
--to=a.p.zijlstra@chello.nl \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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