diff options
author | Jason Baron <jbaron@redhat.com> | 2010-09-17 17:09:13 +0200 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-09-22 22:31:01 +0200 |
commit | 8f7b50c514206211cc282a4247f7b12f18dee674 (patch) | |
tree | 8d69af92e9ba46f8f775a300ba863040c817e77c /kernel/tracepoint.c | |
parent | jump label: Add jump_label_text_reserved() to reserve jump points (diff) | |
download | linux-8f7b50c514206211cc282a4247f7b12f18dee674.tar.xz linux-8f7b50c514206211cc282a4247f7b12f18dee674.zip |
jump label: Tracepoint support for jump labels
Make use of the jump label infrastructure for tracepoints.
Signed-off-by: Jason Baron <jbaron@redhat.com>
LKML-Reference: <a9ba2056e2c9cf332c3c300b577463ce66ff23a8.1284733808.git.jbaron@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/tracepoint.c')
-rw-r--r-- | kernel/tracepoint.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index c77f3eceea25..d6073a50a6ca 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c @@ -25,6 +25,7 @@ #include <linux/err.h> #include <linux/slab.h> #include <linux/sched.h> +#include <linux/jump_label.h> extern struct tracepoint __start___tracepoints[]; extern struct tracepoint __stop___tracepoints[]; @@ -263,7 +264,13 @@ static void set_tracepoint(struct tracepoint_entry **entry, * is used. */ rcu_assign_pointer(elem->funcs, (*entry)->funcs); - elem->state = active; + if (!elem->state && active) { + enable_jump_label(&elem->state); + elem->state = active; + } else if (elem->state && !active) { + disable_jump_label(&elem->state); + elem->state = active; + } } /* @@ -277,7 +284,10 @@ static void disable_tracepoint(struct tracepoint *elem) if (elem->unregfunc && elem->state) elem->unregfunc(); - elem->state = 0; + if (elem->state) { + disable_jump_label(&elem->state); + elem->state = 0; + } rcu_assign_pointer(elem->funcs, NULL); } |