From owner-svn-src-stable@FreeBSD.ORG Fri Jan 17 11:13:46 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D64330F; Fri, 17 Jan 2014 11:13:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 579601791; Fri, 17 Jan 2014 11:13:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0HBDk87037725; Fri, 17 Jan 2014 11:13:46 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0HBDj3Y037719; Fri, 17 Jan 2014 11:13:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201401171113.s0HBDj3Y037719@svn.freebsd.org> From: Andriy Gapon Date: Fri, 17 Jan 2014 11:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r260820 - in stable/9: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt sys/cddl/dev/dtrace sys/modules/dtrace/dtrace_test X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jan 2014 11:13:46 -0000 Author: avg Date: Fri Jan 17 11:13:45 2014 New Revision: 260820 URL: http://svnweb.freebsd.org/changeset/base/260820 Log: MFC r251237: Port the SDT test Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d stable/9/sys/cddl/dev/dtrace/dtrace_test.c stable/9/sys/modules/dtrace/dtrace_test/Makefile Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c Fri Jan 17 11:09:05 2014 (r260819) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c Fri Jan 17 11:13:45 2014 (r260820) @@ -26,26 +26,24 @@ #pragma ident "%Z%%M% %I% %E% SMI" +#include +#include + +#include #include -#ifndef __FreeBSD__ -#include -#endif int main(int argc, char **argv) { -#ifdef __FreeBSD__ - return (1); -#else + int val = 1; + while (1) { - if (uadmin(A_SDTTEST, 0, 0) < 0) { - perror("uadmin"); - return (1); - } + if (sysctlbyname("debug.dtracetest.sdttest", NULL, NULL, &val, + sizeof(val))) + err(1, "sysctlbyname"); sleep(1); } return (0); -#endif } Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d Fri Jan 17 11:09:05 2014 (r260819) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d Fri Jan 17 11:13:45 2014 (r260820) @@ -43,7 +43,7 @@ ERROR exit(1); } -sdt:::test +test:::sdttest /arg0 != 1 || arg1 != 2 || arg2 != 3 || arg3 != 4 || arg4 != 5 || arg5 != 6 || arg6 != 7/ { @@ -54,7 +54,7 @@ sdt:::test exit(1); } -sdt:::test +test:::sdttest { exit(0); } Modified: stable/9/sys/cddl/dev/dtrace/dtrace_test.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_test.c Fri Jan 17 11:09:05 2014 (r260819) +++ stable/9/sys/cddl/dev/dtrace/dtrace_test.c Fri Jan 17 11:13:45 2014 (r260820) @@ -25,15 +25,25 @@ * $FreeBSD$ * */ +#include "opt_kdtrace.h" #include #include #include +#include + #include #include #include +#include +#include #include +SDT_PROVIDER_DEFINE(test); + +SDT_PROBE_DEFINE7(test, , , sdttest, sdttest, "int", "int", "int", "int", "int", + "int", "int"); + /* * These are variables that the DTrace test suite references in the * Solaris kernel. We define them here so that the tests function @@ -45,6 +55,33 @@ typedef struct vnode vnode_t; vnode_t dummy; vnode_t *rootvp = &dummy; +/* + * Test SDT probes with more than 5 arguments. On amd64, such probes require + * special handling since only the first 5 arguments will be passed to + * dtrace_probe() in registers; the rest must be fetched off the stack. + */ +static int +dtrace_test_sdttest(SYSCTL_HANDLER_ARGS) +{ + int val, error; + + val = 0; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || req->newptr == NULL) + return (error); + else if (val == 0) + return (0); + + SDT_PROBE7(test, , , sdttest, 1, 2, 3, 4, 5, 6, 7); + + return (error); +} + +static SYSCTL_NODE(_debug, OID_AUTO, dtracetest, CTLFLAG_RD, 0, ""); + +SYSCTL_PROC(_debug_dtracetest, OID_AUTO, sdttest, CTLTYPE_INT | CTLFLAG_RW, + NULL, 0, dtrace_test_sdttest, "I", "Trigger the SDT test probe"); + static int dtrace_test_modevent(module_t mod, int type, void *data) { Modified: stable/9/sys/modules/dtrace/dtrace_test/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/dtrace_test/Makefile Fri Jan 17 11:09:05 2014 (r260819) +++ stable/9/sys/modules/dtrace/dtrace_test/Makefile Fri Jan 17 11:13:45 2014 (r260820) @@ -5,8 +5,9 @@ KMOD= dtrace_test SRCS= dtrace_test.c +SRCS+= opt_kdtrace.h SRCS+= vnode_if.h - + CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -D_KERNEL