aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/perf_counter.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-06-10 15:02:22 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-10 20:39:02 -0400
commitdf1a132bf3d3508f863336c80a27806a2ac947e0 (patch)
tree2aa26b9c5d0528e816a80bd3b58c9b2442670d5c /arch/powerpc/kernel/perf_counter.c
parentea1900e571d40a3ce60c835c2f21e1fd8c5cb663 (diff)
perf_counter: Introduce struct for sample data
For easy extension of the sample data, put it in a structure. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/powerpc/kernel/perf_counter.c')
-rw-r--r--arch/powerpc/kernel/perf_counter.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/perf_counter.c b/arch/powerpc/kernel/perf_counter.c
index 4786ad9a2887..5e0bf399c433 100644
--- a/arch/powerpc/kernel/perf_counter.c
+++ b/arch/powerpc/kernel/perf_counter.c
@@ -1001,7 +1001,11 @@ static void record_and_restart(struct perf_counter *counter, long val,
1001 * Finally record data if requested. 1001 * Finally record data if requested.
1002 */ 1002 */
1003 if (record) { 1003 if (record) {
1004 addr = 0; 1004 struct perf_sample_data data = {
1005 .regs = regs,
1006 .addr = 0,
1007 };
1008
1005 if (counter->attr.sample_type & PERF_SAMPLE_ADDR) { 1009 if (counter->attr.sample_type & PERF_SAMPLE_ADDR) {
1006 /* 1010 /*
1007 * The user wants a data address recorded. 1011 * The user wants a data address recorded.
@@ -1016,9 +1020,9 @@ static void record_and_restart(struct perf_counter *counter, long val,
1016 sdsync = (ppmu->flags & PPMU_ALT_SIPR) ? 1020 sdsync = (ppmu->flags & PPMU_ALT_SIPR) ?
1017 POWER6_MMCRA_SDSYNC : MMCRA_SDSYNC; 1021 POWER6_MMCRA_SDSYNC : MMCRA_SDSYNC;
1018 if (!(mmcra & MMCRA_SAMPLE_ENABLE) || (mmcra & sdsync)) 1022 if (!(mmcra & MMCRA_SAMPLE_ENABLE) || (mmcra & sdsync))
1019 addr = mfspr(SPRN_SDAR); 1023 data.addr = mfspr(SPRN_SDAR);
1020 } 1024 }
1021 if (perf_counter_overflow(counter, nmi, regs, addr)) { 1025 if (perf_counter_overflow(counter, nmi, &data)) {
1022 /* 1026 /*
1023 * Interrupts are coming too fast - throttle them 1027 * Interrupts are coming too fast - throttle them
1024 * by setting the counter to 0, so it will be 1028 * by setting the counter to 0, so it will be