]> asedeno.scripts.mit.edu Git - linux.git/commit
ftrace: Create a slight optimization on searching the ftrace_hash
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 1 Feb 2017 20:37:07 +0000 (15:37 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 3 Feb 2017 15:58:22 +0000 (10:58 -0500)
commit2b2c279c814112e15577757ec593aa78465e2e56
tree9f78ac98f543a7e3686cb1c795d9a0aefb17da39
parent2b0cce0e190f8f0b37fe8102ae657f5d9eb0976d
ftrace: Create a slight optimization on searching the ftrace_hash

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: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/ftrace.c