All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf_event: initialize data.period in perf_swevent_hrtimer()
@ 2009-12-01  9:30 Xiao Guangrong
  2009-12-01  9:37 ` Peter Zijlstra
  2009-12-01 10:21 ` [tip:perf/core] perf_event: Initialize " tip-bot for Xiao Guangrong
  0 siblings, 2 replies; 3+ messages in thread
From: Xiao Guangrong @ 2009-12-01  9:30 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, Frederic Weisbecker, LKML

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>
---
 kernel/perf_event.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 0b9ca2d..040ee51 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4010,6 +4010,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
-- 
1.6.1.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-01 10:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-01  9:30 [PATCH] perf_event: initialize data.period in perf_swevent_hrtimer() Xiao Guangrong
2009-12-01  9:37 ` Peter Zijlstra
2009-12-01 10:21 ` [tip:perf/core] perf_event: Initialize " tip-bot for Xiao Guangrong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.