From: Jeffrin Jose T <ahiliation@yahoo.co.in>
To: shuah@kernel.org, kstewart@linuxfoundation.org,
daniel.diaz@linaro.org, pombredanne@nexb.com,
gregkh@linuxfoundation.org, thomas@m3y3r.de
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Jeffrin Jose T <ahiliation@yahoo.co.in>,
Jeffrin Jose T <jeffrin@rajagiritech.edu.in>
Subject: [PATCH] selftests: intel_pstate: Fix a condition which does not notify user that root permission is useful
Date: Wed, 9 May 2018 23:08:19 +0530 [thread overview]
Message-ID: <20180509173819.8017-1-ahiliation@yahoo.co.in> (raw)
aperf program uses /dev/cpu which is normally a root only
access area. so in that case to successfully run thet test,
root permissions are required.This patch is in the file run.sh.
Signed-off-by: Jeffrin Jose T <jeffrin@rajagiritech.edu.in>
---
tools/testing/selftests/intel_pstate/run.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
index 23a2e4e9880e..05d35392dcfd 100755
--- a/tools/testing/selftests/intel_pstate/run.sh
+++ b/tools/testing/selftests/intel_pstate/run.sh
@@ -31,6 +31,14 @@
EVALUATE_ONLY=0
+uid=$(id -u)
+if [ $uid -ne 0 ]; then
+ echo "-----------------------"
+ echo $msg please run this as root >&2
+ echo "-----------------------"
+ exit 0
+fi
+
if ! uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ | grep -q x86; then
echo "$0 # Skipped: Test can only run on x86 architectures."
exit 0
--
2.17.0
next reply other threads:[~2018-05-09 17:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-09 17:38 Jeffrin Jose T [this message]
2018-05-09 18:24 ` [PATCH] selftests: intel_pstate: Fix a condition which does not notify user that root permission is useful Daniel Díaz
2018-05-09 18:44 ` Jeffrin Thalakkottoor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180509173819.8017-1-ahiliation@yahoo.co.in \
--to=ahiliation@yahoo.co.in \
--cc=daniel.diaz@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=jeffrin@rajagiritech.edu.in \
--cc=kstewart@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pombredanne@nexb.com \
--cc=shuah@kernel.org \
--cc=thomas@m3y3r.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).