Prio context: fix symbol lookup
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 1 Jun 2011 19:01:18 +0000 (15:01 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 1 Jun 2011 19:01:18 +0000 (15:01 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Makefile
ltt-events.c
ltt-events.h
lttng-context-prio.c
wrapper/sched.c [deleted file]
wrapper/sched.h [deleted file]

index 62698b2af7e76f1584757837df3bb9369e56ad02..fa337a0fd97332dd2586a763f7895ada610f21f6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,8 +13,7 @@ obj-m += ltt-relay.o
 ltt-relay-objs :=  ltt-events.o ltt-debugfs-abi.o \
                        ltt-probes.o ltt-core.o ltt-context.o \
                        lttng-context-pid.o lttng-context-comm.o \
-                       lttng-context-prio.o lttng-context-nice.o \
-                       wrapper/sched.o
+                       lttng-context-prio.o lttng-context-nice.o
 
 obj-m += probes/
 obj-m += lib/
index 7c08def9d2d4d8935bd5393e832fcdea3ff83a30..f98ef309e0ec47e3ee9c4bf8de0abbf2d4c93773 100644 (file)
@@ -860,9 +860,6 @@ static int __init ltt_events_init(void)
 {
        int ret;
 
-       ret = wrapper_task_prio_init();
-       if (ret)
-               return ret;
        event_cache = KMEM_CACHE(ltt_event, 0);
        if (!event_cache)
                return -ENOMEM;
index 975d1949c6abc6d030e6f05fa1ec7d0df3c00f29..b9bb3bb95d8bba919729afabd17f135a76fe9791 100644 (file)
@@ -272,10 +272,6 @@ int ltt_probes_init(void);
 void ltt_probes_exit(void);
 struct lttng_ctx_field *lttng_append_context(struct lttng_ctx **ctx);
 void lttng_destroy_context(struct lttng_ctx *ctx);
-
-int wrapper_task_prio_init(void);
-int wrapper_task_prio_sym(struct task_struct *t);
-
 int lttng_add_pid_to_ctx(struct lttng_ctx **ctx);
 int lttng_add_comm_to_ctx(struct lttng_ctx **ctx);
 int lttng_add_prio_to_ctx(struct lttng_ctx **ctx);
index a62685f7dc7d7fe578a592097b1b02642fb881ed..d159e02d4dbf270bcd3059e31d6fc41e88120b31 100644 (file)
 #include "wrapper/vmalloc.h"
 #include "ltt-tracer.h"
 
+static
+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");
+       if (!wrapper_task_prio_sym) {
+               printk(KERN_WARNING "LTTng: task_prio symbol lookup failed.\n");
+               return -EINVAL;
+       }
+       return 0;
+}
+
 static
 size_t prio_get_size(size_t offset)
 {
@@ -42,6 +55,12 @@ int lttng_add_prio_to_ctx(struct lttng_ctx **ctx)
        struct lttng_ctx_field *field;
        int ret;
 
+       if (!wrapper_task_prio_sym) {
+               ret = wrapper_task_prio_init();
+               if (ret)
+                       return ret;
+       }
+
        field = lttng_append_context(ctx);
        if (!field)
                return ret;
diff --git a/wrapper/sched.c b/wrapper/sched.c
deleted file mode 100644 (file)
index 229dc07..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com)
- *
- * Wrapper around task_prio call.
- *
- * Dual LGPL v2.1/GPL v2 license.
- */
-
-#include <linux/kallsyms.h>
-#include <linux/sched.h>
-
-void (*wrapper_task_prio_sym)(struct task_struct *t);
-
-int wrapper_task_prio_init(void)
-{
-       wrapper_task_prio_sym = (void *) kallsyms_lookup_name("task_prio");
-       if (!wrapper_task_prio_sym) {
-               printk(KERN_WARNING "LTTng: task_prio symbol lookup failed.\n");
-               return -EINVAL;
-       }
-       return 0;
-}
diff --git a/wrapper/sched.h b/wrapper/sched.h
deleted file mode 100644 (file)
index 1332cfe..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef _LTT_WRAPPER_VMALLOC_H
-#define _LTT_WRAPPER_VMALLOC_H
-
-/*
- * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com)
- *
- * Wrapper around task_prio call.
- *
- * Dual LGPL v2.1/GPL v2 license.
- */
-
-#ifdef CONFIG_KALLSYMS
-
-#include "../ltt-events.h"
-
-static inline
-int wrapper_task_prio(struct task_struct *t)
-{
-       return wrapper_task_prio_sym(t);
-}
-#else
-
-#include <linux/sched.h>
-
-static inline
-int wrapper_task_prio(struct task_struct *t)
-{
-       return task_prio(t);
-}
-#endif
-
-#endif /* _LTT_WRAPPER_VMALLOC_H */
This page took 0.03027 seconds and 4 git commands to generate.