diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-06-23 15:43:15 +0200 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2021-06-24 02:29:26 +0200 |
commit | 07b60713b57a8f952d029a2b6849d003d9c16108 (patch) | |
tree | b3306eafdba985bf0d7b97fa384552e1918700b3 /tools/testing | |
parent | selftests/sgx: Refine the test enclave to have storage (diff) | |
download | linux-07b60713b57a8f952d029a2b6849d003d9c16108.tar.xz linux-07b60713b57a8f952d029a2b6849d003d9c16108.zip |
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: ebed9628f5c2 ("selftests/ftrace: Add test to test new set_event_notrace_pid file")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing')
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/event/event-no-pid.tc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/event/event-no-pid.tc b/tools/testing/selftests/ftrace/test.d/event/event-no-pid.tc index e6eb78f0b954..9933ed24f901 100644 --- a/tools/testing/selftests/ftrace/test.d/event/event-no-pid.tc +++ b/tools/testing/selftests/ftrace/test.d/event/event-no-pid.tc @@ -57,6 +57,10 @@ enable_events() { echo 1 > tracing_on } +other_task() { + sleep .001 || usleep 1 || sleep 1 +} + echo 0 > options/event-fork do_reset @@ -94,6 +98,9 @@ child=$! echo "child = $child" wait $child +# Be sure some other events will happen for small systems (e.g. 1 core) +other_task + echo 0 > tracing_on cnt=`count_pid $mypid` |