summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2009-12-01 17:30:08 +0800
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-18 14:03:08 -0800
commitb7b4aef82aeef0d9408951c8d1e7a2a6dd359921 (patch)
tree4961d43d568f64a30240aa76cc7cb5c18a25e4ce /kernel
parentc64d2a3d2c5f192d859374e943968439afb0f995 (diff)
perf_event: Initialize data.period in perf_swevent_hrtimer()
commit 59d069eb5ae9b033ed1c124c92e1532c4a958991 upstream. In current code in perf_swevent_hrtimer(), data.period is not initialized, The result is obvious wrong: # ./perf record -f -e cpu-clock make # ./perf report # Samples: 1740 # # Overhead Command ...... # ........ ........ .......................................... # 1025422183050275328.00% sh libc-2.9.90.so ... 1025422183050275328.00% perl libperl.so ... 1025422168240043264.00% perl [kernel] ... 1025422030011210752.00% perl [kernel] ... Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <4B14E220.2050107@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/perf_event.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 7f29643c8985..d16999c30ad2 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -3949,6 +3949,7 @@ static enum hrtimer_restart perf_swevent_hrtimer(struct hrtimer *hrtimer)
event->pmu->read(event);
data.addr = 0;
+ data.period = event->hw.last_period;
regs = get_irq_regs();
/*
* In case we exclude kernel IPs or are somehow not in interrupt