]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
hw_breakpoints: Allow arch-specific cleanup before breakpoint unregistration
authorK.Prasad <prasad@linux.vnet.ibm.com>
Tue, 15 Jun 2010 06:04:34 +0000 (11:34 +0530)
committerPaul Mackerras <paulus@samba.org>
Tue, 22 Jun 2010 09:40:50 +0000 (19:40 +1000)
Certain architectures (such as PowerPC) have a need to clean up data
structures before a breakpoint is unregistered.  This introduces an
arch-specific hook in release_bp_slot() along with a weak definition
in the form of a stub function.

Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
kernel/hw_breakpoint.c

index 7a56b22e0602f0b37338c189110d65c07e7cc730..71ed3ce29e12e7d2dbe25d9e4b92e8d46a71fecd 100644 (file)
@@ -241,6 +241,17 @@ toggle_bp_slot(struct perf_event *bp, bool enable, enum bp_type_idx type,
                per_cpu(nr_cpu_bp_pinned[type], bp->cpu) -= weight;
 }
 
+/*
+ * Function to perform processor-specific cleanup during unregistration
+ */
+__weak void arch_unregister_hw_breakpoint(struct perf_event *bp)
+{
+       /*
+        * A weak stub function here for those archs that don't define
+        * it inside arch/.../kernel/hw_breakpoint.c
+        */
+}
+
 /*
  * Contraints to check before allowing this new breakpoint counter:
  *
@@ -339,6 +350,7 @@ void release_bp_slot(struct perf_event *bp)
 {
        mutex_lock(&nr_bp_mutex);
 
+       arch_unregister_hw_breakpoint(bp);
        __release_bp_slot(bp);
 
        mutex_unlock(&nr_bp_mutex);