Skip to content

Commit

Permalink
lib.sh: disable sof-logger when running IPC4 mode (thesofproject#884)
Browse files Browse the repository at this point in the history
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) <[email protected]>
  • Loading branch information
XiaoyunWu6666 authored Mar 23, 2022
1 parent d1d948e commit dab6da8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,27 @@ is_zephyr()
test "$znum" -gt 10
}

ipc4_used()
{
local ipc_type
ipc_file=/sys/module/snd_sof_pci/parameters/ipc_type

# If /sys/module/snd_sof_pci/parameters/ipc_type does not exist
# the DUT is running IPC3 mode
ipc_type=$(cat $ipc_file) || {
return 1
}

# If /sys/module/snd_sof_pci/parameters/ipc_type exists
# If the value of file ipc_type is:
# 0: DUT runs IPC3 mode, ipc_used return 1(false)
# 1: DUT runs IPC4 mode, ipc4_used return 0(true)
[ $ipc_type -eq 1 ] || {
return 1
}
return 0
}

logger_disabled()
{
local ldcFile
Expand All @@ -481,6 +502,16 @@ logger_disabled()
return 0
fi

ipc4_used && {
# TODO:
# Need to remove disabling sof-logger
# after sof-logger support for IPC4 has been provided in the future
dlogi 'Currenly sof-logger is not supported when running IPC4 mode'
dlogi 'SOF logs collection is globally disabled because DUT is running IPC4 mode'
return 0
}
dlogi 'DUT is running IPC3 mode'

return 1
}

Expand Down

0 comments on commit dab6da8

Please sign in to comment.