tracepoint: Optimize using static_call()
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 18 Aug 2020 13:57:52 +0000 (15:57 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 1 Sep 2020 07:58:06 +0000 (09:58 +0200)
commitd25e37d89dd2f41d7acae0429039d2f0ae8b4a07
tree16e6d52b374b3907e51dd3a96b30f3c427f9a55f
parenta945c8345ec0decb2f1a7f19a8c5e60bcb1dd1eb
tracepoint: Optimize using static_call()

Currently the tracepoint site will iterate a vector and issue indirect
calls to however many handlers are registered (ie. the vector is
long).

Using static_call() it is possible to optimize this for the common
case of only having a single handler registered. In this case the
static_call() can directly call this handler. Otherwise, if the vector
is longer than 1, call a function that iterates the whole vector like
the current code.

[peterz: updated to new interface]

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20200818135805.279421092@infradead.org
include/linux/tracepoint-defs.h
include/linux/tracepoint.h
include/trace/define_trace.h
kernel/tracepoint.c