ftracetest: Do not use usleep directly
authorNamhyung Kim <[email protected]>
Fri, 3 Apr 2015 00:27:58 +0000 (09:27 +0900)
committerShuah Khan <[email protected]>
Fri, 3 Apr 2015 15:16:32 +0000 (09:16 -0600)
commit2bfd4d1f8c2bee8b0b8832be0c38d3916713625f
tree163bd09a295e9ae04d02b36e8a1458261a1d95c4
parent6886f41d885e1a0c0e95069e3c73d27eed89d8ed
ftracetest: Do not use usleep directly

The usleep is only provided on distros from Redhat so running ftracetest
on other distro resulted in failures due to the missing usleep.

The reason of using [u]sleep in the test was to generate (scheduler)
events.  It can be done various ways like this:

yield() {  ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1; }

For more information to the history of this patch, please refer to:

Link: http://lkml.kernel.org/r/[email protected]
Reported-by: Michael Ellerman <[email protected]>
Reported-by: Dave Jones <[email protected]>
Reported-by: Luis Henriques <[email protected]>
Suggested-by: Pádraig Brady <[email protected]>
Acked-by: Steven Rostedt <[email protected]>
Acked-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
tools/testing/selftests/ftrace/test.d/event/event-enable.tc
tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc