Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756495Ab1CNNmz (ORCPT ); Mon, 14 Mar 2011 09:42:55 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:53770 "EHLO e23smtp02.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756028Ab1CNNmx (ORCPT ); Mon, 14 Mar 2011 09:42:53 -0400 From: Srikar Dronamraju To: Peter Zijlstra , Ingo Molnar Cc: Steven Rostedt , Srikar Dronamraju , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Masami Hiramatsu , Christoph Hellwig , Ananth N Mavinakayanahalli , Andi Kleen , Oleg Nesterov , Andrew Morton , Jim Keniston , Roland McGrath , SystemTap , LKML , "Paul E. McKenney" Date: Mon, 14 Mar 2011 19:07:08 +0530 Message-Id: <20110314133708.27435.81257.sendpatchset@localhost6.localdomain6> In-Reply-To: <20110314133403.27435.7901.sendpatchset@localhost6.localdomain6> References: <20110314133403.27435.7901.sendpatchset@localhost6.localdomain6> Subject: [PATCH v2 2.6.38-rc8-tip 16/20] 16: uprobes: register a notifier for uprobes. Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1523 Lines: 49 Uprobe needs to be intimated on int3 and singlestep exceptions. Hence uprobes registers a die notifier so that its notified of the events. Signed-off-by: Ananth N Mavinakayanahalli Signed-off-by: Srikar Dronamraju --- kernel/uprobes.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/kernel/uprobes.c b/kernel/uprobes.c index d8d4574..bbedcef 100644 --- a/kernel/uprobes.c +++ b/kernel/uprobes.c @@ -33,6 +33,7 @@ #include /* needed for anon_vma_prepare */ #include /* needed for PROT_EXEC, MAP_PRIVATE */ #include /* needed for fput() */ +#include /* needed for notifier mechanism */ #define UINSNS_PER_PAGE (PAGE_SIZE/UPROBES_XOL_SLOT_BYTES) #define MAX_UPROBES_XOL_SLOTS UINSNS_PER_PAGE @@ -1242,3 +1243,21 @@ int uprobe_post_notifier(struct pt_regs *regs) } return 0; } + +struct notifier_block uprobes_exception_nb = { + .notifier_call = uprobes_exception_notify, + .priority = 0x7ffffff0, +}; + +static int __init init_uprobes(void) +{ + register_die_notifier(&uprobes_exception_nb); + return 0; +} + +static void __exit exit_uprobes(void) +{ +} + +module_init(init_uprobes); +module_exit(exit_uprobes); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/