+ /*
+ * For this event, we need to lookup the loglevel. If active (in
+ * the active loglevels hash table), we must create the event.
+ */
+ if (desc->loglevel) {
+ const struct tracepoint_loglevel_entry *ev_ll;
+ struct loglevel_entry *loglevel;
+
+ ev_ll = *desc->loglevel;
+ loglevel = get_loglevel(ev_ll->identifier);
+ if (!loglevel)
+ loglevel = get_loglevel_value(ev_ll->value);
+ if (loglevel) {
+ struct session_loglevel *sl;
+
+ cds_list_for_each_entry(sl, &loglevel->session_list,
+ session_list) {
+ struct ltt_event *ev;
+ int ret;
+
+ memcpy(&event_param, &sl->event_param,
+ sizeof(event_param));
+ memcpy(event_param.name,
+ desc->name,
+ sizeof(event_param.name));
+ /* create event */
+ ret = ltt_event_create(sl->chan,
+ &event_param, NULL,
+ &ev);
+ if (ret) {
+ DBG("Error creating event");
+ continue;
+ }
+ cds_list_add(&ev->loglevel_list,
+ &sl->events);
+ }
+ }
+ }
+
+ /* Wildcard */
+ {
+ struct wildcard_entry *wildcard;
+
+ wildcard = match_wildcard(desc->name);
+ if (strcmp(desc->name, "lttng_ust:metadata") && wildcard) {
+ struct session_wildcard *sw;
+
+ cds_list_for_each_entry(sw, &wildcard->session_list,
+ session_list) {
+ struct ltt_event *ev;
+ int ret;
+
+ memcpy(&event_param, &sw->event_param,
+ sizeof(event_param));
+ memcpy(event_param.name,
+ desc->name,
+ sizeof(event_param.name));
+ /* create event */
+ ret = ltt_event_create(sw->chan,
+ &event_param, NULL,
+ &ev);
+ if (ret) {
+ DBG("Error creating event");
+ continue;
+ }
+ cds_list_add(&ev->wildcard_list,
+ &sw->events);
+ }
+ }
+ }
+
+ if (name_len > LTTNG_UST_SYM_NAME_LEN - 1) {
+ WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN - 1);
+ name_len = LTTNG_UST_SYM_NAME_LEN - 1;
+ }
+ hash = jhash(name, name_len, 0);