From patchwork Mon May 24 10:32:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "K.Prasad" X-Patchwork-Id: 53426 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 88B4DB7F9B for ; Tue, 25 May 2010 00:09:58 +1000 (EST) Received: by ozlabs.org (Postfix) id CDBC7B7D29; Tue, 25 May 2010 00:09:51 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from e28smtp04.in.ibm.com (e28smtp04.in.ibm.com [122.248.162.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e28smtp04.in.ibm.com", Issuer "Equifax" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 98C31B7D27 for ; Tue, 25 May 2010 00:09:50 +1000 (EST) Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by e28smtp04.in.ibm.com (8.14.3/8.13.1) with ESMTP id o4OE4eqf018558 for ; Mon, 24 May 2010 19:39:33 +0530 Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o4OAX9uI860230 for ; Mon, 24 May 2010 16:03:22 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o4OAX8Qq012742 for ; Mon, 24 May 2010 20:33:08 +1000 Received: from in.ibm.com ([9.77.126.180]) by d28av02.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o4OAX5il011546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 24 May 2010 20:33:06 +1000 Date: Mon, 24 May 2010 16:02:23 +0530 From: "K.Prasad" To: "linuxppc-dev@ozlabs.org" , Paul Mackerras Subject: [Patch 1/4] Allow arch-specific cleanup before breakpoint unregistration Message-ID: <20100524103223.GB8131@in.ibm.com> References: <20100524102614.040177456@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline; filename=arch_unregister_hbp_02 User-Agent: Mutt/1.5.19 (2009-01-05) Cc: Michael Neuling , Benjamin Herrenschmidt , shaggy@linux.vnet.ibm.com, Frederic Weisbecker , David Gibson , Alan Stern , "K.Prasad" , Roland McGrath X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Certain architectures (such as PowerPC Book III S) have a need to cleanup data-structures before the breakpoint is unregistered. This patch introduces an arch-specific hook in release_bp_slot() along with a weak definition in the form of a stub funciton. Signed-off-by: K.Prasad --- kernel/hw_breakpoint.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) Index: linux-2.6.ppc64_test/kernel/hw_breakpoint.c =================================================================== --- linux-2.6.ppc64_test.orig/kernel/hw_breakpoint.c +++ linux-2.6.ppc64_test/kernel/hw_breakpoint.c @@ -242,6 +242,17 @@ toggle_bp_slot(struct perf_event *bp, bo } /* + * 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 * { mutex_lock(&nr_bp_mutex); + arch_unregister_hw_breakpoint(bp); __release_bp_slot(bp); mutex_unlock(&nr_bp_mutex);