Commit 36bc511f authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf daemon: Fix running test for non root user

John reported that the daemon test is not working for non root user.
Changing the tests configurations so it's allowed to run under normal
user.

Fixes: 2291bb91 ("perf tests: Add daemon 'list' command test")
Reported-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Tested-by: default avatarJohn Garry <john.garry@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20210301122510.64402-2-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 31bf4e7c
...@@ -140,10 +140,10 @@ test_list() ...@@ -140,10 +140,10 @@ test_list()
base=BASE base=BASE
[session-size] [session-size]
run = -e cpu-clock run = -e cpu-clock -m 1 sleep 10
[session-time] [session-time]
run = -e task-clock run = -e task-clock -m 1 sleep 10
EOF EOF
sed -i -e "s|BASE|${base}|" ${config} sed -i -e "s|BASE|${base}|" ${config}
...@@ -159,14 +159,14 @@ EOF ...@@ -159,14 +159,14 @@ EOF
# check 1st session # check 1st session
# pid:size:-e cpu-clock:base/size:base/size/output:base/size/control:base/size/ack:0 # pid:size:-e cpu-clock:base/size:base/size/output:base/size/control:base/size/ack:0
local line=`perf daemon --config ${config} -x: | head -2 | tail -1` local line=`perf daemon --config ${config} -x: | head -2 | tail -1`
check_line_other "${line}" size "-e cpu-clock" ${base}/session-size \ check_line_other "${line}" size "-e cpu-clock -m 1 sleep 10" ${base}/session-size \
${base}/session-size/output ${base}/session-size/control \ ${base}/session-size/output ${base}/session-size/control \
${base}/session-size/ack "0" ${base}/session-size/ack "0"
# check 2nd session # check 2nd session
# pid:time:-e task-clock:base/time:base/time/output:base/time/control:base/time/ack:0 # pid:time:-e task-clock:base/time:base/time/output:base/time/control:base/time/ack:0
local line=`perf daemon --config ${config} -x: | head -3 | tail -1` local line=`perf daemon --config ${config} -x: | head -3 | tail -1`
check_line_other "${line}" time "-e task-clock" ${base}/session-time \ check_line_other "${line}" time "-e task-clock -m 1 sleep 10" ${base}/session-time \
${base}/session-time/output ${base}/session-time/control \ ${base}/session-time/output ${base}/session-time/control \
${base}/session-time/ack "0" ${base}/session-time/ack "0"
...@@ -190,10 +190,10 @@ test_reconfig() ...@@ -190,10 +190,10 @@ test_reconfig()
base=BASE base=BASE
[session-size] [session-size]
run = -e cpu-clock run = -e cpu-clock -m 1 sleep 10
[session-time] [session-time]
run = -e task-clock run = -e task-clock -m 1 sleep 10
EOF EOF
sed -i -e "s|BASE|${base}|" ${config} sed -i -e "s|BASE|${base}|" ${config}
...@@ -204,7 +204,7 @@ EOF ...@@ -204,7 +204,7 @@ EOF
# check 2nd session # check 2nd session
# pid:time:-e task-clock:base/time:base/time/output:base/time/control:base/time/ack:0 # pid:time:-e task-clock:base/time:base/time/output:base/time/control:base/time/ack:0
local line=`perf daemon --config ${config} -x: | head -3 | tail -1` local line=`perf daemon --config ${config} -x: | head -3 | tail -1`
check_line_other "${line}" time "-e task-clock" ${base}/session-time \ check_line_other "${line}" time "-e task-clock -m 1 sleep 10" ${base}/session-time \
${base}/session-time/output ${base}/session-time/control ${base}/session-time/ack "0" ${base}/session-time/output ${base}/session-time/control ${base}/session-time/ack "0"
local pid=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $1 }'` local pid=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $1 }'`
...@@ -215,10 +215,10 @@ EOF ...@@ -215,10 +215,10 @@ EOF
base=BASE base=BASE
[session-size] [session-size]
run = -e cpu-clock run = -e cpu-clock -m 1 sleep 10
[session-time] [session-time]
run = -e cpu-clock run = -e cpu-clock -m 1 sleep 10
EOF EOF
# TEST 1 - change config # TEST 1 - change config
...@@ -238,7 +238,7 @@ EOF ...@@ -238,7 +238,7 @@ EOF
# check reconfigured 2nd session # check reconfigured 2nd session
# pid:time:-e task-clock:base/time:base/time/output:base/time/control:base/time/ack:0 # pid:time:-e task-clock:base/time:base/time/output:base/time/control:base/time/ack:0
local line=`perf daemon --config ${config} -x: | head -3 | tail -1` local line=`perf daemon --config ${config} -x: | head -3 | tail -1`
check_line_other "${line}" time "-e cpu-clock" ${base}/session-time \ check_line_other "${line}" time "-e cpu-clock -m 1 sleep 10" ${base}/session-time \
${base}/session-time/output ${base}/session-time/control ${base}/session-time/ack "0" ${base}/session-time/output ${base}/session-time/control ${base}/session-time/ack "0"
# TEST 2 - empty config # TEST 2 - empty config
...@@ -309,10 +309,10 @@ test_stop() ...@@ -309,10 +309,10 @@ test_stop()
base=BASE base=BASE
[session-size] [session-size]
run = -e cpu-clock run = -e cpu-clock -m 1 sleep 10
[session-time] [session-time]
run = -e task-clock run = -e task-clock -m 1 sleep 10
EOF EOF
sed -i -e "s|BASE|${base}|" ${config} sed -i -e "s|BASE|${base}|" ${config}
...@@ -361,7 +361,7 @@ test_signal() ...@@ -361,7 +361,7 @@ test_signal()
base=BASE base=BASE
[session-test] [session-test]
run = -e cpu-clock --switch-output run = -e cpu-clock --switch-output -m 1 sleep 10
EOF EOF
sed -i -e "s|BASE|${base}|" ${config} sed -i -e "s|BASE|${base}|" ${config}
...@@ -400,10 +400,10 @@ test_ping() ...@@ -400,10 +400,10 @@ test_ping()
base=BASE base=BASE
[session-size] [session-size]
run = -e cpu-clock run = -e cpu-clock -m 1 sleep 10
[session-time] [session-time]
run = -e task-clock run = -e task-clock -m 1 sleep 10
EOF EOF
sed -i -e "s|BASE|${base}|" ${config} sed -i -e "s|BASE|${base}|" ${config}
...@@ -439,7 +439,7 @@ test_lock() ...@@ -439,7 +439,7 @@ test_lock()
base=BASE base=BASE
[session-size] [session-size]
run = -e cpu-clock run = -e cpu-clock -m 1 sleep 10
EOF EOF
sed -i -e "s|BASE|${base}|" ${config} sed -i -e "s|BASE|${base}|" ${config}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment