perf_event: initialize data.period in perf_swevent_hrtimer()
PATCH 1/1 perf_event: initialize data.period in perf_swevent_hrtimer()
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 <[email protected]>
--- kernel/perf_event.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
kernel/perf_event.c +1 -0
@@ -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
Signature · 1 line
1.6.1.2
Quoted 1 line · Xiao Guangrong
In current code in
perf_swevent_hrtimer(), data.period is not initialized,
Ah, very nice catch.
Acked-by Peter Zijlstra <[email protected]>
Quoted 17 lines
Signed-off-by Xiao Guangrong <[email protected]>--- kernel/perf_event.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)kernel/perf_event.c +1
-0@@ -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
[tip:perf/core] perf_event: Initialize data.period in perf_swevent_hrtimer()
In reply to Xiao GuangrongCommit-ID: 59d069eb5ae9b033ed1c124c92e1532c4a958991 Gitweb: http://git.kernel.org/tip/59d069eb5ae9b033ed1c124c92e1532c4a958991 Author: Xiao Guangrong <[email protected]> AuthorDate: Tue, 1 Dec 2009 17:30:08 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 1 Dec 2009 11:19:07 +0100
perf_event: Initialize data.period in perf_swevent_hrtimer()
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 <[email protected]>
Acked-by Peter Zijlstra <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- kernel/perf_event.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
kernel/perf_event.c +1 -0
@@ -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