aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tracepoint-defs.h
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2020-08-18 15:57:52 +0200
committerIngo Molnar <mingo@kernel.org>2020-09-01 09:58:06 +0200
commitd25e37d89dd2f41d7acae0429039d2f0ae8b4a07 (patch)
tree16e6d52b374b3907e51dd3a96b30f3c427f9a55f /include/linux/tracepoint-defs.h
parentstatic_call: Allow early init (diff)
downloadlinux-dev-d25e37d89dd2f41d7acae0429039d2f0ae8b4a07.tar.xz
linux-dev-d25e37d89dd2f41d7acae0429039d2f0ae8b4a07.zip
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
Diffstat (limited to 'include/linux/tracepoint-defs.h')
-rw-r--r--include/linux/tracepoint-defs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/tracepoint-defs.h b/include/linux/tracepoint-defs.h
index b29950a19205..de97450cf190 100644
--- a/include/linux/tracepoint-defs.h
+++ b/include/linux/tracepoint-defs.h
@@ -11,6 +11,8 @@
#include <linux/atomic.h>
#include <linux/static_key.h>
+struct static_call_key;
+
struct trace_print_flags {
unsigned long mask;
const char *name;
@@ -30,6 +32,9 @@ struct tracepoint_func {
struct tracepoint {
const char *name; /* Tracepoint name */
struct static_key key;
+ struct static_call_key *static_call_key;
+ void *static_call_tramp;
+ void *iterator;
int (*regfunc)(void);
void (*unregfunc)(void);
struct tracepoint_func __rcu *funcs;