diff options
author | Mark Johnston <markj@FreeBSD.org> | 2022-09-29 13:44:39 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2022-10-11 22:19:55 +0000 |
commit | 19a847e5f2820202243b04f73017a9e7def63d11 (patch) | |
tree | 6110f4c514fa0fbaa17ecc1d317968d19cf927c2 | |
parent | bf7022dee6362a896465f31461eb482a8d6b73eb (diff) | |
download | src-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
-rw-r--r-- | cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/kinst/tst.basic.ksh | 46 | ||||
-rw-r--r-- | cddl/usr.sbin/dtrace/tests/amd64/Makefile | 3 | ||||
-rw-r--r-- | cddl/usr.sbin/dtrace/tests/amd64/kinst/Makefile | 19 | ||||
-rw-r--r-- | etc/mtree/BSD.tests.dist | 2 |
4 files changed, 69 insertions, 1 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 $? diff --git a/cddl/usr.sbin/dtrace/tests/amd64/Makefile b/cddl/usr.sbin/dtrace/tests/amd64/Makefile index 39ccd333bedf..db421ea0880f 100644 --- a/cddl/usr.sbin/dtrace/tests/amd64/Makefile +++ b/cddl/usr.sbin/dtrace/tests/amd64/Makefile @@ -1,7 +1,8 @@ # $FreeBSD$ TESTSDIR= ${TESTSBASE}/cddl/usr.sbin/dtrace/amd64 -TESTS_SUBDIRS+= arrays +TESTS_SUBDIRS+= arrays \ + kinst .PATH: ${.CURDIR:H:H:H:H:H}/tests KYUAFILE= YES diff --git a/cddl/usr.sbin/dtrace/tests/amd64/kinst/Makefile b/cddl/usr.sbin/dtrace/tests/amd64/kinst/Makefile new file mode 100644 index 000000000000..52568df07e07 --- /dev/null +++ b/cddl/usr.sbin/dtrace/tests/amd64/kinst/Makefile @@ -0,0 +1,19 @@ +# $FreeBSD$ + +# +# This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. +# + +PACKAGE= tests + +${PACKAGE}FILES= \ + tst.basic.ksh \ + +TESTEXES= \ + + +CFILES= \ + + + +.include "../../dtrace.test.mk" diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 394b2ec90dcd..c83f720e1de3 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -253,6 +253,8 @@ amd64 arrays .. + kinst + .. .. .. zfsd |