summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2013-06-02 00:33:36 +0000
committermarkj <markj@FreeBSD.org>2013-06-02 00:33:36 +0000
commitf492c31639eaf495f9f716a99298e803ce0bf00a (patch)
treebd10fe39d58ea76d935a08e5dab37edac08f352b /cddl
parent9e2431c34dc087e0ff7bb1a5ae076865b37fd54e (diff)
downloadFreeBSD-src-f492c31639eaf495f9f716a99298e803ce0bf00a.zip
FreeBSD-src-f492c31639eaf495f9f716a99298e803ce0bf00a.tar.gz
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.
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c20
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d4
2 files changed, 11 insertions, 13 deletions
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 <sys/types.h>
+#include <sys/sysctl.h>
+
+#include <err.h>
#include <unistd.h>
-#ifndef __FreeBSD__
-#include <sys/uadmin.h>
-#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);
}
OpenPOWER on IntegriCloud