- ustevent = trace_ust_get_event_by_name(event->name, ustchan);
- if (ustevent == NULL) {
- ustevent = trace_ust_create_event(event);
- if (ustevent == NULL) {
- ret = -1;
- goto end;
- }
- strncpy(lttngustevent.name, event->name,
- LTTNG_UST_SYM_NAME_LEN);
- lttngustevent.name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0';
- /* TODO: adjust to other instrumentation types */
- lttngustevent.instrumentation = LTTNG_UST_TRACEPOINT;
- ret = ustctl_create_event(ustsession->sock, <tngustevent,
- ustchan->obj, &object_event);
- if (ret < 0) {
- if (ret == -EEXIST) {
- ret = LTTCOMM_KERN_EVENT_EXIST;
- } else {
- ret = LTTCOMM_KERN_ENABLE_FAIL;
- }
- goto end;
- }
- ustevent->obj = object_event;
- ustevent->handle = object_event->handle;
- ustevent->enabled = 1;
- /* Add event to event list */
- cds_list_add(&ustevent->list, &ustchan->events.head);
- ustchan->events.count++;
- } else if (ustevent->enabled == 0) {
- ret = ustctl_enable(ustsession->sock, ustevent->obj);
- if (ret < 0) {
- ret = LTTCOMM_KERN_ENABLE_FAIL;
- goto end;
- }
- ustevent->enabled = 1;
+ strncpy(ltt_uevent.name, uevent->attr.name, sizeof(ltt_uevent.name));
+ ltt_uevent.name[sizeof(ltt_uevent.name) - 1] = '\0';
+ /* TODO: adjust to other instrumentation types */
+ ltt_uevent.instrumentation = LTTNG_UST_TRACEPOINT;
+
+ ret = ustctl_create_event(app->key.sock, <t_uevent,
+ uchan->obj, &obj_event);
+ if (ret < 0) {
+ DBG("Error ustctl create event %s for app pid: %d, sock: %d ret %d",
+ uevent->attr.name, app->key.pid, app->key.sock, ret);
+ goto next;