From owner-p4-projects@FreeBSD.ORG Mon Jun 30 07:11:32 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4177D1065681; Mon, 30 Jun 2008 07:11:32 +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 02C521065679 for ; Mon, 30 Jun 2008 07:11:32 +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 E554D8FC13 for ; Mon, 30 Jun 2008 07:11:31 +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 m5U7BVjJ003208 for ; Mon, 30 Jun 2008 07:11:31 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m5U7BVt2003206 for perforce@freebsd.org; Mon, 30 Jun 2008 07:11:31 GMT (envelope-from jb@freebsd.org) Date: Mon, 30 Jun 2008 07:11:31 GMT Message-Id: <200806300711.m5U7BVt2003206@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 144352 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: Mon, 30 Jun 2008 07:11:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=144352 Change 144352 by jb@freebsd3 on 2008/06/30 07:10:37 Add hooks for the 32-bit syscalls. Affected files ... .. //depot/projects/dtrace/src/sys/amd64/ia32/ia32_syscall.c#8 edit Differences ... ==== //depot/projects/dtrace/src/sys/amd64/ia32/ia32_syscall.c#8 (text+ko) ==== @@ -45,6 +45,7 @@ #include "opt_clock.h" #include "opt_cpu.h" #include "opt_isa.h" +#include "opt_kdtrace.h" #include "opt_ktrace.h" #include @@ -81,6 +82,10 @@ #include #include +#ifdef KDTRACE_HOOKS +#include +#endif + #define IDTVEC(name) __CONCAT(X,name) extern inthand_t IDTVEC(int0x80_syscall), IDTVEC(rsvd); @@ -178,9 +183,34 @@ PTRACESTOP_SC(p, td, S_PT_SCE); +#ifdef KDTRACE_HOOKS + /* + * If the systrace module has registered it's probe + * callback and if there is a probe active for the + * syscall 'entry', process the probe. + */ + if (systrace_probe_func != NULL && callp->sy_entry != 0) + (*systrace_probe_func)(callp->sy_entry, code, callp, + args64); +#endif + AUDIT_SYSCALL_ENTER(code, td); error = (*callp->sy_call)(td, args64); AUDIT_SYSCALL_EXIT(error, td); + + /* Save the latest error return value. */ + td->td_errno = error; + +#ifdef KDTRACE_HOOKS + /* + * If the systrace module has registered it's probe + * callback and if there is a probe active for the + * syscall 'return', process the probe. + */ + if (systrace_probe_func != NULL && callp->sy_return != 0) + (*systrace_probe_func)(callp->sy_return, code, callp, + args64); +#endif } switch (error) {