Skip to content

Commit

Permalink
test-socwatch.sh: we don't need to load socwatch module manually
Browse files Browse the repository at this point in the history
We only use socwatch tool to read the power data for power measurement
in this case, we can directly use the latest released version, so there
is no need to pre-compile the driver.

Signed-off-by: Keqiao Zhang <[email protected]>
  • Loading branch information
keqiaozhang committed Feb 1, 2024
1 parent a7e28c8 commit 5ec7437
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 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}"

# 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 Down

0 comments on commit 5ec7437

Please sign in to comment.