History

function_graph: Have selftest also emulate tr->reset() as it did with tr->init()

The function_graph boot up self test emulates the tr->init() function in order to add a wrapper around the function graph tracer entry code to test for lock ups and such. But it does not emulate the tr->reset(), and just calls the function_graph tracer tr->reset() function which will use its own fgraph_ops to unregister function tracing with. As the fgraph_ops is becoming more meaningful with the register_ftrace_graph() and unregister_ftrace_graph() functions, the two need to be the same. The emulated tr->init() uses its own fgraph_ops descriptor, which means the unregister_ftrace_graph() must use the same ftrace_ops, which the selftest currently does not do. By emulating the tr->reset() as the selftest does with the tr->init() it will be able to pass the same fgraph_ops descriptor to the unregister_ftrace_graph() as it did with the register_ftrace_graph().

Steven Rostedt (VMware) committed 7 years ago

Commit 52fde6e1 parent 2fa717a1 file · +4 −1Browse files

Unified · Split

kernel/trace/trace_selftest.c+4−1
@@ -792,7 +792,10 @@ trace_selftest_startup_function_graph(struct tracer *trace, · 791 unmodified lines
792792 /* check the trace buffer */
793793 ret = trace_test_buffer(&tr->trace_buffer, &count);
794794
795− trace->reset(tr);
795+ /* Need to also simulate the tr->reset to remove this fgraph_ops */
796+ tracing_stop_cmdline_record();
797+ unregister_ftrace_graph(&fgraph_ops);
798+
796799 tracing_start();
797800
798801 if (!ret && !count) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t