diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-07-03 15:46:08 -0400 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-07-16 15:14:48 -0400 |
commit | 6e55f320f00e4db7144a4906dd8ac53701891e31 (patch) | |
tree | 05c25a134fad86dd722bc3385842c5c59a838ba0 /tools/testing | |
parent | cbd965bde74c3d0e53798404fd4b9829a68ccec8 (diff) | |
download | linux-stable-6e55f320f00e4db7144a4906dd8ac53701891e31.tar.gz linux-stable-6e55f320f00e4db7144a4906dd8ac53701891e31.tar.bz2 linux-stable-6e55f320f00e4db7144a4906dd8ac53701891e31.zip |
ftrace/selftest: Test if set_event/ftrace_pid exists before writing
While testing on a very old kernel (3.5), the tests failed because the write
to set_event_pid in the setup code, did not exist. The tests themselves
could pass, but the setup failed causing an error.
Other files test for existance before writing to them. Do the same for
set_event_pid and set_ftrace_pid.
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing')
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/functions | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions index 779ec11f61bd..1d96c5f7e402 100644 --- a/tools/testing/selftests/ftrace/test.d/functions +++ b/tools/testing/selftests/ftrace/test.d/functions @@ -91,8 +91,8 @@ initialize_ftrace() { # Reset ftrace to initial-state reset_events_filter reset_ftrace_filter disable_events - echo > set_event_pid # event tracer is always on - echo > set_ftrace_pid + [ -f set_event_pid ] && echo > set_event_pid + [ -f set_ftrace_pid ] && echo > set_ftrace_pid [ -f set_ftrace_filter ] && echo | tee set_ftrace_* [ -f set_graph_function ] && echo | tee set_graph_* [ -f stack_trace_filter ] && echo > stack_trace_filter |