diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-02-01 15:37:07 -0500 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-02-03 10:58:22 -0500 |
commit | 2b2c279c814112e15577757ec593aa78465e2e56 (patch) | |
tree | 9f78ac98f543a7e3686cb1c795d9a0aefb17da39 /kernel/fork.c | |
parent | 2b0cce0e190f8f0b37fe8102ae657f5d9eb0976d (diff) |
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>
Diffstat (limited to 'kernel/fork.c')
0 files changed, 0 insertions, 0 deletions