]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - kernel/hw_breakpoint.c
perf: Rework the PMU methods
[mv-sheeva.git] / kernel / hw_breakpoint.c
index e9c5cfa1fd203870c952a393f172dfa8a7d765d2..6f150095cafe14e247c27eee6ba4f1461c195b18 100644 (file)
@@ -586,10 +586,35 @@ static int hw_breakpoint_event_init(struct perf_event *bp)
        return 0;
 }
 
+static int hw_breakpoint_add(struct perf_event *bp, int flags)
+{
+       if (!(flags & PERF_EF_START))
+               bp->hw.state = PERF_HES_STOPPED;
+
+       return arch_install_hw_breakpoint(bp);
+}
+
+static void hw_breakpoint_del(struct perf_event *bp, int flags)
+{
+       arch_uninstall_hw_breakpoint(bp);
+}
+
+static void hw_breakpoint_start(struct perf_event *bp, int flags)
+{
+       bp->hw.state = 0;
+}
+
+static void hw_breakpoint_stop(struct perf_event *bp, int flags)
+{
+       bp->hw.state = PERF_HES_STOPPED;
+}
+
 static struct pmu perf_breakpoint = {
        .event_init     = hw_breakpoint_event_init,
-       .enable         = arch_install_hw_breakpoint,
-       .disable        = arch_uninstall_hw_breakpoint,
+       .add            = hw_breakpoint_add,
+       .del            = hw_breakpoint_del,
+       .start          = hw_breakpoint_start,
+       .stop           = hw_breakpoint_stop,
        .read           = hw_breakpoint_pmu_read,
 };