1#!/usr/bin/ksh
2#
3# This file and its contents are supplied under the terms of the
4# Common Development and Distribution License ("CDDL"), version 1.0.
5# You may only use this file in accordance with the terms of version
6# 1.0 of the CDDL.
7#
8# A full copy of the text of the CDDL should have accompanied this
9# source.  A copy of the CDDL is also available via the Internet at
10# http://www.illumos.org/license/CDDL.
11#
12
13#
14# Copyright (c) 2022 Mark Johnston <markj@FreeBSD.org>
15#
16
17script()
18{
19	$dtrace -q -s /dev/stdin <<__EOF__
20kinst::vm_fault: {}
21kinst::amd64_syscall: {}
22kinst::exit1: {}
23kinst::spinlock_enter: {}
24kinst::memcpy: {}
25
26tick-10s {exit(0);}
27__EOF__
28}
29
30spin()
31{
32	while true; do
33		ls -la / >/dev/null 2>&1
34	done
35}
36
37if [ $# != 1 ]; then
38	echo expected one argument: '<'dtrace-path'>'
39	exit 2
40fi
41
42dtrace=$1
43
44spin &
45child=$!
46
47script
48exit $?
49