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
+ lttng-context-prio.o lttng-context-nice.o \
+ wrapper/sched.o
obj-m += probes/
obj-m += lib/
{
int ret;
+ ret = wrapper_task_prio_init();
+ if (ret)
+ return ret;
event_cache = KMEM_CACHE(ltt_event, 0);
if (!event_cache)
return -ENOMEM;
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);
{
int prio;
- prio = task_prio(current);
+ prio = wrapper_task_prio_sym(current);
lib_ring_buffer_align_ctx(ctx, ltt_alignof(prio));
chan->ops->event_write(ctx, &prio, sizeof(prio));
}
--- /dev/null
+/*
+ * 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;
+}
--- /dev/null
+#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 */