Update TODO
[lttng-modules.git] / lttng-context-prio.c
index 842717ca7c74def7f4368aae807083c5b2b34666..1ee3a54daf2c33b331a1a3d97e247478b8a65679 100644 (file)
@@ -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;
@@ -64,6 +65,10 @@ int lttng_add_prio_to_ctx(struct lttng_ctx **ctx)
        field = lttng_append_context(ctx);
        if (!field)
                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;
This page took 0.024484 seconds and 4 git commands to generate.