From 844ceebe90d3de5d3e0a67190ae22bbeb2d6daad Mon Sep 17 00:00:00 2001 From: Keqiao Zhang Date: Tue, 4 Jul 2023 14:26:42 +0800 Subject: [PATCH 1/3] lib.sh: refine the logger_disabled function On IPC4 platforms, we only check logger with Zephyr build firmware and no need to check the ldc file. The ldc file checking only when testing with IPC3 firmware. Signed-off-by: Keqiao Zhang --- case-lib/lib.sh | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/case-lib/lib.sh b/case-lib/lib.sh index 6318a53e..3fb6a8e6 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -752,16 +752,6 @@ is_ipc4() logger_disabled() { local ldcFile - # Some firmware/OS configurations do not support logging. - ldcFile=$(find_ldc_file) || { - dlogi '.ldc dictionary file not found, SOF logs collection disabled' - return 0 # 0 is 'true' - } - - # Disable logging when available... - if [ ${OPT_VAL['s']} -eq 0 ]; then - return 0 - fi # ... across all tests at once. # In the future we should support SOF_LOGGING=etrace (only), see @@ -771,12 +761,20 @@ logger_disabled() return 0 fi - if is_ipc4 && ! is_firmware_file_zephyr; then - dlogi 'IPC4 FW logging only support with SOF Zephyr build' - dlogi 'SOF logs collection is globally disabled.' - return 0 + if is_ipc4; then + is_firmware_file_zephyr || { + dlogi 'IPC4 FW logging only support with SOF Zephyr build' + dlogi 'SOF logs collection is globally disabled.' + return 0 + } + else + ldcFile=$(find_ldc_file) || { + dlogi '.ldc dictionary file not found, SOF logs collection disabled' + return 0 # 0 is 'true' + } fi + # return 1 means run tests with logging. return 1 } From 7960aef156745cd8d29e8a622035cb0bfebcd948 Mon Sep 17 00:00:00 2001 From: Keqiao Zhang Date: Tue, 4 Jul 2023 14:30:19 +0800 Subject: [PATCH 2/3] check-sof-logger.sh: remove the ldc dependency for IPC4 Zephyr platforms No need to check the ldc file on IPC4 Zephyr platforms and swith to use firmware file to determine whether it is a Zephyr build FW. Signed-off-by: Keqiao Zhang --- test-case/check-sof-logger.sh | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/test-case/check-sof-logger.sh b/test-case/check-sof-logger.sh index aacad43d..0600eb0f 100755 --- a/test-case/check-sof-logger.sh +++ b/test-case/check-sof-logger.sh @@ -76,10 +76,10 @@ run_loggers() # the same time, so $data_file will hopefully not be long. local collect_secs=2 - if is_zephyr; then + if is_ipc4; then # Collect logs from Zephyr logging backends - if is_ipc4 ; then + if is_firmware_file_zephyr; then # Get logs via SOF kernel IPC4 SRAM logging interfaces (mtrace) if [ -z "$MTRACE" ]; then @@ -95,23 +95,10 @@ run_loggers() sudo timeout -k 3 "$collect_secs" \ "$mtracetool" > "$etrace_file" 2> "$etrace_stderr_file" & mtracetoolPID=$! else - # SOF kernel IPC3 SRAM logging interface (etrace) - - local cavstool - cavstool=$(type -p cavstool.py) - - dlogi "Trying to get Zephyr logs from etrace with background $cavstool ..." - dlogc \ - "sudo $cavstool --log-only > $etrace_file 2>&1" - # Firmware messages are on stdout and local messages on - # stderr. Merge them and then grep ERROR below. - # shellcheck disable=SC2024 - sudo timeout -k 3 "$collect_secs" \ - "$cavstool" --log-only > "$etrace_file" 2>&1 & cavstoolPID=$! + dlogi 'IPC4 FW logging only support with SOF Zephyr build' + return 0 fi - fi - - if ! is_ipc4 ; then + else # Sof-logger DMA logging (IPC3 only) dlogi "Trying to get the DMA .ldc trace log with background sof-logger ..." @@ -136,7 +123,7 @@ run_loggers() } fi - if is_zephyr; then + if is_firmware_file_zephyr; then # Zephyr logging backends if is_ipc4 ; then @@ -180,7 +167,6 @@ run_loggers() return $etrace_exit fi - # XTOS IPC4 case return 0 } From 8adb3ce1c23f65bf8143e31f29684e651eb6cf63 Mon Sep 17 00:00:00 2001 From: Keqiao Zhang Date: Tue, 4 Jul 2023 14:47:05 +0800 Subject: [PATCH 3/3] check-sof-logger.sh: cavstool.py clean up Before we used cavstool.py as a temporary solution on IPC3 Zephyr platforms for etrace, but now IPC3 Zephyr built FW is no longer supported. Signed-off-by: Keqiao Zhang --- test-case/check-sof-logger.sh | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/test-case/check-sof-logger.sh b/test-case/check-sof-logger.sh index 0600eb0f..100612ac 100755 --- a/test-case/check-sof-logger.sh +++ b/test-case/check-sof-logger.sh @@ -3,7 +3,7 @@ ## ## Case Name: check-sof-logger ## Preconditions: -## sof-logger, cavstool.py and mtrace-reader.py installed in system path +## sof-logger and mtrace-reader.py installed in system path ## dictionary (ldc) file is in /etc/sof/ or /lib/firmware ## ## Description: @@ -136,15 +136,8 @@ run_loggers() } else # SOF kernel IPC3 SRAM logging interface (etrace) - - loggerStatus=0; wait "$cavstoolPID" || loggerStatus=$? - test "$loggerStatus" -eq 124 || { - cat "$error_file" - die "timeout $cavstool returned unexpected: $loggerStatus" - } - ( set -x - grep -i ERROR "$etrace_file" > "$etrace_stderr_file" - ) || true + dlogi 'IPC3 Zephyr built FW is no longer supported, EOL.' + return 0 fi # All Zephyr backends checked at this point, we can return @@ -241,7 +234,6 @@ main() fi reload_drivers - # cavstool is now racing against D3 run_loggers local f @@ -272,10 +264,6 @@ main() # No specific tool banner, just check some logs are visible. tool_banner=' .*<.*>' boot_banner='FW ABI.*tag.*zephyr' - elif is_zephyr && [ "$f" = 'etrace' ]; then - # cavstool - tool_banner=':cavs-fw:' - boot_banner='FW ABI.*tag.*zephyr' else # sof-logger # Other columns besides COMPONENT and CONTENT are optional