From f492c31639eaf495f9f716a99298e803ce0bf00a Mon Sep 17 00:00:00 2001 From: markj Date: Sun, 2 Jun 2013 00:33:36 +0000 Subject: Port the SDT test now that it's possible to create SDT probes that take seven arguments. The original test uses Solaris' uadmin system call to trigger the test probe; this change adds a sysctl to the dtrace_test module and gets the test program to trigger the test probe via the sysctl handler. The test is currently failing on amd64 because of some bugs in the way that probe arguments beyond the first five are obtained - these bugs will be fixed in a separate change. --- .../cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c | 20 +++++++++----------- .../cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d | 4 ++-- 2 files changed, 11 insertions(+), 13 deletions(-) (limited to 'cddl/contrib/opensolaris') diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c index e2e9505..013a9e7 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c @@ -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 } diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d index 0523de0..e965b05 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d @@ -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); } -- cgit v1.1