diff options
| author | Paul Mackerras <paulus@samba.org> | 2009-09-21 02:44:32 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-09-21 03:28:40 -0400 |
| commit | cd74c86bdf705f824d494a2bbda393d1d562b40a (patch) | |
| tree | 8af5261bcd84014f6f587eb326b7dd7c203d0966 | |
| parent | a1792cdacaf5180e04e07811e220c4a3b4a9c33e (diff) | |
perf_counter, powerpc, sparc: Fix compilation after perf_counter_overflow() change
Commit 5622f295 ("x86, perf_counter, bts: Optimize BTS overflow
handling") removed the regs field from struct perf_sample_data and
added a regs parameter to perf_counter_overflow(). This breaks the
build on powerpc (and Sparc) as reported by Sachin Sant:
arch/powerpc/kernel/perf_counter.c: In function 'record_and_restart':
arch/powerpc/kernel/perf_counter.c:1165: error: unknown field 'regs' specified in initializer
This adjusts arch/powerpc/kernel/perf_counter.c to correspond with the
new struct perf_sample_data and perf_counter_overflow().
[ v2: also fix Sparc, Markus Metzger <markus.t.metzger@intel.com> ]
Reported-by: Sachin Sant <sachinp@in.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: Markus Metzger <markus.t.metzger@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: benh@kernel.crashing.org
Cc: linuxppc-dev@ozlabs.org
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <19127.8400.376239.586120@drongo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
| -rw-r--r-- | arch/powerpc/kernel/perf_counter.c | 3 | ||||
| -rw-r--r-- | arch/sparc/kernel/perf_counter.c | 3 | ||||
| -rw-r--r-- | include/linux/perf_counter.h | 17 |
3 files changed, 2 insertions, 21 deletions
diff --git a/arch/powerpc/kernel/perf_counter.c b/arch/powerpc/kernel/perf_counter.c index 7ceefaf3a7f5..5ccf9bca96c0 100644 --- a/arch/powerpc/kernel/perf_counter.c +++ b/arch/powerpc/kernel/perf_counter.c | |||
| @@ -1162,7 +1162,6 @@ static void record_and_restart(struct perf_counter *counter, unsigned long val, | |||
| 1162 | */ | 1162 | */ |
| 1163 | if (record) { | 1163 | if (record) { |
| 1164 | struct perf_sample_data data = { | 1164 | struct perf_sample_data data = { |
| 1165 | .regs = regs, | ||
| 1166 | .addr = 0, | 1165 | .addr = 0, |
| 1167 | .period = counter->hw.last_period, | 1166 | .period = counter->hw.last_period, |
| 1168 | }; | 1167 | }; |
| @@ -1170,7 +1169,7 @@ static void record_and_restart(struct perf_counter *counter, unsigned long val, | |||
| 1170 | if (counter->attr.sample_type & PERF_SAMPLE_ADDR) | 1169 | if (counter->attr.sample_type & PERF_SAMPLE_ADDR) |
| 1171 | perf_get_data_addr(regs, &data.addr); | 1170 | perf_get_data_addr(regs, &data.addr); |
| 1172 | 1171 | ||
| 1173 | if (perf_counter_overflow(counter, nmi, &data)) { | 1172 | if (perf_counter_overflow(counter, nmi, &data, regs)) { |
| 1174 | /* | 1173 | /* |
| 1175 | * Interrupts are coming too fast - throttle them | 1174 | * Interrupts are coming too fast - throttle them |
| 1176 | * by setting the counter to 0, so it will be | 1175 | * by setting the counter to 0, so it will be |
diff --git a/arch/sparc/kernel/perf_counter.c b/arch/sparc/kernel/perf_counter.c index 09de4035eaa9..b1265ce8a053 100644 --- a/arch/sparc/kernel/perf_counter.c +++ b/arch/sparc/kernel/perf_counter.c | |||
| @@ -493,7 +493,6 @@ static int __kprobes perf_counter_nmi_handler(struct notifier_block *self, | |||
| 493 | 493 | ||
| 494 | regs = args->regs; | 494 | regs = args->regs; |
| 495 | 495 | ||
| 496 | data.regs = regs; | ||
| 497 | data.addr = 0; | 496 | data.addr = 0; |
| 498 | 497 | ||
| 499 | cpuc = &__get_cpu_var(cpu_hw_counters); | 498 | cpuc = &__get_cpu_var(cpu_hw_counters); |
| @@ -513,7 +512,7 @@ static int __kprobes perf_counter_nmi_handler(struct notifier_block *self, | |||
| 513 | if (!sparc_perf_counter_set_period(counter, hwc, idx)) | 512 | if (!sparc_perf_counter_set_period(counter, hwc, idx)) |
| 514 | continue; | 513 | continue; |
| 515 | 514 | ||
| 516 | if (perf_counter_overflow(counter, 1, &data)) | 515 | if (perf_counter_overflow(counter, 1, &data, regs)) |
| 517 | sparc_pmu_disable_counter(hwc, idx); | 516 | sparc_pmu_disable_counter(hwc, idx); |
| 518 | } | 517 | } |
| 519 | 518 | ||
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index bd341007c4fc..740caad09a44 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
| @@ -849,23 +849,6 @@ static inline void perf_counter_comm(struct task_struct *tsk) { } | |||
| 849 | static inline void perf_counter_fork(struct task_struct *tsk) { } | 849 | static inline void perf_counter_fork(struct task_struct *tsk) { } |
| 850 | static inline void perf_counter_init(void) { } | 850 | static inline void perf_counter_init(void) { } |
| 851 | 851 | ||
| 852 | static inline int | ||
| 853 | perf_output_begin(struct perf_output_handle *handle, struct perf_counter *c, | ||
| 854 | unsigned int size, int nmi, int sample) { } | ||
| 855 | static inline void perf_output_end(struct perf_output_handle *handle) { } | ||
| 856 | static inline void | ||
| 857 | perf_output_copy(struct perf_output_handle *handle, | ||
| 858 | const void *buf, unsigned int len) { } | ||
| 859 | static inline void | ||
| 860 | perf_output_sample(struct perf_output_handle *handle, | ||
| 861 | struct perf_event_header *header, | ||
| 862 | struct perf_sample_data *data, | ||
| 863 | struct perf_counter *counter) { } | ||
| 864 | static inline void | ||
| 865 | perf_prepare_sample(struct perf_event_header *header, | ||
| 866 | struct perf_sample_data *data, | ||
| 867 | struct perf_counter *counter, | ||
| 868 | struct pt_regs *regs) { } | ||
| 869 | #endif | 852 | #endif |
| 870 | 853 | ||
| 871 | #define perf_output_put(handle, x) \ | 854 | #define perf_output_put(handle, x) \ |
