aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/perf_counter.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/perf_counter.h')
-rw-r--r--arch/x86/include/asm/perf_counter.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/x86/include/asm/perf_counter.h b/arch/x86/include/asm/perf_counter.h
new file mode 100644
index 000000000000..9dadce1124ee
--- /dev/null
+++ b/arch/x86/include/asm/perf_counter.h
@@ -0,0 +1,41 @@
1#ifndef _ASM_X86_PERF_COUNTER_H
2#define _ASM_X86_PERF_COUNTER_H
3
4#define MSR_ARCH_PERFMON_PERFCTR0 0xc1
5#define MSR_ARCH_PERFMON_PERFCTR1 0xc2
6
7#define MSR_ARCH_PERFMON_EVENTSEL0 0x186
8#define MSR_ARCH_PERFMON_EVENTSEL1 0x187
9
10#define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22)
11#define ARCH_PERFMON_EVENTSEL_INT (1 << 20)
12#define ARCH_PERFMON_EVENTSEL_OS (1 << 17)
13#define ARCH_PERFMON_EVENTSEL_USR (1 << 16)
14
15#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL 0x3c
16#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8)
17#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX 0
18#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \
19 (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX))
20
21#define ARCH_PERFMON_BRANCH_MISSES_RETIRED 6
22
23union cpuid10_eax {
24 struct {
25 unsigned int version_id:8;
26 unsigned int num_counters:8;
27 unsigned int bit_width:8;
28 unsigned int mask_length:8;
29 } split;
30 unsigned int full;
31};
32
33#ifdef CONFIG_PERF_COUNTERS
34extern void init_hw_perf_counters(void);
35extern void perf_counters_lapic_init(int nmi);
36#else
37static inline void init_hw_perf_counters(void) { }
38static inline void perf_counters_lapic_init(int nmi) { }
39#endif
40
41#endif /* _ASM_X86_PERF_COUNTER_H */