Whamcloud - gitweb
LU-16384 tests: dump lustre log if DEBUG_RMMOD set 74/49374/5
authorAlex Zhuravlev <bzzz@whamcloud.com>
Mon, 12 Dec 2022 09:52:16 +0000 (12:52 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 3 Jan 2023 21:33:46 +0000 (21:33 +0000)
just to simplify local development and use existing code in
lustre_rmmod script:
DEBUG_RMMOD=<logfile> sh sanity.sh will dump a text lustre log to <logfile>.
it can be DEBUG_RMMOD=- to direct lustre log to standard output.

Test-Parameters: trivial
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I8d72e1e9cecb354bcc5d41ab3cca5767a298c668
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49374
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/scripts/lustre_rmmod

index d8be9d3..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'
 }