Commit f7136c5150c29846d7a1d09109449d96b2f63445

Authored by K.Prasad
Committed by Paul Mackerras
1 parent 0016a4cf55

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>

Showing 1 changed file with 12 additions and 0 deletions Side-by-side Diff

kernel/hw_breakpoint.c
... ... @@ -242,6 +242,17 @@
242 242 }
243 243  
244 244 /*
  245 + * Function to perform processor-specific cleanup during unregistration
  246 + */
  247 +__weak void arch_unregister_hw_breakpoint(struct perf_event *bp)
  248 +{
  249 + /*
  250 + * A weak stub function here for those archs that don't define
  251 + * it inside arch/.../kernel/hw_breakpoint.c
  252 + */
  253 +}
  254 +
  255 +/*
245 256 * Contraints to check before allowing this new breakpoint counter:
246 257 *
247 258 * == Non-pinned counter == (Considered as pinned for now)
... ... @@ -339,6 +350,7 @@
339 350 {
340 351 mutex_lock(&nr_bp_mutex);
341 352  
  353 + arch_unregister_hw_breakpoint(bp);
342 354 __release_bp_slot(bp);
343 355  
344 356 mutex_unlock(&nr_bp_mutex);