From: Alex Zhuravlev Date: Mon, 12 Dec 2022 09:52:16 +0000 (+0300) Subject: LU-16384 tests: dump lustre log if DEBUG_RMMOD set X-Git-Tag: 2.15.54~147 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=255102e84efecdf44f9f023a4ec8cf211d665591;p=fs%2Flustre-release.git LU-16384 tests: dump lustre log if DEBUG_RMMOD set just to simplify local development and use existing code in lustre_rmmod script: DEBUG_RMMOD= sh sanity.sh will dump a text lustre log to . it can be DEBUG_RMMOD=- to direct lustre log to standard output. Test-Parameters: trivial Signed-off-by: Alex Zhuravlev Change-Id: I8d72e1e9cecb354bcc5d41ab3cca5767a298c668 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49374 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- diff --git a/lustre/scripts/lustre_rmmod b/lustre/scripts/lustre_rmmod index d8be9d3..9dca753 100755 --- a/lustre/scripts/lustre_rmmod +++ b/lustre/scripts/lustre_rmmod @@ -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' }