Commit 27aabb2c authored by Swapnil Sapkal's avatar Swapnil Sapkal Committed by Shuah Khan

selftests/amd-pstate: Fix broken paths to run workloads in amd-pstate-ut

In selftests/amd-pstate, tbench and gitsource microbenchmarks are
used to compare the performance with different governors. In current
implementation the relative path to run `amd_pstate_tracer.py` is broken.
Fix this by using absolute paths.
Signed-off-by: default avatarSwapnil Sapkal <swapnil.sapkal@amd.com>
Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 508934b5
...@@ -30,8 +30,7 @@ import getopt ...@@ -30,8 +30,7 @@ import getopt
import Gnuplot import Gnuplot
from numpy import * from numpy import *
from decimal import * from decimal import *
sys.path.append('../intel_pstate_tracer') sys.path.append(os.path.join(os.path.dirname(__file__), "..", "intel_pstate_tracer"))
#import intel_pstate_tracer
import intel_pstate_tracer as ipt import intel_pstate_tracer as ipt
__license__ = "GPL version 2" __license__ = "GPL version 2"
......
#!/bin/sh #!/bin/bash
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Testing and monitor the cpu desire performance, frequency, load, # Testing and monitor the cpu desire performance, frequency, load,
...@@ -66,12 +66,15 @@ post_clear_gitsource() ...@@ -66,12 +66,15 @@ post_clear_gitsource()
install_gitsource() install_gitsource()
{ {
if [ ! -d $git_name ]; then if [ ! -d $SCRIPTDIR/$git_name ]; then
pushd $(pwd) > /dev/null 2>&1
cd $SCRIPTDIR
printf "Download gitsource, please wait a moment ...\n\n" printf "Download gitsource, please wait a moment ...\n\n"
wget -O $git_tar $gitsource_url > /dev/null 2>&1 wget -O $git_tar $gitsource_url > /dev/null 2>&1
printf "Tar gitsource ...\n\n" printf "Tar gitsource ...\n\n"
tar -xzf $git_tar tar -xzf $git_tar
popd > /dev/null 2>&1
fi fi
} }
...@@ -79,12 +82,14 @@ install_gitsource() ...@@ -79,12 +82,14 @@ install_gitsource()
run_gitsource() run_gitsource()
{ {
echo "Launching amd pstate tracer for $1 #$2 tracer_interval: $TRACER_INTERVAL" echo "Launching amd pstate tracer for $1 #$2 tracer_interval: $TRACER_INTERVAL"
./amd_pstate_trace.py -n tracer-gitsource-$1-$2 -i $TRACER_INTERVAL > /dev/null 2>&1 & $TRACER -n tracer-gitsource-$1-$2 -i $TRACER_INTERVAL > /dev/null 2>&1 &
printf "Make and test gitsource for $1 #$2 make_cpus: $MAKE_CPUS\n" printf "Make and test gitsource for $1 #$2 make_cpus: $MAKE_CPUS\n"
cd $git_name BACKUP_DIR=$(pwd)
perf stat -a --per-socket -I 1000 -e power/energy-pkg/ /usr/bin/time -o ../$OUTFILE_GIT.time-gitsource-$1-$2.log make test -j$MAKE_CPUS > ../$OUTFILE_GIT-perf-$1-$2.log 2>&1 pushd $BACKUP_DIR > /dev/null 2>&1
cd .. cd $SCRIPTDIR/$git_name
perf stat -a --per-socket -I 1000 -e power/energy-pkg/ /usr/bin/time -o $BACKUP_DIR/$OUTFILE_GIT.time-gitsource-$1-$2.log make test -j$MAKE_CPUS > $BACKUP_DIR/$OUTFILE_GIT-perf-$1-$2.log 2>&1
popd > /dev/null 2>&1
for job in `jobs -p` for job in `jobs -p`
do do
......
...@@ -8,9 +8,12 @@ else ...@@ -8,9 +8,12 @@ else
FILE_MAIN=DONE FILE_MAIN=DONE
fi fi
source basic.sh SCRIPTDIR=`dirname "$0"`
source tbench.sh TRACER=$SCRIPTDIR/../../../power/x86/amd_pstate_tracer/amd_pstate_trace.py
source gitsource.sh
source $SCRIPTDIR/basic.sh
source $SCRIPTDIR/tbench.sh
source $SCRIPTDIR/gitsource.sh
# amd-pstate-ut only run on x86/x86_64 AMD systems. # amd-pstate-ut only run on x86/x86_64 AMD systems.
ARCH=$(uname -m 2>/dev/null | sed -e 's/i.86/x86/' -e 's/x86_64/x86/') ARCH=$(uname -m 2>/dev/null | sed -e 's/i.86/x86/' -e 's/x86_64/x86/')
......
...@@ -64,7 +64,7 @@ post_clear_tbench() ...@@ -64,7 +64,7 @@ post_clear_tbench()
run_tbench() run_tbench()
{ {
echo "Launching amd pstate tracer for $1 #$2 tracer_interval: $TRACER_INTERVAL" echo "Launching amd pstate tracer for $1 #$2 tracer_interval: $TRACER_INTERVAL"
./amd_pstate_trace.py -n tracer-tbench-$1-$2 -i $TRACER_INTERVAL > /dev/null 2>&1 & $TRACER -n tracer-tbench-$1-$2 -i $TRACER_INTERVAL > /dev/null 2>&1 &
printf "Test tbench for $1 #$2 time_limit: $TIME_LIMIT procs_num: $PROCESS_NUM\n" printf "Test tbench for $1 #$2 time_limit: $TIME_LIMIT procs_num: $PROCESS_NUM\n"
tbench_srv > /dev/null 2>&1 & tbench_srv > /dev/null 2>&1 &
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment