Use the common idiom for skipping tests if not running as root, which is required for this test.
Signed-off-by: James Clark james.clark@linaro.org --- tools/perf/tests/shell/test_arm_coresight.sh | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/tools/perf/tests/shell/test_arm_coresight.sh b/tools/perf/tests/shell/test_arm_coresight.sh index 39553702c1f3..8ed2c934c87d 100755 --- a/tools/perf/tests/shell/test_arm_coresight.sh +++ b/tools/perf/tests/shell/test_arm_coresight.sh @@ -20,6 +20,12 @@ skip_if_no_cs_etm_event() {
skip_if_no_cs_etm_event || exit 2
+if [ "$(id -u)" != 0 ]; then + # Requires root for -C and system wide tests + echo "[Skip] No root permission" + exit 2 +fi + perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX) file=$(mktemp /tmp/temporary_file.XXXXX)