Skip to content

Commit dab6da8

Browse files
lib.sh: disable sof-logger when running IPC4 mode (#884)
Currently, sof-logger is not supported when running IPC4 mode. Thus, disable SOF logs collection globally when DUT runs IPC4 mode. This should be removed after sof-logger support for IPC4 has been provided. Signed-off-by: Xiaoyun Wu(Iris) <xiaoyun.wu@intel.com>
1 parent d1d948e commit dab6da8

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

case-lib/lib.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,27 @@ is_zephyr()
459459
test "$znum" -gt 10
460460
}
461461

462+
ipc4_used()
463+
{
464+
local ipc_type
465+
ipc_file=/sys/module/snd_sof_pci/parameters/ipc_type
466+
467+
# If /sys/module/snd_sof_pci/parameters/ipc_type does not exist
468+
# the DUT is running IPC3 mode
469+
ipc_type=$(cat $ipc_file) || {
470+
return 1
471+
}
472+
473+
# If /sys/module/snd_sof_pci/parameters/ipc_type exists
474+
# If the value of file ipc_type is:
475+
# 0: DUT runs IPC3 mode, ipc_used return 1(false)
476+
# 1: DUT runs IPC4 mode, ipc4_used return 0(true)
477+
[ $ipc_type -eq 1 ] || {
478+
return 1
479+
}
480+
return 0
481+
}
482+
462483
logger_disabled()
463484
{
464485
local ldcFile
@@ -481,6 +502,16 @@ logger_disabled()
481502
return 0
482503
fi
483504

505+
ipc4_used && {
506+
# TODO:
507+
# Need to remove disabling sof-logger
508+
# after sof-logger support for IPC4 has been provided in the future
509+
dlogi 'Currenly sof-logger is not supported when running IPC4 mode'
510+
dlogi 'SOF logs collection is globally disabled because DUT is running IPC4 mode'
511+
return 0
512+
}
513+
dlogi 'DUT is running IPC3 mode'
514+
484515
return 1
485516
}
486517

0 commit comments

Comments
 (0)