summaryrefslogtreecommitdiffstats
path: root/scripts/zfs.sh
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-06-11 22:48:49 -0700
committerBrian Behlendorf <[email protected]>2011-06-13 13:50:21 -0700
commit10715a018760e1d862b8348e31dc505e832a0904 (patch)
tree90bd62ef2e90baee121b556b0dad750aad080d77 /scripts/zfs.sh
parentda88a7fbe8876437c25f1006f91ca5595659b8d2 (diff)
Add default stack checking
When your kernel is built with kernel stack tracing enabled and you have the debugfs filesystem mounted. Then the zfs.sh script will clear the worst observed kernel stack depth on module load and check the worst case usage on module removal. If the stack depth ever exceeds 7000 bytes the full stack will be printed for debugging. This is dangerously close to overrunning the default 8k stack. This additional advisory debugging is particularly valuable when running the regression tests on a kernel built with 16k stacks. In this case, almost no matter how bad the stack overrun is you will see be able to get a clean stack trace for debugging. Since the worst case stack usage can be highly variable it's helpful to always check the worst case usage.
Diffstat (limited to 'scripts/zfs.sh')
-rwxr-xr-xscripts/zfs.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/zfs.sh b/scripts/zfs.sh
index 4a707fabf..f44053e88 100755
--- a/scripts/zfs.sh
+++ b/scripts/zfs.sh
@@ -66,8 +66,10 @@ fi
if [ ${UNLOAD} ]; then
umount -t zfs -a
+ stack_check
unload_modules
else
+ stack_clear
check_modules || die "${ERROR}"
load_modules "$@"
wait_udev /dev/zfs 30