aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/cmd/dtrace
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2022-09-29 13:44:39 +0000
committerMark Johnston <markj@FreeBSD.org>2022-10-11 22:19:55 +0000
commit19a847e5f2820202243b04f73017a9e7def63d11 (patch)
tree6110f4c514fa0fbaa17ecc1d317968d19cf927c2 /cddl/contrib/opensolaris/cmd/dtrace
parentbf7022dee6362a896465f31461eb482a8d6b73eb (diff)
downloadsrc-19a847e5f2820202243b04f73017a9e7def63d11.tar.gz
src-19a847e5f2820202243b04f73017a9e7def63d11.zip
kinst: Add a rudimentary regression test case
The test instruments a number of large, frequently called kernel functions while generating load in the background. MFC after: 3 months
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/dtrace')
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/kinst/tst.basic.ksh46
1 files changed, 46 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/kinst/tst.basic.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/kinst/tst.basic.ksh
new file mode 100644
index 000000000000..23019fb41f41
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/kinst/tst.basic.ksh
@@ -0,0 +1,46 @@
+#!/usr/bin/ksh
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2022 Mark Johnston <markj@FreeBSD.org>
+#
+
+script()
+{
+ $dtrace -q -s /dev/stdin <<__EOF__
+kinst::vm_fault: {}
+kinst::amd64_syscall: {}
+kinst::exit1: {}
+
+tick-10s {exit(0);}
+__EOF__
+}
+
+spin()
+{
+ while true; do
+ ls -la / >/dev/null 2>&1
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+spin &
+child=$!
+
+script
+exit $?