Whamcloud - gitweb
LU-16384 tests: dump lustre log if DEBUG_RMMOD set
[fs/lustre-release.git] / lustre / scripts / lustre_rmmod
index b31c34e..9dca753 100755 (executable)
@@ -8,6 +8,7 @@
 SCRIPT_NAME="$(basename "$0")"
 LCTL=${LCTL:-lctl}
 DEBUG='false'
+[[ -n $DEBUG_RMMOD ]] && DEBUG='true'
 
 # Print help message
 print_usage() {
@@ -23,8 +24,14 @@ print_usage() {
 
 # Print kernel debug message for lustre modules
 print_debug() {
+       local debug_file
        $LCTL mark "$SCRIPT_NAME : Stop debug"
-       $LCTL debug_kernel
+       if [[ $DEBUG_RMMOD == "-" ]]; then
+               debug_file="" # dump to stdout
+       else
+               debug_file=$DEBUG_RMMOD
+       fi
+       $LCTL debug_kernel $debug_file
        DEBUG='false'
 }
 
@@ -125,7 +132,7 @@ if $unload_all; then
        if [ -n "$(which lnetctl 2>/dev/null)" ]; then
                lnetctl lnet unconfigure 2>/dev/null
        elif [ -n "$(which lctl 2>/dev/null)" ]; then
-               lctl net down 2>/dev/null
+               lctl net down 2>/dev/null | grep -v "LNET ready to unload"
        fi
 fi