diff options
author | Meng Li <li.meng@amd.com> | 2022-10-31 11:49:23 +0300 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2022-11-01 12:22:37 +0300 |
commit | 013190c4cc295ab11bc556fb893871a312011f7a (patch) | |
tree | d3446c2d82e20fc31f295d44a0281a71c3899274 /tools/testing/selftests/amd-pstate/run.sh | |
parent | ba2d788aa873da9c65ff067ca94665853eab95f0 (diff) | |
download | linux-013190c4cc295ab11bc556fb893871a312011f7a.tar.xz |
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: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Meng Li <li.meng@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/amd-pstate/run.sh')
-rwxr-xr-x | tools/testing/selftests/amd-pstate/run.sh | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/tools/testing/selftests/amd-pstate/run.sh b/tools/testing/selftests/amd-pstate/run.sh index e7e98068a03b..57cad57e59c0 100755 --- a/tools/testing/selftests/amd-pstate/run.sh +++ b/tools/testing/selftests/amd-pstate/run.sh @@ -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 |