diff options
Diffstat (limited to 'arch/powerpc/include/asm/perf_counter.h')
-rw-r--r-- | arch/powerpc/include/asm/perf_counter.h | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/arch/powerpc/include/asm/perf_counter.h b/arch/powerpc/include/asm/perf_counter.h index cc7c887705b8..8ccd4e155768 100644 --- a/arch/powerpc/include/asm/perf_counter.h +++ b/arch/powerpc/include/asm/perf_counter.h | |||
@@ -10,6 +10,8 @@ | |||
10 | */ | 10 | */ |
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | 12 | ||
13 | #include <asm/hw_irq.h> | ||
14 | |||
13 | #define MAX_HWCOUNTERS 8 | 15 | #define MAX_HWCOUNTERS 8 |
14 | #define MAX_EVENT_ALTERNATIVES 8 | 16 | #define MAX_EVENT_ALTERNATIVES 8 |
15 | #define MAX_LIMITED_HWCOUNTERS 2 | 17 | #define MAX_LIMITED_HWCOUNTERS 2 |
@@ -19,27 +21,27 @@ | |||
19 | * describe the PMU on a particular POWER-family CPU. | 21 | * describe the PMU on a particular POWER-family CPU. |
20 | */ | 22 | */ |
21 | struct power_pmu { | 23 | struct power_pmu { |
22 | int n_counter; | 24 | const char *name; |
23 | int max_alternatives; | 25 | int n_counter; |
24 | u64 add_fields; | 26 | int max_alternatives; |
25 | u64 test_adder; | 27 | unsigned long add_fields; |
26 | int (*compute_mmcr)(u64 events[], int n_ev, | 28 | unsigned long test_adder; |
27 | unsigned int hwc[], u64 mmcr[]); | 29 | int (*compute_mmcr)(u64 events[], int n_ev, |
28 | int (*get_constraint)(u64 event, u64 *mskp, u64 *valp); | 30 | unsigned int hwc[], unsigned long mmcr[]); |
29 | int (*get_alternatives)(u64 event, unsigned int flags, | 31 | int (*get_constraint)(u64 event, unsigned long *mskp, |
30 | u64 alt[]); | 32 | unsigned long *valp); |
31 | void (*disable_pmc)(unsigned int pmc, u64 mmcr[]); | 33 | int (*get_alternatives)(u64 event, unsigned int flags, |
32 | int (*limited_pmc_event)(u64 event); | 34 | u64 alt[]); |
33 | u32 flags; | 35 | void (*disable_pmc)(unsigned int pmc, unsigned long mmcr[]); |
34 | int n_generic; | 36 | int (*limited_pmc_event)(u64 event); |
35 | int *generic_events; | 37 | u32 flags; |
36 | int (*cache_events)[PERF_COUNT_HW_CACHE_MAX] | 38 | int n_generic; |
39 | int *generic_events; | ||
40 | int (*cache_events)[PERF_COUNT_HW_CACHE_MAX] | ||
37 | [PERF_COUNT_HW_CACHE_OP_MAX] | 41 | [PERF_COUNT_HW_CACHE_OP_MAX] |
38 | [PERF_COUNT_HW_CACHE_RESULT_MAX]; | 42 | [PERF_COUNT_HW_CACHE_RESULT_MAX]; |
39 | }; | 43 | }; |
40 | 44 | ||
41 | extern struct power_pmu *ppmu; | ||
42 | |||
43 | /* | 45 | /* |
44 | * Values for power_pmu.flags | 46 | * Values for power_pmu.flags |
45 | */ | 47 | */ |
@@ -53,15 +55,23 @@ extern struct power_pmu *ppmu; | |||
53 | #define PPMU_LIMITED_PMC_REQD 2 /* have to put this on a limited PMC */ | 55 | #define PPMU_LIMITED_PMC_REQD 2 /* have to put this on a limited PMC */ |
54 | #define PPMU_ONLY_COUNT_RUN 4 /* only counting in run state */ | 56 | #define PPMU_ONLY_COUNT_RUN 4 /* only counting in run state */ |
55 | 57 | ||
58 | extern int register_power_pmu(struct power_pmu *); | ||
59 | |||
56 | struct pt_regs; | 60 | struct pt_regs; |
57 | extern unsigned long perf_misc_flags(struct pt_regs *regs); | 61 | extern unsigned long perf_misc_flags(struct pt_regs *regs); |
58 | #define perf_misc_flags(regs) perf_misc_flags(regs) | ||
59 | |||
60 | extern unsigned long perf_instruction_pointer(struct pt_regs *regs); | 62 | extern unsigned long perf_instruction_pointer(struct pt_regs *regs); |
61 | 63 | ||
62 | /* | 64 | /* |
63 | * The power_pmu.get_constraint function returns a 64-bit value and | 65 | * Only override the default definitions in include/linux/perf_counter.h |
64 | * a 64-bit mask that express the constraints between this event and | 66 | * if we have hardware PMU support. |
67 | */ | ||
68 | #ifdef CONFIG_PPC_PERF_CTRS | ||
69 | #define perf_misc_flags(regs) perf_misc_flags(regs) | ||
70 | #endif | ||
71 | |||
72 | /* | ||
73 | * The power_pmu.get_constraint function returns a 32/64-bit value and | ||
74 | * a 32/64-bit mask that express the constraints between this event and | ||
65 | * other events. | 75 | * other events. |
66 | * | 76 | * |
67 | * The value and mask are divided up into (non-overlapping) bitfields | 77 | * The value and mask are divided up into (non-overlapping) bitfields |