diff options
Diffstat (limited to 'arch/x86/include/asm/intel_arch_perfmon.h')
-rw-r--r-- | arch/x86/include/asm/intel_arch_perfmon.h | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/arch/x86/include/asm/intel_arch_perfmon.h b/arch/x86/include/asm/intel_arch_perfmon.h index fa0fd068bc2e..71598a9eab61 100644 --- a/arch/x86/include/asm/intel_arch_perfmon.h +++ b/arch/x86/include/asm/intel_arch_perfmon.h | |||
@@ -1,22 +1,24 @@ | |||
1 | #ifndef _ASM_X86_INTEL_ARCH_PERFMON_H | 1 | #ifndef _ASM_X86_INTEL_ARCH_PERFMON_H |
2 | #define _ASM_X86_INTEL_ARCH_PERFMON_H | 2 | #define _ASM_X86_INTEL_ARCH_PERFMON_H |
3 | 3 | ||
4 | #define MSR_ARCH_PERFMON_PERFCTR0 0xc1 | 4 | #define MSR_ARCH_PERFMON_PERFCTR0 0xc1 |
5 | #define MSR_ARCH_PERFMON_PERFCTR1 0xc2 | 5 | #define MSR_ARCH_PERFMON_PERFCTR1 0xc2 |
6 | 6 | ||
7 | #define MSR_ARCH_PERFMON_EVENTSEL0 0x186 | 7 | #define MSR_ARCH_PERFMON_EVENTSEL0 0x186 |
8 | #define MSR_ARCH_PERFMON_EVENTSEL1 0x187 | 8 | #define MSR_ARCH_PERFMON_EVENTSEL1 0x187 |
9 | 9 | ||
10 | #define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22) | 10 | #define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22) |
11 | #define ARCH_PERFMON_EVENTSEL_INT (1 << 20) | 11 | #define ARCH_PERFMON_EVENTSEL_INT (1 << 20) |
12 | #define ARCH_PERFMON_EVENTSEL_OS (1 << 17) | 12 | #define ARCH_PERFMON_EVENTSEL_OS (1 << 17) |
13 | #define ARCH_PERFMON_EVENTSEL_USR (1 << 16) | 13 | #define ARCH_PERFMON_EVENTSEL_USR (1 << 16) |
14 | 14 | ||
15 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL (0x3c) | 15 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL 0x3c |
16 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8) | 16 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8) |
17 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX (0) | 17 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX 0 |
18 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \ | 18 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \ |
19 | (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX)) | 19 | (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX)) |
20 | |||
21 | #define ARCH_PERFMON_BRANCH_MISSES_RETIRED 6 | ||
20 | 22 | ||
21 | union cpuid10_eax { | 23 | union cpuid10_eax { |
22 | struct { | 24 | struct { |
@@ -28,4 +30,12 @@ union cpuid10_eax { | |||
28 | unsigned int full; | 30 | unsigned int full; |
29 | }; | 31 | }; |
30 | 32 | ||
33 | #ifdef CONFIG_PERF_COUNTERS | ||
34 | extern void init_hw_perf_counters(void); | ||
35 | extern void perf_counters_lapic_init(int nmi); | ||
36 | #else | ||
37 | static inline void init_hw_perf_counters(void) { } | ||
38 | static inline void perf_counters_lapic_init(int nmi) { } | ||
39 | #endif | ||
40 | |||
31 | #endif /* _ASM_X86_INTEL_ARCH_PERFMON_H */ | 41 | #endif /* _ASM_X86_INTEL_ARCH_PERFMON_H */ |