diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-10-13 02:16:30 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-13 02:19:53 -0400 |
commit | 7a693d3f0d10f978ebdf3082c41404ab97106567 (patch) | |
tree | ae8eba3e81404aa735e3b083c9eee737f0d5ff7e /arch/x86/kernel/cpu/perf_event.c | |
parent | 55ffb7a6bd45d0083ffb132381cb46964a4afe01 (diff) |
perf_events, x86: Fix event constraints code
There was namespace overlap due to a rename i did - this caused
the following build warning, reported by Stephen Rothwell against
linux-next x86_64 allmodconfig:
arch/x86/kernel/cpu/perf_event.c: In function 'intel_get_event_idx':
arch/x86/kernel/cpu/perf_event.c:1445: warning: 'event_constraint' is used uninitialized in this function
This is a real bug not just a warning: fix it by renaming the
global event-constraints table pointer to 'event_constraints'.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Stephane Eranian <eranian@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091013144223.369d616d.sfr@canb.auug.org.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event.c')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 9961d845719d..2e20bca3cca1 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -124,7 +124,7 @@ static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = { | |||
124 | .enabled = 1, | 124 | .enabled = 1, |
125 | }; | 125 | }; |
126 | 126 | ||
127 | static const struct event_constraint *event_constraint; | 127 | static const struct event_constraint *event_constraints; |
128 | 128 | ||
129 | /* | 129 | /* |
130 | * Not sure about some of these | 130 | * Not sure about some of these |
@@ -1442,12 +1442,12 @@ intel_get_event_idx(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc) | |||
1442 | const struct event_constraint *event_constraint; | 1442 | const struct event_constraint *event_constraint; |
1443 | int i, code; | 1443 | int i, code; |
1444 | 1444 | ||
1445 | if (!event_constraint) | 1445 | if (!event_constraints) |
1446 | goto skip; | 1446 | goto skip; |
1447 | 1447 | ||
1448 | code = hwc->config & CORE_EVNTSEL_EVENT_MASK; | 1448 | code = hwc->config & CORE_EVNTSEL_EVENT_MASK; |
1449 | 1449 | ||
1450 | for_each_event_constraint(event_constraint, event_constraint) { | 1450 | for_each_event_constraint(event_constraint, event_constraints) { |
1451 | if (code == event_constraint->code) { | 1451 | if (code == event_constraint->code) { |
1452 | for_each_bit(i, event_constraint->idxmsk, X86_PMC_IDX_MAX) { | 1452 | for_each_bit(i, event_constraint->idxmsk, X86_PMC_IDX_MAX) { |
1453 | if (!test_and_set_bit(i, cpuc->used_mask)) | 1453 | if (!test_and_set_bit(i, cpuc->used_mask)) |
@@ -2047,12 +2047,12 @@ static int p6_pmu_init(void) | |||
2047 | case 7: | 2047 | case 7: |
2048 | case 8: | 2048 | case 8: |
2049 | case 11: /* Pentium III */ | 2049 | case 11: /* Pentium III */ |
2050 | event_constraint = intel_p6_event_constraints; | 2050 | event_constraints = intel_p6_event_constraints; |
2051 | break; | 2051 | break; |
2052 | case 9: | 2052 | case 9: |
2053 | case 13: | 2053 | case 13: |
2054 | /* Pentium M */ | 2054 | /* Pentium M */ |
2055 | event_constraint = intel_p6_event_constraints; | 2055 | event_constraints = intel_p6_event_constraints; |
2056 | break; | 2056 | break; |
2057 | default: | 2057 | default: |
2058 | pr_cont("unsupported p6 CPU model %d ", | 2058 | pr_cont("unsupported p6 CPU model %d ", |
@@ -2124,14 +2124,14 @@ static int intel_pmu_init(void) | |||
2124 | sizeof(hw_cache_event_ids)); | 2124 | sizeof(hw_cache_event_ids)); |
2125 | 2125 | ||
2126 | pr_cont("Core2 events, "); | 2126 | pr_cont("Core2 events, "); |
2127 | event_constraint = intel_core_event_constraints; | 2127 | event_constraints = intel_core_event_constraints; |
2128 | break; | 2128 | break; |
2129 | default: | 2129 | default: |
2130 | case 26: | 2130 | case 26: |
2131 | memcpy(hw_cache_event_ids, nehalem_hw_cache_event_ids, | 2131 | memcpy(hw_cache_event_ids, nehalem_hw_cache_event_ids, |
2132 | sizeof(hw_cache_event_ids)); | 2132 | sizeof(hw_cache_event_ids)); |
2133 | 2133 | ||
2134 | event_constraint = intel_nehalem_event_constraints; | 2134 | event_constraints = intel_nehalem_event_constraints; |
2135 | pr_cont("Nehalem/Corei7 events, "); | 2135 | pr_cont("Nehalem/Corei7 events, "); |
2136 | break; | 2136 | break; |
2137 | case 28: | 2137 | case 28: |