Commit 07b60713 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Shuah Khan

selftests/ftrace: fix event-no-pid on 1-core machine

When running event-no-pid test on small machines (e.g. cloud 1-core
instance), other events might not happen:

    + cat trace
    + cnt=0
    + [ 0 -eq 0 ]
    + fail No other events were recorded
    [15] event tracing - restricts events based on pid notrace filtering [FAIL]

Schedule a simple sleep task to be sure that some other process events
get recorded.

Fixes: ebed9628 ("selftests/ftrace: Add test to test new set_event_notrace_pid file")
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 22118ce1
...@@ -57,6 +57,10 @@ enable_events() { ...@@ -57,6 +57,10 @@ enable_events() {
echo 1 > tracing_on echo 1 > tracing_on
} }
other_task() {
sleep .001 || usleep 1 || sleep 1
}
echo 0 > options/event-fork echo 0 > options/event-fork
do_reset do_reset
...@@ -94,6 +98,9 @@ child=$! ...@@ -94,6 +98,9 @@ child=$!
echo "child = $child" echo "child = $child"
wait $child wait $child
# Be sure some other events will happen for small systems (e.g. 1 core)
other_task
echo 0 > tracing_on echo 0 > tracing_on
cnt=`count_pid $mypid` cnt=`count_pid $mypid`
......
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