Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions test-case/check-sof-logger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@

set -e

TOPDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
# shellcheck source=case-lib/lib.sh
source "$(dirname "${BASH_SOURCE[0]}")"/../case-lib/lib.sh
source "${TOPDIR}"/case-lib/lib.sh

func_opt_parse_option "$@"

setup_kernel_check_point

# check sof-logger location
type -a sof-logger ||
die "sof-logger Not Installed!"
Expand Down Expand Up @@ -121,10 +120,31 @@ print_logs_exit()
exit "$exit_code"
}

reload_drivers()
{
"${TOPDIR}"/tools/kmod/sof_remove.sh

setup_kernel_check_point

"${TOPDIR}"/tools/kmod/sof_insert.sh

# The DSP may unfortunately need multiple retries to boot, see
# https://github.com/thesofproject/sof/issues/3395
dlogi "Waiting a few seconds for the DSP to fully boot and then suspend"
for i in $(seq 1 5); do
if sudo test -e /sys/kernel/debug/sof/etrace; then break; fi
sleep 1
done
# Now give enough time to go to D3 suspend
sleep 4
}

main()
{
reload_drivers

run_loggers ||
print_logs_exit 1 "Reading etrace failed, run_loggers returned $?"
print_logs_exit 1 "Reading (e)trace failed, run_loggers returned $?"

local f

Expand Down