X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=probes%2Flttng-ftrace.c;h=c866876e6f07dcf5b4d7612d27d4d9e6de08f223;hb=dc7f600a24e263bba4a69d7c94ab9c0bda9bca02;hp=da6d79c1078ae537f7d1f3d63a89c0275c9d5321;hpb=25f53c394f6bd3d6e9f04782b8427fc287a79084;p=lttng-modules.git diff --git a/probes/lttng-ftrace.c b/probes/lttng-ftrace.c index da6d79c1..c866876e 100644 --- a/probes/lttng-ftrace.c +++ b/probes/lttng-ftrace.c @@ -38,7 +38,7 @@ void lttng_ftrace_handler(unsigned long ip, unsigned long parent_ip, void **data return; lib_ring_buffer_ctx_init(&ctx, chan->chan, NULL, sizeof(payload), ltt_alignof(payload), -1); - ret = chan->ops->event_reserve(&ctx); + ret = chan->ops->event_reserve(&ctx, event->id); if (ret < 0) return; payload.ip = ip; @@ -92,6 +92,7 @@ int lttng_create_ftrace_event(const char *name, struct ltt_event *event) fields[1].type.u.basic.integer.base = 16; fields[1].type.u.basic.integer.encoding = lttng_encode_none; + desc->owner = THIS_MODULE; event->desc = desc; return 0; @@ -118,7 +119,7 @@ int lttng_ftrace_register(const char *name, if (ret) goto error; - event->u.ftrace.symbol_name = kstrdup(name, GFP_KERNEL); + event->u.ftrace.symbol_name = kstrdup(symbol_name, GFP_KERNEL); if (!event->u.ftrace.symbol_name) goto name_error; @@ -127,7 +128,7 @@ int lttng_ftrace_register(const char *name, ret = wrapper_register_ftrace_function_probe(event->u.ftrace.symbol_name, <tng_ftrace_ops, event); - if (ret) + if (ret < 0) goto register_error; return 0; @@ -152,7 +153,6 @@ void lttng_ftrace_unregister(struct ltt_event *event) } EXPORT_SYMBOL_GPL(lttng_ftrace_unregister); -/* This module is permanent. */ int lttng_ftrace_init(void) { wrapper_vmalloc_sync_all(); @@ -160,6 +160,15 @@ int lttng_ftrace_init(void) } module_init(lttng_ftrace_init) +/* + * Ftrace takes care of waiting for a grace period (RCU sched) at probe + * unregistration, and disables preemption around probe call. + */ +void lttng_ftrace_exit(void) +{ +} +module_exit(lttng_ftrace_exit) + MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers"); MODULE_DESCRIPTION("Linux Trace Toolkit Ftrace Support");