Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754575Ab1FGNIF (ORCPT ); Tue, 7 Jun 2011 09:08:05 -0400 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:60698 "EHLO e28smtp06.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754059Ab1FGNIA (ORCPT ); Tue, 7 Jun 2011 09:08:00 -0400 From: Srikar Dronamraju To: Peter Zijlstra , Ingo Molnar Cc: Steven Rostedt , Srikar Dronamraju , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Jonathan Corbet , Hugh Dickins , Christoph Hellwig , Masami Hiramatsu , Thomas Gleixner , Andi Kleen , Oleg Nesterov , LKML , Jim Keniston , Roland McGrath , Ananth N Mavinakayanahalli , Andrew Morton Date: Tue, 07 Jun 2011 18:31:11 +0530 Message-Id: <20110607130111.28590.12029.sendpatchset@localhost6.localdomain6> In-Reply-To: <20110607125804.28590.92092.sendpatchset@localhost6.localdomain6> References: <20110607125804.28590.92092.sendpatchset@localhost6.localdomain6> Subject: [PATCH v4 3.0-rc2-tip 15/22] 15: 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: 1557 Lines: 48 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 | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/kernel/uprobes.c b/kernel/uprobes.c index 1e88d64..95c16dd 100644 --- a/kernel/uprobes.c +++ b/kernel/uprobes.c @@ -36,6 +36,7 @@ #include /* needed for PROT_EXEC, MAP_PRIVATE */ #include /* needed for fput() */ #include /* init_cred */ +#include /* for notifier mechanism */ #define UINSNS_PER_PAGE (PAGE_SIZE/UPROBES_XOL_SLOT_BYTES) #define MAX_UPROBES_XOL_SLOTS UINSNS_PER_PAGE @@ -1456,3 +1457,20 @@ int uprobe_post_notifier(struct pt_regs *regs) set_thread_flag(TIF_UPROBE); return 1; } + +struct notifier_block uprobe_exception_nb = { + .notifier_call = uprobe_exception_notify, + .priority = INT_MAX - 1, /* notified after kprobes, kgdb */ +}; + +static int __init init_uprobes(void) +{ + return register_die_notifier(&uprobe_exception_nb); +} + +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/