• Steven Rostedt (VMware)'s avatar
    ftrace: Create a slight optimization on searching the ftrace_hash · 2b2c279c
    Steven Rostedt (VMware) authored
    This is a micro-optimization, but as it has to deal with a fast path of the
    function tracer, these optimizations can be noticed.
    
    The ftrace_lookup_ip() returns true if the given ip is found in the hash. If
    it's not found or the hash is NULL, it returns false. But there's some cases
    that a NULL hash is a true, and the ftrace_hash_empty() is tested before
    calling ftrace_lookup_ip() in those cases. But as ftrace_lookup_ip() tests
    that first, that adds a few extra unneeded instructions in those cases.
    
    A new static "always_inlined" function is created that does not perform the
    hash empty test. This most only be used by callers that do the check first
    anyway, as an empty or NULL hash could cause a crash if a lookup is
    performed on it.
    
    Also add kernel doc for the ftrace_lookup_ip() main function.
    Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
    Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
    2b2c279c
ftrace.c 143 KB