Commit 013190c4 authored by Meng Li's avatar Meng Li Committed by Shuah Khan

selftests: amd-pstate: Trigger gitsource benchmark and test cpus

Add gitsource.sh trigger the gitsource testing and monitor the cpu desire
performance, frequency, load, power consumption and throughput etc.
1) Download and tar gitsource codes.
2) Run gitsource benchmark on specific governors, ondemand or schedutil.
3) Run tbench benchmark comparative test on acpi-cpufreq kernel driver.
4) Get desire performance, frequency, load by perf.
5) Get power consumption and throughput by amd_pstate_trace.py.
6) Get run time by /usr/bin/time.
7) Analyse test results and save it in file selftest.gitsource.csv.
8) Plot png images about time, energy and performance per watt
for each test.

Fixed whitespace error during commit:
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarMeng Li <li.meng@amd.com>
Acked-by: default avatarHuang Rui <ray.huang@amd.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent ba2d788a
......@@ -13,6 +13,6 @@ TEST_GEN_FILES += ../../../power/x86/intel_pstate_tracer/intel_pstate_tracer.py
endif
TEST_PROGS := run.sh
TEST_FILES := basic.sh tbench.sh
TEST_FILES := basic.sh tbench.sh gitsource.sh
include ../lib.mk
This diff is collapsed.
......@@ -10,6 +10,7 @@ fi
source basic.sh
source tbench.sh
source gitsource.sh
# 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/')
......@@ -19,6 +20,7 @@ msg="Skip all tests:"
FUNC=all
OUTFILE=selftest
OUTFILE_TBENCH="$OUTFILE.tbench"
OUTFILE_GIT="$OUTFILE.gitsource"
SYSFS=
CPUROOT=
......@@ -131,6 +133,9 @@ amd_pstate_all()
# tbench
amd_pstate_tbench
# gitsource
amd_pstate_gitsource
}
help()
......@@ -140,7 +145,8 @@ help()
[-o <output-file-for-dump>]
[-c <all: All testing,
basic: Basic testing,
tbench: Tbench testing.>]
tbench: Tbench testing,
gitsource: Gitsource testing.>]
[-t <tbench time limit>]
[-p <tbench process number>]
[-l <loop times for tbench>]
......@@ -159,7 +165,7 @@ parse_arguments()
help
;;
c) # --func_type (Function to perform: basic, tbench (default: all))
c) # --func_type (Function to perform: basic, tbench, gitsource (default: all))
FUNC=$OPTARG
;;
......@@ -175,7 +181,7 @@ parse_arguments()
PROCESS_NUM=$OPTARG
;;
l) # --tbench-loop-times
l) # --tbench/gitsource-loop-times
LOOP_TIMES=$OPTARG
;;
......@@ -243,16 +249,16 @@ prerequisite()
fi
else
case "$FUNC" in
"tbench")
"tbench" | "gitsource")
if [ "$scaling_driver" != "$COMPARATIVE_TEST" ]; then
echo "$0 # Skipped: Comparison test can only run on $COMPARATIVE_TEST driver."
echo "$0 # Skipped: Comparison test can only run on $COMPARISON_TEST driver."
echo "$0 # Current cpufreq scaling drvier is $scaling_driver."
exit $ksft_skip
fi
;;
*)
echo "$0 # Skipped: Comparison test are only for tbench."
echo "$0 # Skipped: Comparison test are only for tbench or gitsource."
echo "$0 # Current comparative test is for $FUNC."
exit $ksft_skip
;;
......@@ -274,6 +280,10 @@ prerequisite()
command_perf
command_tbench
;;
"gitsource")
command_perf
;;
esac
SYSFS=`mount -t sysfs | head -1 | awk '{ print $3 }'`
......@@ -321,6 +331,10 @@ do_test()
amd_pstate_tbench
;;
"gitsource")
amd_pstate_gitsource
;;
*)
echo "Invalid [-f] function type"
help
......@@ -344,6 +358,12 @@ pre_clear_dumps()
rm -rf tbench_*.png
;;
"gitsource")
rm -rf $OUTFILE.log
rm -rf $OUTFILE.backup_governor.log
rm -rf gitsource_*.png
;;
*)
;;
esac
......
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