aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/perf_counter.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2009-06-17 07:51:13 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-18 05:11:45 -0400
commit448d64f8f4c147db466c549550767cc515a4d34c (patch)
tree9c33191273219d8e4d77e3ea78304691e4fb4b56 /arch/powerpc/include/asm/perf_counter.h
parent105988c015943e77092a6568bc5fb7e386df6ccd (diff)
perf_counter: powerpc: Use unsigned long for register and constraint values
This changes the powerpc perf_counter back-end to use unsigned long types for hardware register values and for the value/mask pairs used in checking whether a given set of events fit within the hardware constraints. This is in preparation for adding support for the PMU on some 32-bit powerpc processors. On 32-bit processors the hardware registers are only 32 bits wide, and the PMU structure is generally simpler, so 32 bits should be ample for expressing the hardware constraints. On 64-bit processors, unsigned long is 64 bits wide, so using unsigned long vs. u64 (unsigned long long) makes no actual difference. This makes some other very minor changes: adjusting whitespace to line things up in initialized structures, and simplifying some code in hw_perf_disable(). Signed-off-by: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: linuxppc-dev@ozlabs.org Cc: benh@kernel.crashing.org LKML-Reference: <19000.55473.26174.331511@cargo.ozlabs.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/powerpc/include/asm/perf_counter.h')
-rw-r--r--arch/powerpc/include/asm/perf_counter.h35
1 files changed, 18 insertions, 17 deletions
diff --git a/arch/powerpc/include/asm/perf_counter.h b/arch/powerpc/include/asm/perf_counter.h
index 2c2d9f643df0..2ceb0fefa93a 100644
--- a/arch/powerpc/include/asm/perf_counter.h
+++ b/arch/powerpc/include/asm/perf_counter.h
@@ -21,21 +21,22 @@
21 * describe the PMU on a particular POWER-family CPU. 21 * describe the PMU on a particular POWER-family CPU.
22 */ 22 */
23struct power_pmu { 23struct power_pmu {
24 int n_counter; 24 int n_counter;
25 int max_alternatives; 25 int max_alternatives;
26 u64 add_fields; 26 unsigned long add_fields;
27 u64 test_adder; 27 unsigned long test_adder;
28 int (*compute_mmcr)(u64 events[], int n_ev, 28 int (*compute_mmcr)(u64 events[], int n_ev,
29 unsigned int hwc[], u64 mmcr[]); 29 unsigned int hwc[], unsigned long mmcr[]);
30 int (*get_constraint)(u64 event, u64 *mskp, u64 *valp); 30 int (*get_constraint)(u64 event, unsigned long *mskp,
31 int (*get_alternatives)(u64 event, unsigned int flags, 31 unsigned long *valp);
32 u64 alt[]); 32 int (*get_alternatives)(u64 event, unsigned int flags,
33 void (*disable_pmc)(unsigned int pmc, u64 mmcr[]); 33 u64 alt[]);
34 int (*limited_pmc_event)(u64 event); 34 void (*disable_pmc)(unsigned int pmc, unsigned long mmcr[]);
35 u32 flags; 35 int (*limited_pmc_event)(u64 event);
36 int n_generic; 36 u32 flags;
37 int *generic_events; 37 int n_generic;
38 int (*cache_events)[PERF_COUNT_HW_CACHE_MAX] 38 int *generic_events;
39 int (*cache_events)[PERF_COUNT_HW_CACHE_MAX]
39 [PERF_COUNT_HW_CACHE_OP_MAX] 40 [PERF_COUNT_HW_CACHE_OP_MAX]
40 [PERF_COUNT_HW_CACHE_RESULT_MAX]; 41 [PERF_COUNT_HW_CACHE_RESULT_MAX];
41}; 42};
@@ -68,8 +69,8 @@ extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
68#endif 69#endif
69 70
70/* 71/*
71 * The power_pmu.get_constraint function returns a 64-bit value and 72 * The power_pmu.get_constraint function returns a 32/64-bit value and
72 * a 64-bit mask that express the constraints between this event and 73 * a 32/64-bit mask that express the constraints between this event and
73 * other events. 74 * other events.
74 * 75 *
75 * The value and mask are divided up into (non-overlapping) bitfields 76 * The value and mask are divided up into (non-overlapping) bitfields