Enable perf PMU counters by raw ID
[lttng-tools.git] / tests / regression / ust / test_event_perf
index 8bdff2c7b4f167f76c9bdf7093e2cdefd9068452..a01418ab55167cd60c64c4b921961411120ef525 100755 (executable)
@@ -72,26 +72,28 @@ function test_event_basic()
 
        stop_lttng_tracing_ok
 
-       destroy_lttng_session $SESSION_NAME
+       destroy_lttng_session_ok $SESSION_NAME
 
        validate_trace "perf_thread_page_fault" $TRACE_PATH
        rm -rf $TRACE_PATH
 }
 
-uname -m|grep x86 >/dev/null
-if test $? != 0; then
-       plan_tests 1
-       ok 0 "This test only runs on x86"
-       exit 0
-fi
-
 # MUST set TESTDIR before calling those functions
 plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
 
-start_lttng_sessiond
+if [ "$(id -u)" == "0" ]; then
+        isroot=1
+else
+        isroot=0
+fi
+
+skip $isroot "Root access is needed. Skipping UST perf tests." ${NUM_TESTS} ||
+{
+       start_lttng_sessiond
 
-test_event_basic
+       test_event_basic
 
-stop_lttng_sessiond
+       stop_lttng_sessiond
+}
This page took 0.023991 seconds and 4 git commands to generate.