aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hw_breakpoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/hw_breakpoint.c')
-rw-r--r--kernel/hw_breakpoint.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c
index e9c5cfa1fd20..6f150095cafe 100644
--- a/kernel/hw_breakpoint.c
+++ b/kernel/hw_breakpoint.c
@@ -586,10 +586,35 @@ static int hw_breakpoint_event_init(struct perf_event *bp)
586 return 0; 586 return 0;
587} 587}
588 588
589static int hw_breakpoint_add(struct perf_event *bp, int flags)
590{
591 if (!(flags & PERF_EF_START))
592 bp->hw.state = PERF_HES_STOPPED;
593
594 return arch_install_hw_breakpoint(bp);
595}
596
597static void hw_breakpoint_del(struct perf_event *bp, int flags)
598{
599 arch_uninstall_hw_breakpoint(bp);
600}
601
602static void hw_breakpoint_start(struct perf_event *bp, int flags)
603{
604 bp->hw.state = 0;
605}
606
607static void hw_breakpoint_stop(struct perf_event *bp, int flags)
608{
609 bp->hw.state = PERF_HES_STOPPED;
610}
611
589static struct pmu perf_breakpoint = { 612static struct pmu perf_breakpoint = {
590 .event_init = hw_breakpoint_event_init, 613 .event_init = hw_breakpoint_event_init,
591 .enable = arch_install_hw_breakpoint, 614 .add = hw_breakpoint_add,
592 .disable = arch_uninstall_hw_breakpoint, 615 .del = hw_breakpoint_del,
616 .start = hw_breakpoint_start,
617 .stop = hw_breakpoint_stop,
593 .read = hw_breakpoint_pmu_read, 618 .read = hw_breakpoint_pmu_read,
594}; 619};
595 620