diff options
author | Lin Ming <ming.m.lin@intel.com> | 2010-03-18 06:33:07 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-18 12:03:51 -0400 |
commit | f34edbc1cdb0f8f83d94e1d668dd6e41abf0defb (patch) | |
tree | d57803bcc891a748551429d2feafec2df8007367 /arch/x86/include/asm/perf_event_p4.h | |
parent | 55632770d7298835645489828af87f854c47749c (diff) |
perf, x86: Add a key to simplify template lookup in Pentium-4 PMU
Currently, we use opcode(Event and Event-Selector) + emask to
look up template in p4_templates.
But cache events (L1-dcache-load-misses, LLC-load-misses, etc)
use the same event(P4_REPLAY_EVENT) to do the counting, ie, they
have the same opcode and emask. So we can not use current lookup
mechanism to find the template for cache events.
This patch introduces a "key", which is the index into
p4_templates. The low 12 bits of CCCR are reserved, so we can
hide the "key" in the low 12 bits of hwc->config.
We extract the key from hwc->config and then quickly find the
template.
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <1268908387.13901.127.camel@minggr.sh.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/perf_event_p4.h')
-rw-r--r-- | arch/x86/include/asm/perf_event_p4.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/include/asm/perf_event_p4.h b/arch/x86/include/asm/perf_event_p4.h index b842b3238e46..7d3406a2773c 100644 --- a/arch/x86/include/asm/perf_event_p4.h +++ b/arch/x86/include/asm/perf_event_p4.h | |||
@@ -65,6 +65,7 @@ | |||
65 | #define P4_CCCR_THREAD_SINGLE 0x00010000U | 65 | #define P4_CCCR_THREAD_SINGLE 0x00010000U |
66 | #define P4_CCCR_THREAD_BOTH 0x00020000U | 66 | #define P4_CCCR_THREAD_BOTH 0x00020000U |
67 | #define P4_CCCR_THREAD_ANY 0x00030000U | 67 | #define P4_CCCR_THREAD_ANY 0x00030000U |
68 | #define P4_CCCR_RESERVED 0x00000fffU | ||
68 | 69 | ||
69 | /* Non HT mask */ | 70 | /* Non HT mask */ |
70 | #define P4_CCCR_MASK \ | 71 | #define P4_CCCR_MASK \ |
@@ -116,7 +117,7 @@ | |||
116 | #define p4_config_pack_escr(v) (((u64)(v)) << 32) | 117 | #define p4_config_pack_escr(v) (((u64)(v)) << 32) |
117 | #define p4_config_pack_cccr(v) (((u64)(v)) & 0xffffffffULL) | 118 | #define p4_config_pack_cccr(v) (((u64)(v)) & 0xffffffffULL) |
118 | #define p4_config_unpack_escr(v) (((u64)(v)) >> 32) | 119 | #define p4_config_unpack_escr(v) (((u64)(v)) >> 32) |
119 | #define p4_config_unpack_cccr(v) (((u64)(v)) & 0xffffffffULL) | 120 | #define p4_config_unpack_cccr(v) (((u64)(v)) & 0xfffff000ULL) |
120 | 121 | ||
121 | #define p4_config_unpack_emask(v) \ | 122 | #define p4_config_unpack_emask(v) \ |
122 | ({ \ | 123 | ({ \ |
@@ -126,6 +127,8 @@ | |||
126 | t; \ | 127 | t; \ |
127 | }) | 128 | }) |
128 | 129 | ||
130 | #define p4_config_unpack_key(v) (((u64)(v)) & P4_CCCR_RESERVED) | ||
131 | |||
129 | #define P4_CONFIG_HT_SHIFT 63 | 132 | #define P4_CONFIG_HT_SHIFT 63 |
130 | #define P4_CONFIG_HT (1ULL << P4_CONFIG_HT_SHIFT) | 133 | #define P4_CONFIG_HT (1ULL << P4_CONFIG_HT_SHIFT) |
131 | 134 | ||