X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttng-context-prio.c;h=1ee3a54daf2c33b331a1a3d97e247478b8a65679;hb=80996790fa42072d6525f2adb9a910312077bef6;hp=d159e02d4dbf270bcd3059e31d6fc41e88120b31;hpb=979133c547728a541098dd7051e1e72ab7631788;p=lttng-modules.git diff --git a/lttng-context-prio.c b/lttng-context-prio.c index d159e02d..1ee3a54d 100644 --- a/lttng-context-prio.c +++ b/lttng-context-prio.c @@ -13,6 +13,7 @@ #include "ltt-events.h" #include "wrapper/ringbuffer/frontend_types.h" #include "wrapper/vmalloc.h" +#include "wrapper/kallsyms.h" #include "ltt-tracer.h" static @@ -20,7 +21,7 @@ int (*wrapper_task_prio_sym)(struct task_struct *t); int wrapper_task_prio_init(void) { - wrapper_task_prio_sym = (void *) kallsyms_lookup_name("task_prio"); + wrapper_task_prio_sym = (void *) kallsyms_lookup_funcptr("task_prio"); if (!wrapper_task_prio_sym) { printk(KERN_WARNING "LTTng: task_prio symbol lookup failed.\n"); return -EINVAL; @@ -63,7 +64,11 @@ int lttng_add_prio_to_ctx(struct lttng_ctx **ctx) field = lttng_append_context(ctx); if (!field) - return ret; + return -ENOMEM; + if (lttng_find_context(*ctx, "prio")) { + lttng_remove_context_field(ctx, field); + return -EEXIST; + } field->event_field.name = "prio"; field->event_field.type.atype = atype_integer; field->event_field.type.u.basic.integer.size = sizeof(int) * CHAR_BIT;