summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/amd-pstate/run.sh
diff options
context:
space:
mode:
authorSwapnil Sapkal <swapnil.sapkal@amd.com>2023-10-12 12:32:25 +0300
committerShuah Khan <skhan@linuxfoundation.org>2023-10-16 22:06:58 +0300
commit0996e6742399e56b547319c4b8061af79be071b2 (patch)
treeb10e0e1256b9aaa9e96b73d4e08ba8381aa533ab /tools/testing/selftests/amd-pstate/run.sh
parent27aabb2c4390561538ca76a5bd418d95037f28d5 (diff)
downloadlinux-0996e6742399e56b547319c4b8061af79be071b2.tar.xz
selftests/amd-pstate: Added option to provide perf binary path
In selftests/amd-pstate, distro `perf` is used to capture `perf stat` while running microbenchmarks. Distro `perf` is not working with upstream kernel. Fix this by providing an option to give the perf binary path. Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Swapnil Sapkal <swapnil.sapkal@amd.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/amd-pstate/run.sh')
-rwxr-xr-xtools/testing/selftests/amd-pstate/run.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/testing/selftests/amd-pstate/run.sh b/tools/testing/selftests/amd-pstate/run.sh
index 279d073c5728..b053eea8bb19 100755
--- a/tools/testing/selftests/amd-pstate/run.sh
+++ b/tools/testing/selftests/amd-pstate/run.sh
@@ -25,6 +25,7 @@ OUTFILE=selftest
OUTFILE_TBENCH="$OUTFILE.tbench"
OUTFILE_GIT="$OUTFILE.gitsource"
+PERF=/usr/bin/perf
SYSFS=
CPUROOT=
CPUFREQROOT=
@@ -154,6 +155,7 @@ help()
[-p <tbench process number>]
[-l <loop times for tbench>]
[-i <amd tracer interval>]
+ [-b <perf binary>]
[-m <comparative test: acpi-cpufreq>]
\n"
exit 2
@@ -161,7 +163,7 @@ help()
parse_arguments()
{
- while getopts ho:c:t:p:l:i:m: arg
+ while getopts ho:c:t:p:l:i:b:m: arg
do
case $arg in
h) # --help
@@ -192,6 +194,10 @@ parse_arguments()
TRACER_INTERVAL=$OPTARG
;;
+ b) # --perf-binary
+ PERF=`realpath $OPTARG`
+ ;;
+
m) # --comparative-test
COMPARATIVE_TEST=$OPTARG
;;
@@ -205,8 +211,8 @@ parse_arguments()
command_perf()
{
- if ! command -v perf > /dev/null; then
- echo $msg please install perf. >&2
+ if ! $PERF -v; then
+ echo $msg please install perf or provide perf binary path as argument >&2
exit $ksft_skip
fi
}