mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-06 16:40:47 +00:00
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:
parent
bf7022dee6
commit
19a847e5f2
|
@ -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 $?
|
|
@ -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
|
||||
|
|
19
cddl/usr.sbin/dtrace/tests/amd64/kinst/Makefile
Normal file
19
cddl/usr.sbin/dtrace/tests/amd64/kinst/Makefile
Normal 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"
|
|
@ -253,6 +253,8 @@
|
|||
amd64
|
||||
arrays
|
||||
..
|
||||
kinst
|
||||
..
|
||||
..
|
||||
..
|
||||
zfsd
|
||||
|
|
Loading…
Reference in a new issue