• Steven Rostedt (Google)'s avatar
    function_graph: Use static_call and branch to optimize entry function · cc60ee81
    Steven Rostedt (Google) authored
    In most cases function graph is used by a single user. Instead of calling
    a loop to call function graph callbacks in this case, call the function
    entry callback directly.
    
    Add a static_key that will be used to set the function graph logic to
    either do the loop (when more than one callback is registered) or to call
    the callback directly if there is only one registered callback.
    
    Link: https://lore.kernel.org/linux-trace-kernel/20240603190824.766858241@goodmis.org
    
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
    Cc: Florent Revest <revest@chromium.org>
    Cc: Martin KaFai Lau <martin.lau@linux.dev>
    Cc: bpf <bpf@vger.kernel.org>
    Cc: Sven Schnelle <svens@linux.ibm.com>
    Cc: Alexei Starovoitov <ast@kernel.org>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
    Cc: Daniel Borkmann <daniel@iogearbox.net>
    Cc: Alan Maguire <alan.maguire@oracle.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Guo Ren <guoren@kernel.org>
    Reviewed-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
    Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
    cc60ee81
fgraph.c 37.5 KB