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
This commit is contained in:
Mark Johnston 2022-09-29 09:44:39 -04:00
parent bf7022dee6
commit 19a847e5f2
4 changed files with 69 additions and 1 deletions

View File

@ -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 $?

View File

@ -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

View File

@ -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"

View File

@ -253,6 +253,8 @@
amd64
arrays
..
kinst
..
..
..
zfsd