From 255102e84efecdf44f9f023a4ec8cf211d665591 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Mon, 12 Dec 2022 12:52:16 +0300 Subject: [PATCH] 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 --- lustre/scripts/lustre_rmmod | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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' } -- 1.8.3.1