summaryrefslogtreecommitdiffstats
path: root/kernel/events/hw_breakpoint.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2013-05-01 17:25:44 +0200
committerIngo Molnar <mingo@kernel.org>2013-05-28 08:59:54 +0200
commitab573844e3058eef2788803d373019f8bebead57 (patch)
tree8d040ef2da05caccabce8ccb5f4b168ee3f63216 /kernel/events/hw_breakpoint.c
parentddd40da4ccbabdd2e941837aa987e08dfa4396b4 (diff)
downloadlinux-stable-ab573844e3058eef2788803d373019f8bebead57.tar.gz
linux-stable-ab573844e3058eef2788803d373019f8bebead57.tar.bz2
linux-stable-ab573844e3058eef2788803d373019f8bebead57.zip
perf: Fix hw breakpoints overflow period sampling
The hw breakpoint pmu 'add' function is missing the period_left update needed for SW events. The perf HW breakpoint events use the SW events framework to process the overflow, so it needs to be properly initialized in the PMU 'add' method. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Reviewed-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Vince Weaver <vincent.weaver@maine.edu> Cc: Stephane Eranian <eranian@google.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1367421944-19082-5-git-send-email-jolsa@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events/hw_breakpoint.c')
-rw-r--r--kernel/events/hw_breakpoint.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c
index a64f8aeb5c1f..966a241e8616 100644
--- a/kernel/events/hw_breakpoint.c
+++ b/kernel/events/hw_breakpoint.c
@@ -612,6 +612,11 @@ static int hw_breakpoint_add(struct perf_event *bp, int flags)
if (!(flags & PERF_EF_START))
bp->hw.state = PERF_HES_STOPPED;
+ if (is_sampling_event(bp)) {
+ bp->hw.last_period = bp->hw.sample_period;
+ perf_swevent_set_period(bp);
+ }
+
return arch_install_hw_breakpoint(bp);
}