CLEANUP="yes"
CLEANUPALL="no"
LOOPBACK="yes"
+STACK_TRACER="no"
FILESIZE="4G"
RUNFILE=${RUNFILE:-"linux.run"}
FILEDIR=${FILEDIR:-/var/tmp}
usage() {
cat << EOF
USAGE:
-$0 [hvqxkf] [-s SIZE] [-r RUNFILE] [-t PATH] [-u USER]
+$0 [hvqxkfS] [-s SIZE] [-r RUNFILE] [-t PATH] [-u USER]
DESCRIPTION:
ZFS Test Suite launch script
-x Remove all testpools, dm, lo, and files (unsafe)
-k Disable cleanup after test failure
-f Use files only, disables block device tests
+ -S Enable stack tracer (negative performance impact)
-c Only create and populate constrained path
-I NUM Number of iterations
-d DIR Use DIR for files and loopback devices
EOF
}
-while getopts 'hvqxkfcd:s:r:?t:T:u:I:' OPTION; do
+while getopts 'hvqxkfScd:s:r:?t:T:u:I:' OPTION; do
case $OPTION in
h)
usage
f)
LOOPBACK="no"
;;
+ S)
+ STACK_TRACER="yes"
+ ;;
c)
constrain_path
exit
#
# Verify the ZFS module stack is loaded.
#
-sudo "${ZFS_SH}" &>/dev/null
+if [ "$STACK_TRACER" = "yes" ]; then
+ sudo "${ZFS_SH}" -S &>/dev/null
+else
+ sudo "${ZFS_SH}" &>/dev/null
+fi
#
# Attempt to cleanup all previous state for a new test run.
msg "FILESIZE: $FILESIZE"
msg "ITERATIONS: $ITERATIONS"
msg "TAGS: $TAGS"
+msg "STACK_TRACER: $STACK_TRACER"
msg "Keep pool(s): $KEEP"
msg "Missing util(s): $STF_MISSING_BIN"
msg ""
PROG=zfs.sh
VERBOSE="no"
UNLOAD="no"
+STACK_TRACER="no"
ZED_PIDFILE=${ZED_PIDFILE:-/var/run/zed.pid}
LDMOD=${LDMOD:-/sbin/modprobe}
usage() {
cat << EOF
USAGE:
-$0 [hvud] [module-options]
+$0 [hvudS] [module-options]
DESCRIPTION:
Load/unload the ZFS module stack.
-h Show this message
-v Verbose
-u Unload modules
+ -S Enable kernel stack tracer
EOF
}
-while getopts 'hvu' OPTION; do
+while getopts 'hvuS' OPTION; do
case $OPTION in
h)
usage
u)
UNLOAD="yes"
;;
+ S)
+ STACK_TRACER="yes"
+ ;;
?)
usage
exit
STACK_MAX_SIZE=/sys/kernel/debug/tracing/stack_max_size
STACK_TRACER_ENABLED=/proc/sys/kernel/stack_tracer_enabled
- if [ -e "$STACK_MAX_SIZE" ]; then
+ if [ "$STACK_TRACER" = "yes" ] && [ -e "$STACK_MAX_SIZE" ]; then
echo 1 >"$STACK_TRACER_ENABLED"
echo 0 >"$STACK_MAX_SIZE"
fi