diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-17 07:09:20 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-23 06:45:12 -0500 |
commit | 862a1a5f346fe7e9181ea51eaae48cf2cd70f746 (patch) | |
tree | 6c38478c3197ae842a3fa8ebc1623bc8d3fde6a4 /arch/x86/include/asm/perf_counter.h | |
parent | 703e937c83bbad79075a7846e062e447c2fee6a4 (diff) |
x86, perfcounters: refactor code for fixed-function PMCs
Impact: clean up
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/perf_counter.h')
-rw-r--r-- | arch/x86/include/asm/perf_counter.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86/include/asm/perf_counter.h b/arch/x86/include/asm/perf_counter.h index 945a315e6d62..13745deb16c8 100644 --- a/arch/x86/include/asm/perf_counter.h +++ b/arch/x86/include/asm/perf_counter.h | |||
@@ -8,6 +8,10 @@ | |||
8 | #define X86_PMC_MAX_GENERIC 8 | 8 | #define X86_PMC_MAX_GENERIC 8 |
9 | #define X86_PMC_MAX_FIXED 3 | 9 | #define X86_PMC_MAX_FIXED 3 |
10 | 10 | ||
11 | #define X86_PMC_IDX_GENERIC 0 | ||
12 | #define X86_PMC_IDX_FIXED 32 | ||
13 | #define X86_PMC_IDX_MAX 64 | ||
14 | |||
11 | #define MSR_ARCH_PERFMON_PERFCTR0 0xc1 | 15 | #define MSR_ARCH_PERFMON_PERFCTR0 0xc1 |
12 | #define MSR_ARCH_PERFMON_PERFCTR1 0xc2 | 16 | #define MSR_ARCH_PERFMON_PERFCTR1 0xc2 |
13 | 17 | ||
@@ -54,6 +58,15 @@ union cpuid10_edx { | |||
54 | * Fixed-purpose performance counters: | 58 | * Fixed-purpose performance counters: |
55 | */ | 59 | */ |
56 | 60 | ||
61 | /* | ||
62 | * All 3 fixed-mode PMCs are configured via this single MSR: | ||
63 | */ | ||
64 | #define MSR_ARCH_PERFMON_FIXED_CTR_CTRL 0x38d | ||
65 | |||
66 | /* | ||
67 | * The counts are available in three separate MSRs: | ||
68 | */ | ||
69 | |||
57 | /* Instr_Retired.Any: */ | 70 | /* Instr_Retired.Any: */ |
58 | #define MSR_ARCH_PERFMON_FIXED_CTR0 0x309 | 71 | #define MSR_ARCH_PERFMON_FIXED_CTR0 0x309 |
59 | 72 | ||
@@ -63,7 +76,6 @@ union cpuid10_edx { | |||
63 | /* CPU_CLK_Unhalted.Ref: */ | 76 | /* CPU_CLK_Unhalted.Ref: */ |
64 | #define MSR_ARCH_PERFMON_FIXED_CTR2 0x30b | 77 | #define MSR_ARCH_PERFMON_FIXED_CTR2 0x30b |
65 | 78 | ||
66 | |||
67 | #ifdef CONFIG_PERF_COUNTERS | 79 | #ifdef CONFIG_PERF_COUNTERS |
68 | extern void init_hw_perf_counters(void); | 80 | extern void init_hw_perf_counters(void); |
69 | extern void perf_counters_lapic_init(int nmi); | 81 | extern void perf_counters_lapic_init(int nmi); |