aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2012-04-02 14:19:08 -0400
committerIngo Molnar <mingo@kernel.org>2012-05-09 09:23:12 -0400
commitfd0d000b2c34aa43d4e92dcf0dfaeda7e123008a (patch)
tree8b81831cf37f1be6dd3cc9be772952d5c835a550 /arch/alpha/kernel
parentc75841a398d667d9968245b9519d93cedbfb4780 (diff)
perf: Pass last sampling period to perf_sample_data_init()
We always need to pass the last sample period to perf_sample_data_init(), otherwise the event distribution will be wrong. Thus, modifiyng the function interface with the required period as argument. So basically a pattern like this: perf_sample_data_init(&data, ~0ULL); data.period = event->hw.last_period; will now be like that: perf_sample_data_init(&data, ~0ULL, event->hw.last_period); Avoids unininitialized data.period and simplifies code. Signed-off-by: Robert Richter <robert.richter@amd.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1333390758-10893-3-git-send-email-robert.richter@amd.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/alpha/kernel')
-rw-r--r--arch/alpha/kernel/perf_event.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c
index 0dae252f7a33..d821b17047e0 100644
--- a/arch/alpha/kernel/perf_event.c
+++ b/arch/alpha/kernel/perf_event.c
@@ -824,7 +824,6 @@ static void alpha_perf_event_irq_handler(unsigned long la_ptr,
824 824
825 idx = la_ptr; 825 idx = la_ptr;
826 826
827 perf_sample_data_init(&data, 0);
828 for (j = 0; j < cpuc->n_events; j++) { 827 for (j = 0; j < cpuc->n_events; j++) {
829 if (cpuc->current_idx[j] == idx) 828 if (cpuc->current_idx[j] == idx)
830 break; 829 break;
@@ -848,7 +847,7 @@ static void alpha_perf_event_irq_handler(unsigned long la_ptr,
848 847
849 hwc = &event->hw; 848 hwc = &event->hw;
850 alpha_perf_event_update(event, hwc, idx, alpha_pmu->pmc_max_period[idx]+1); 849 alpha_perf_event_update(event, hwc, idx, alpha_pmu->pmc_max_period[idx]+1);
851 data.period = event->hw.last_period; 850 perf_sample_data_init(&data, 0, hwc->last_period);
852 851
853 if (alpha_perf_event_set_period(event, hwc, idx)) { 852 if (alpha_perf_event_set_period(event, hwc, idx)) {
854 if (perf_event_overflow(event, &data, regs)) { 853 if (perf_event_overflow(event, &data, regs)) {