X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-events.c;h=0d62f9fb0ae4da6d651008d0e792895accceaa7d;hb=5ad19305fc87a9928e787d888ab95b954ba80a9e;hp=67ed16972a10fbdfe949f4abf8e57bf4a2be0bbd;hpb=56377c91f874d50ea03d1f3f4698c77f69cbf83c;p=lttng-modules.git diff --git a/lttng-events.c b/lttng-events.c index 67ed1697..0d62f9fb 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -76,7 +76,12 @@ int _lttng_field_statedump(struct lttng_session *session, void synchronize_trace(void) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) + synchronize_rcu(); +#else synchronize_sched(); +#endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) #ifdef CONFIG_PREEMPT_RT_FULL synchronize_rcu(); @@ -749,6 +754,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 +763,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; @@ -1136,8 +1141,8 @@ int lttng_session_list_tracker_pids(struct lttng_session *session) ret = PTR_ERR(tracker_pids_list_file); goto file_error; } - if (atomic_long_add_unless(&session->file->f_count, - 1, INT_MAX) == INT_MAX) { + if (!atomic_long_add_unless(&session->file->f_count, 1, LONG_MAX)) { + ret = -EOVERFLOW; goto refcount_error; } ret = lttng_tracker_pids_list_fops.open(NULL, tracker_pids_list_file); @@ -1466,6 +1471,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) {