Skip to content

Commit

Permalink
Prio context: fix symbol lookup
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  • Loading branch information
compudj committed Jun 1, 2011
1 parent 8fefc8a commit 979133c
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 63 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
3 changes: 0 additions & 3 deletions ltt-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions ltt-events.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 19 additions & 0 deletions lttng-context-prio.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@
#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)
{
Expand Down Expand Up @@ -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;
Expand Down
22 changes: 0 additions & 22 deletions wrapper/sched.c

This file was deleted.

32 changes: 0 additions & 32 deletions wrapper/sched.h

This file was deleted.

0 comments on commit 979133c

Please sign in to comment.