Skip to content

Commit cd74c86

Browse files
paulusmackIngo Molnar
authored andcommitted
perf_counter, powerpc, sparc: Fix compilation after perf_counter_overflow() change
Commit 5622f29 ("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>
1 parent a1792cd commit cd74c86

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

arch/powerpc/kernel/perf_counter.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,15 +1162,14 @@ static void record_and_restart(struct perf_counter *counter, unsigned long val,
11621162
*/
11631163
if (record) {
11641164
struct perf_sample_data data = {
1165-
.regs = regs,
11661165
.addr = 0,
11671166
.period = counter->hw.last_period,
11681167
};
11691168

11701169
if (counter->attr.sample_type & PERF_SAMPLE_ADDR)
11711170
perf_get_data_addr(regs, &data.addr);
11721171

1173-
if (perf_counter_overflow(counter, nmi, &data)) {
1172+
if (perf_counter_overflow(counter, nmi, &data, regs)) {
11741173
/*
11751174
* Interrupts are coming too fast - throttle them
11761175
* by setting the counter to 0, so it will be

arch/sparc/kernel/perf_counter.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ static int __kprobes perf_counter_nmi_handler(struct notifier_block *self,
493493

494494
regs = args->regs;
495495

496-
data.regs = regs;
497496
data.addr = 0;
498497

499498
cpuc = &__get_cpu_var(cpu_hw_counters);
@@ -513,7 +512,7 @@ static int __kprobes perf_counter_nmi_handler(struct notifier_block *self,
513512
if (!sparc_perf_counter_set_period(counter, hwc, idx))
514513
continue;
515514

516-
if (perf_counter_overflow(counter, 1, &data))
515+
if (perf_counter_overflow(counter, 1, &data, regs))
517516
sparc_pmu_disable_counter(hwc, idx);
518517
}
519518

include/linux/perf_counter.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -849,23 +849,6 @@ static inline void perf_counter_comm(struct task_struct *tsk) { }
849849
static inline void perf_counter_fork(struct task_struct *tsk) { }
850850
static inline void perf_counter_init(void) { }
851851

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) { }
869852
#endif
870853

871854
#define perf_output_put(handle, x) \

0 commit comments

Comments
 (0)