Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test-socwatch.sh: no need to load socwatch module manually #1157

Merged
merged 1 commit into from
Apr 10, 2024
Merged
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
8 changes: 5 additions & 3 deletions test-case/test-socwatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ OPT_NAME['u']='unload-audio' OPT_DESC['u']='unload audio modules for the test'
OPT_HAS_ARG['u']=0 OPT_VAL['u']=0

: "${SOCWATCH_PATH:=$HOME/socwatch}"
SOCWATCH_VERSION=$("$SOCWATCH_PATH"/socwatch --version |grep Version)

# reference cmd: sudo ./socwatch -t 20 -s 5 -f cpu-cstate -f pkg-pwr -o fredtest5
#SOCWATCH_CMD="./socwatch"
Expand All @@ -51,19 +52,20 @@ loop_count=${OPT_VAL['l']}

check_socwatch_module_loaded()
{
lsmod | grep -q socwatch || die "socwatch is not loaded"
lsmod | grep -q socwatch || dlogi "socwatch is not loaded"
}

socwatch_test_once()
{
local i="$1"
dlogi "===== Loop($i/$loop_count) ====="
dlogi "SoCWatch version: ${SOCWATCH_VERSION}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could have just run the command here but no big deal.


# set up checkpoint for each iteration
setup_kernel_check_point

# load socwatch module, if the module is loaded, go ahead with the testing (-q)
sudo "$SOCWATCH_PATH"/drivers/insmod-socwatch -q
sudo "$SOCWATCH_PATH"/drivers/insmod-socwatch -q || true
check_socwatch_module_loaded || die "socwatch module not loaded"

( set -x
Expand All @@ -82,7 +84,7 @@ socwatch_test_once()
sof-kernel-log-check.sh "$KERNEL_CHECKPOINT" || die "Caught error in kernel log"

# unload socwatch module
sudo "$SOCWATCH_PATH"/drivers/rmmod-socwatch
sudo "$SOCWATCH_PATH"/drivers/rmmod-socwatch || true
}

main()
Expand Down
Loading