X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-events.c;h=16d75da95b0c265d4785ca61de0513caa29476eb;hb=418446732612a7d47c019cf839f09f7d86621b34;hp=4fa675ddfec454e32d2ffec16a6a2ce3958457cc;hpb=10544ee8af31afb239e3dfa71cb2fe09d3de3771;p=lttng-ust.git diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index 4fa675dd..16d75da9 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -869,6 +869,7 @@ int lttng_event_notifier_create(const struct lttng_event_desc *desc, CDS_INIT_LIST_HEAD(&event_notifier->capture_bytecode_runtime_head); CDS_INIT_LIST_HEAD(&event_notifier->enablers_ref_head); event_notifier->desc = desc; + event_notifier->notification_send = lttng_event_notifier_notification_send; cds_list_add(&event_notifier->node, &event_notifier_group->event_notifiers_head); @@ -1413,6 +1414,7 @@ struct lttng_event_notifier_enabler *lttng_event_notifier_enabler_create( CDS_INIT_LIST_HEAD(&event_notifier_enabler->base.excluder_head); event_notifier_enabler->user_token = event_notifier_param->event.token; + event_notifier_enabler->error_counter_index = event_notifier_param->error_counter_index; event_notifier_enabler->num_captures = 0; memcpy(&event_notifier_enabler->base.event_param.name, @@ -1706,6 +1708,13 @@ void lttng_session_sync_event_enablers(struct lttng_session *session) __tracepoint_probe_prune_release_queue(); } +/* Support for event notifier is introduced by probe provider major version 2. */ +static +bool lttng_ust_probe_supports_event_notifier(struct lttng_probe_desc *probe_desc) +{ + return probe_desc->major >= 2; +} + static void lttng_create_event_notifier_if_missing( struct lttng_event_notifier_enabler *event_notifier_enabler) @@ -1757,6 +1766,18 @@ void lttng_create_event_notifier_if_missing( if (found) continue; + /* Check that the probe supports event notifiers, else report the error. */ + if (!lttng_ust_probe_supports_event_notifier(probe_desc)) { + ERR("Probe \"%s\" contains event \"%s\" which matches an enabled event notifier, " + "but its version (%u.%u) is too old and does not implement event notifiers. " + "It needs to be recompiled against a newer version of LTTng-UST, otherwise " + "this event will not generate any notification.", + probe_desc->provider, + desc->name, + probe_desc->major, + probe_desc->minor); + continue; + } /* * We need to create a event_notifier for this event probe. */