From 33c57308b63d413907a5fc3579ee1bcb78cfe2a6 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 23 Sep 2024 15:53:52 -0700 Subject: [PATCH] sof-kernel-log-check.sh: add new "${sof_local_extra_kernel_ignores[@]}" Leverage the new local_config.bash files to implement device-specific excludes. Signed-off-by: Marc Herbert --- tools/sof-kernel-log-check.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/sof-kernel-log-check.sh b/tools/sof-kernel-log-check.sh index 2accf9bd..626e0e2d 100755 --- a/tools/sof-kernel-log-check.sh +++ b/tools/sof-kernel-log-check.sh @@ -419,6 +419,18 @@ ignore_str="$ignore_str"'|nvme0: Admin Cmd\(0x[[:digit:]]+\), I/O Error \(sct 0x # SDW related logs # +# This expects an array like for instance: +# sof_local_extra_kernel_ignores=(-e 'error 1' -e err2) +# Arrays +# - provide whitespace/quoting safety +# - can be empty/optional +# - can be arbitrarily complex. Best avoided but only on specific systems anyway. +# shellcheck disable=SC2154 +if &>/dev/null declare -p sof_local_extra_kernel_ignores; then + dlogw "Ignoring extra errors on this particular system:" + declare -p sof_local_extra_kernel_ignores +fi + # confirm begin_timestamp is in UNIX timestamp format, otherwise search full log if [[ $begin_timestamp =~ ^[0-9]{10} ]]; then cmd="journalctl_cmd --since=@$begin_timestamp" @@ -429,7 +441,7 @@ fi declare -p cmd if err=$($cmd --priority=err | - grep -v -E -e "$ignore_str"); then + grep -v -E -e "$ignore_str" "${sof_local_extra_kernel_ignores[@]}"); then type journalctl_cmd echo "$(date -u '+%Y-%m-%d %T %Z')" "[ERROR]" "Caught kernel log error"