diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-20 14:29:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-20 14:29:32 -0400 |
commit | 12e24f34cb0d55efd08c18b2112507d4bf498008 (patch) | |
tree | 83b07be17b8ef45f42360a3b9159b3aaae3fbad4 /arch/powerpc/include | |
parent | 1eb51c33b21ffa3fceb634d1d6bcd6488c79bc26 (diff) | |
parent | eadc84cc01e04f9f74ec2de0c9355be035c7b396 (diff) |
Merge branch 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (49 commits)
perfcounter: Handle some IO return values
perf_counter: Push perf_sample_data through the swcounter code
perf_counter tools: Define and use our own u64, s64 etc. definitions
perf_counter: Close race in perf_lock_task_context()
perf_counter, x86: Improve interactions with fast-gup
perf_counter: Simplify and fix task migration counting
perf_counter tools: Add a data file header
perf_counter: Update userspace callchain sampling uses
perf_counter: Make callchain samples extensible
perf report: Filter to parent set by default
perf_counter tools: Handle lost events
perf_counter: Add event overlow handling
fs: Provide empty .set_page_dirty() aop for anon inodes
perf_counter: tools: Makefile tweaks for 64-bit powerpc
perf_counter: powerpc: Add processor back-end for MPC7450 family
perf_counter: powerpc: Make powerpc perf_counter code safe for 32-bit kernels
perf_counter: powerpc: Change how processor-specific back-ends get selected
perf_counter: powerpc: Use unsigned long for register and constraint values
perf_counter: powerpc: Enable use of software counters on 32-bit powerpc
perf_counter tools: Add and use isprint()
...
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/hw_irq.h | 6 | ||||
-rw-r--r-- | arch/powerpc/include/asm/perf_counter.h | 52 |
2 files changed, 35 insertions, 23 deletions
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h index b7f8f4a87cc0..867ab8ed69b3 100644 --- a/arch/powerpc/include/asm/hw_irq.h +++ b/arch/powerpc/include/asm/hw_irq.h | |||
@@ -131,6 +131,8 @@ static inline int irqs_disabled_flags(unsigned long flags) | |||
131 | struct irq_chip; | 131 | struct irq_chip; |
132 | 132 | ||
133 | #ifdef CONFIG_PERF_COUNTERS | 133 | #ifdef CONFIG_PERF_COUNTERS |
134 | |||
135 | #ifdef CONFIG_PPC64 | ||
134 | static inline unsigned long test_perf_counter_pending(void) | 136 | static inline unsigned long test_perf_counter_pending(void) |
135 | { | 137 | { |
136 | unsigned long x; | 138 | unsigned long x; |
@@ -154,15 +156,15 @@ static inline void clear_perf_counter_pending(void) | |||
154 | "r" (0), | 156 | "r" (0), |
155 | "i" (offsetof(struct paca_struct, perf_counter_pending))); | 157 | "i" (offsetof(struct paca_struct, perf_counter_pending))); |
156 | } | 158 | } |
159 | #endif /* CONFIG_PPC64 */ | ||
157 | 160 | ||
158 | #else | 161 | #else /* CONFIG_PERF_COUNTERS */ |
159 | 162 | ||
160 | static inline unsigned long test_perf_counter_pending(void) | 163 | static inline unsigned long test_perf_counter_pending(void) |
161 | { | 164 | { |
162 | return 0; | 165 | return 0; |
163 | } | 166 | } |
164 | 167 | ||
165 | static inline void set_perf_counter_pending(void) {} | ||
166 | static inline void clear_perf_counter_pending(void) {} | 168 | static inline void clear_perf_counter_pending(void) {} |
167 | #endif /* CONFIG_PERF_COUNTERS */ | 169 | #endif /* CONFIG_PERF_COUNTERS */ |
168 | 170 | ||
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 |