Commit 17bb615ad4f8d2d2c0f02794d27d7f83e0009ef4
Committed by
Steven Rostedt
1 parent
a1cd617359
Exists in
master
and in
7 other branches
tracing: Have event with function tracer check error return
The self tests for event tracer does not check if the function tracing was successfully activated. It needs to before it continues the tests, otherwise the wrong errors may be reported. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Showing 1 changed file with 6 additions and 1 deletions Side-by-side Diff
kernel/trace/trace_events.c
| ... | ... | @@ -1657,7 +1657,12 @@ |
| 1657 | 1657 | |
| 1658 | 1658 | static __init void event_trace_self_test_with_function(void) |
| 1659 | 1659 | { |
| 1660 | - register_ftrace_function(&trace_ops); | |
| 1660 | + int ret; | |
| 1661 | + ret = register_ftrace_function(&trace_ops); | |
| 1662 | + if (WARN_ON(ret < 0)) { | |
| 1663 | + pr_info("Failed to enable function tracer for event tests\n"); | |
| 1664 | + return; | |
| 1665 | + } | |
| 1661 | 1666 | pr_info("Running tests again, along with the function tracer\n"); |
| 1662 | 1667 | event_trace_self_tests(); |
| 1663 | 1668 | unregister_ftrace_function(&trace_ops); |