X-Git-Url: http://git.liburcu.org/?p=lttng-modules.git;a=blobdiff_plain;f=lttng-events.c;h=566080a3a4c1be92ea01e9e6b2af497fd040d007;hp=67ed16972a10fbdfe949f4abf8e57bf4a2be0bbd;hb=740572854b9a9a2670ef6185afc9707608559368;hpb=56377c91f874d50ea03d1f3f4698c77f69cbf83c diff --git a/lttng-events.c b/lttng-events.c index 67ed1697..566080a3 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -27,8 +27,8 @@ #include #include #include +#include -#include #include /* for wrapper_vmalloc_sync_all() */ #include #include @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -130,7 +129,7 @@ struct lttng_session *lttng_session_create(void) GFP_KERNEL); if (!metadata_cache) goto err_free_session; - metadata_cache->data = lttng_vzalloc(METADATA_CACHE_DEFAULT_SIZE); + metadata_cache->data = vzalloc(METADATA_CACHE_DEFAULT_SIZE); if (!metadata_cache->data) goto err_free_cache; metadata_cache->cache_alloc = METADATA_CACHE_DEFAULT_SIZE; @@ -226,6 +225,9 @@ int lttng_session_enable(struct lttng_session *session) /* Set transient enabler state to "enabled" */ session->tstate = 1; + /* We need to sync enablers with session before activation. */ + lttng_session_sync_enablers(session); + /* * Snapshot the number of events per channel to know the type of header * we need to use. @@ -239,9 +241,6 @@ int lttng_session_enable(struct lttng_session *session) chan->header_type = 2; /* large */ } - /* We need to sync enablers with session before activation. */ - lttng_session_sync_enablers(session); - /* Clear each stream's quiescent state. */ list_for_each_entry(chan, &session->chan, list) { if (chan->channel_type != METADATA_CHANNEL) @@ -749,6 +748,7 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan, */ event->enabled = 0; event->registered = 1; + /* * Populate lttng_event structure before event * registration. @@ -757,7 +757,6 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan, ret = lttng_uprobes_register(event_param->name, event_param->u.uprobe.fd, - event_param->u.uprobe.offset, event); if (ret) goto register_error; @@ -1466,6 +1465,18 @@ error_free: return ret; } +int lttng_event_add_callsite(struct lttng_event *event, + struct lttng_kernel_event_callsite __user *callsite) +{ + + switch (event->instrumentation) { + case LTTNG_KERNEL_UPROBE: + return lttng_uprobes_add_callsite(event, callsite); + default: + return -EINVAL; + } +} + int lttng_enabler_attach_context(struct lttng_enabler *enabler, struct lttng_kernel_context *context_param) { @@ -1680,7 +1691,7 @@ int lttng_metadata_printf(struct lttng_session *session, tmp_cache_alloc_size = max_t(unsigned int, session->metadata_cache->cache_alloc + len, session->metadata_cache->cache_alloc << 1); - tmp_cache_realloc = lttng_vzalloc(tmp_cache_alloc_size); + tmp_cache_realloc = vzalloc(tmp_cache_alloc_size); if (!tmp_cache_realloc) goto err; if (session->metadata_cache->data) {