• Rajesh Bhagat's avatar
    ftrace: Fix function_graph for archs that test ftrace_trace_function · db6544e0
    Rajesh Bhagat authored
    When CONFIG_DYNAMIC_FTRACE is not set, some archs (ARM) test
    the variable function_trace_function to determine if it should
    call the function tracer. If it is not set to ftrace_stub, then
    it will call the function and return, and not call the function
    graph tracer.
    
    But some of these archs (ARM) do not have the assembly code
    to test if function tracing is enabled or not (quick stop of tracing)
    and it calls the helper routine ftrace_test_stop_func() instead.
    
    If function tracer is enabled and then disabled, the variable
    ftrace_trace_function is still set to the helper routine
    ftrace_test_stop_func(), and not to ftrace_stub. This will
    prevent the function graph tracer from ever running.
    
    Output before patch
    /debug/tracing # echo function > current_tracer
    /debug/tracing # echo function_graph > current_tracer
    /debug/tracing # cat trace
    
    Output after patch
    /debug/tracing # echo function > current_tracer
    /debug/tracing # echo function_graph > current_tracer
    /debug/tracing # cat trace
    0) ! 253.375 us | } /* irq_enter */
    0) | generic_handle_irq() {
    0) | handle_fasteoi_irq() {
    0) 9.208 us | _raw_spin_lock();
    0) | handle_irq_event() {
    0) | handle_irq_event_percpu() {
    Signed-off-by: default avatarRajesh Bhagat <rajesh.lnx@gmail.com>
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    db6544e0
ftrace.c 99.9 KB