From owner-p4-projects@FreeBSD.ORG Tue May 27 06:26:21 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D29821065670; Tue, 27 May 2008 06:26:21 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94ECE106566B for ; Tue, 27 May 2008 06:26:21 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 829258FC2F for ; Tue, 27 May 2008 06:26:21 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4R6QLDX048475 for ; Tue, 27 May 2008 06:26:21 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4R6QLW1048473 for perforce@freebsd.org; Tue, 27 May 2008 06:26:21 GMT (envelope-from jb@freebsd.org) Date: Tue, 27 May 2008 06:26:21 GMT Message-Id: <200805270626.m4R6QLW1048473@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 142368 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2008 06:26:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=142368 Change 142368 by jb@freebsd3 on 2008/05/27 06:25:53 Add a hook for the double trap handler. Only process trap types that could be relevant to DTrace. Affected files ... .. //depot/projects/dtrace7/src/sys/i386/i386/trap.c#4 edit Differences ... ==== //depot/projects/dtrace7/src/sys/i386/i386/trap.c#4 (text+ko) ==== @@ -113,6 +113,8 @@ */ dtrace_trap_func_t dtrace_trap_func; +dtrace_doubletrap_func_t dtrace_doubletrap_func; + /* * This is a hook which is initialised by the systrace module * when it is loaded. This keeps the DTrace syscall provider @@ -251,7 +253,8 @@ * handled the trap and modified the trap frame so that this * function can return normally. */ - if (dtrace_trap_func != NULL) + if ((type == T_PROTFLT || type == T_PAGEFLT) && + dtrace_trap_func != NULL) if ((*dtrace_trap_func)(frame, type)) goto out; #endif @@ -953,6 +956,10 @@ void dblfault_handler() { +#ifdef KDTRACE_HOOKS + if (dtrace_doubletrap_func != NULL) + (*dtrace_doubletrap_func)(); +#endif printf("\nFatal double fault:\n"); printf("eip = 0x%x\n", PCPU_GET(common_tss.tss_eip)); printf("esp = 0x%x\n", PCPU_GET(common_tss.tss_esp));