diff options
author | Robert Richter <robert.richter@amd.com> | 2012-04-02 14:19:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-05-09 09:23:12 -0400 |
commit | fd0d000b2c34aa43d4e92dcf0dfaeda7e123008a (patch) | |
tree | 8b81831cf37f1be6dd3cc9be772952d5c835a550 /arch/sparc/kernel | |
parent | c75841a398d667d9968245b9519d93cedbfb4780 (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/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/perf_event.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 28559ce5eeb5..5713957dcb8a 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
@@ -1296,8 +1296,6 @@ static int __kprobes perf_event_nmi_handler(struct notifier_block *self, | |||
1296 | 1296 | ||
1297 | regs = args->regs; | 1297 | regs = args->regs; |
1298 | 1298 | ||
1299 | perf_sample_data_init(&data, 0); | ||
1300 | |||
1301 | cpuc = &__get_cpu_var(cpu_hw_events); | 1299 | cpuc = &__get_cpu_var(cpu_hw_events); |
1302 | 1300 | ||
1303 | /* If the PMU has the TOE IRQ enable bits, we need to do a | 1301 | /* If the PMU has the TOE IRQ enable bits, we need to do a |
@@ -1321,7 +1319,7 @@ static int __kprobes perf_event_nmi_handler(struct notifier_block *self, | |||
1321 | if (val & (1ULL << 31)) | 1319 | if (val & (1ULL << 31)) |
1322 | continue; | 1320 | continue; |
1323 | 1321 | ||
1324 | data.period = event->hw.last_period; | 1322 | perf_sample_data_init(&data, 0, hwc->last_period); |
1325 | if (!sparc_perf_event_set_period(event, hwc, idx)) | 1323 | if (!sparc_perf_event_set_period(event, hwc, idx)) |
1326 | continue; | 1324 | continue; |
1327 | 1325 | ||