summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorK.Prasad <prasad@linux.vnet.ibm.com>2010-06-15 11:34:34 +0530
committerPaul Mackerras <paulus@samba.org>2010-06-22 19:40:50 +1000
commitf7136c5150c29846d7a1d09109449d96b2f63445 (patch)
tree7e961ac7d78ee8322d136f7a6d4da03a6ad2cda7 /kernel
parent0016a4cf5582415849fafbf9f019dd9530824789 (diff)
downloadop-kernel-dev-f7136c5150c29846d7a1d09109449d96b2f63445.zip
op-kernel-dev-f7136c5150c29846d7a1d09109449d96b2f63445.tar.gz
hw_breakpoints: Allow arch-specific cleanup before breakpoint unregistration
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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/hw_breakpoint.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c
index 7a56b22..71ed3ce 100644
--- a/kernel/hw_breakpoint.c
+++ b/kernel/hw_breakpoint.c
@@ -242,6 +242,17 @@ toggle_bp_slot(struct perf_event *bp, bool enable, enum bp_type_idx type,
}
/*
+ * 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:
*
* == Non-pinned counter == (Considered as pinned for now)
@@ -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);
OpenPOWER on IntegriCloud