From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29903 invoked by alias); 1 Apr 2011 14:45:41 -0000 Received: (qmail 29894 invoked by uid 22791); 1 Apr 2011 14:45:38 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e23smtp05.au.ibm.com (HELO e23smtp05.au.ibm.com) (202.81.31.147) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Apr 2011 14:45:32 +0000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp05.au.ibm.com (8.14.4/8.13.1) with ESMTP id p31Edjox017921 for ; Sat, 2 Apr 2011 01:39:45 +1100 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p31EjUTD2408568 for ; Sat, 2 Apr 2011 01:45:30 +1100 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p31EjSJB013396 for ; Sat, 2 Apr 2011 01:45:30 +1100 Received: from localhost6.localdomain6 ([9.124.31.43]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p31EjOa0013331; Sat, 2 Apr 2011 01:45:24 +1100 From: Srikar Dronamraju To: Peter Zijlstra , Ingo Molnar Cc: Steven Rostedt , Srikar Dronamraju , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Masami Hiramatsu , Ananth N Mavinakayanahalli , Christoph Hellwig , Andi Kleen , Thomas Gleixner , Jonathan Corbet , Oleg Nesterov , LKML , Jim Keniston , Roland McGrath , SystemTap , Andrew Morton Date: Fri, 01 Apr 2011 14:45:00 -0000 Message-Id: <20110401143548.15455.81188.sendpatchset@localhost6.localdomain6> In-Reply-To: <20110401143223.15455.19844.sendpatchset@localhost6.localdomain6> References: <20110401143223.15455.19844.sendpatchset@localhost6.localdomain6> Subject: [PATCH v3 2.6.39-rc1-tip 17/26] 17: uprobes: register a notifier for uprobes. X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2011-q2/txt/msg00025.txt.bz2 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 e0ff6ba..cdd52d0 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 @@ -1387,3 +1388,20 @@ 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) +{ + return register_die_notifier(&uprobes_exception_nb); +} + +static void __exit exit_uprobes(void) +{ +} + +module_init(init_uprobes); +module_exit(exit_uprobes);