mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 01:51:00 +03:00
Add FreeBSD core handling in zloop.sh
And use the correct path to libtool and ztest. Reviewed-By: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@ixsystems.com> Closes #9790
This commit is contained in:
parent
82e996c261
commit
54007c791f
@ -25,7 +25,7 @@ define EXTRA_ENVIRONMENT
|
||||
|
||||
# Only required for in-tree use
|
||||
export INTREE="yes"
|
||||
export GDB="/usr/bin/libtool --mode=execute gdb"
|
||||
export GDB="libtool --mode=execute gdb"
|
||||
export LDMOD=/sbin/insmod
|
||||
|
||||
export CMD_DIR=@abs_top_builddir@/cmd
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# CDDL HEADER START
|
||||
@ -70,6 +70,11 @@ function or_die
|
||||
fi
|
||||
}
|
||||
|
||||
case $(uname) in
|
||||
FreeBSD)
|
||||
coreglob="z*.core"
|
||||
;;
|
||||
Linux)
|
||||
# core file helpers
|
||||
origcorepattern="$(cat /proc/sys/kernel/core_pattern)"
|
||||
coreglob="$(grep -E -o '^([^|%[:space:]]*)' /proc/sys/kernel/core_pattern)*"
|
||||
@ -80,6 +85,11 @@ if [[ $coreglob = "*" ]]; then
|
||||
coreglob="$(grep -E -o '^([^|%[:space:]]*)' \
|
||||
/proc/sys/kernel/core_pattern)*"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
function core_file
|
||||
{
|
||||
@ -108,7 +118,7 @@ function store_core
|
||||
foundcrashes=$((foundcrashes + 1))
|
||||
|
||||
# zdb debugging
|
||||
zdbcmd="$ZDB -U "$workdir/zpool.cache" -dddMmDDG ztest"
|
||||
zdbcmd="$ZDB -U "$workdir/zpool.cache" -dddMmDDG $ZTEST"
|
||||
zdbdebug=$($zdbcmd 2>&1)
|
||||
echo -e "$zdbcmd\n" >>ztest.zdb
|
||||
echo "$zdbdebug" >>ztest.zdb
|
||||
@ -278,8 +288,14 @@ done
|
||||
|
||||
echo "zloop finished, $foundcrashes crashes found"
|
||||
|
||||
#restore core pattern
|
||||
# restore core pattern.
|
||||
case $(uname) in
|
||||
Linux)
|
||||
echo "$origcorepattern" > /proc/sys/kernel/core_pattern
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
uptime >>ztest.out
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user