From owner-p4-projects@FreeBSD.ORG Tue Feb 5 05:38:06 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2FF0616A41A; Tue, 5 Feb 2008 05:38:06 +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 D186E16A418 for ; Tue, 5 Feb 2008 05:38:05 +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 C280213C455 for ; Tue, 5 Feb 2008 05:38:05 +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 m155c5fV098617 for ; Tue, 5 Feb 2008 05:38:05 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m155c5rc098614 for perforce@freebsd.org; Tue, 5 Feb 2008 05:38:05 GMT (envelope-from jb@freebsd.org) Date: Tue, 5 Feb 2008 05:38:05 GMT Message-Id: <200802050538.m155c5rc098614@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 134819 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, 05 Feb 2008 05:38:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=134819 Change 134819 by jb@jb_freebsd1 on 2008/02/05 05:37:35 Follow-up change to match the fact that entry and return probes have the same arguments. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/systrace/systrace.c#8 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/systrace/systrace.c#8 (text+ko) ==== @@ -75,6 +75,7 @@ static d_open_t systrace_open; static int systrace_unload(void); +static void systrace_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); static void systrace_args(int, void *, u_int64_t *, int *); static void systrace_probe(u_int32_t, int, struct sysent *, void *); static void systrace_provide(void *, dtrace_probedesc_t *); @@ -104,7 +105,7 @@ systrace_disable, NULL, NULL, - NULL, + systrace_getargdesc, NULL, NULL, systrace_destroy @@ -119,33 +120,18 @@ */ #include -/* ARGSUSED */ static void systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params) { int n_args = 0; u_int64_t uargs[8]; - /* Is this a return syscall? */ - if (sysent == NULL) { - /* - * Yes. Just convert the first two parameters which are - * both set to the return error number. - */ - int64_t *iargs = (int64_t *) uargs; - int *iparams = (int *) params; - iargs[0] = iparams[0]; - iargs[1] = iparams[1]; - uargs[2] = 0; - uargs[3] = 0; - uargs[4] = 0; - /* * Check if this syscall has a custom argument conversion * function registered. If so, it is a syscall registered * by a loaded module. */ - } else if (sysent->sy_systrace_args_func != NULL) + if (sysent->sy_systrace_args_func != NULL) /* * Convert the syscall parameters using the registered * function. @@ -164,7 +150,17 @@ dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]); } -/*ARGSUSED*/ +static void +systrace_getargdesc(void *arg, dtrace_id_t id, void *parg, dtrace_argdesc_t *desc) +{ + int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg); + + systrace_setargdesc(sysnum, desc->dtargd_ndx, desc->dtargd_native, + sizeof(desc->dtargd_native)); + + return; +} + static void systrace_provide(void *arg, dtrace_probedesc_t *desc) { @@ -187,7 +183,6 @@ } } -/* ARGSUSED */ static void systrace_destroy(void *arg, dtrace_id_t id, void *parg) { @@ -206,7 +201,6 @@ #endif } -/* ARGSUSED */ static void systrace_enable(void *arg, dtrace_id_t id, void *parg) { @@ -218,7 +212,6 @@ sysent[sysnum].sy_return = id; } -/* ARGSUSED */ static void systrace_disable(void *arg, dtrace_id_t id, void *parg) { @@ -258,7 +251,6 @@ return (error); } -/* ARGSUSED */ static int systrace_modevent(module_t mod __unused, int type, void *data __unused) { @@ -282,7 +274,6 @@ return (error); } -/* ARGSUSED */ static int systrace_open(struct cdev *dev __unused, int oflags __unused, int devtype __unused, struct thread *td __unused) {