X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread-commands.c;h=64e5d2924e9cbf2d34e62158a365a22f83764ad8;hb=428b440c632be8aa4938ae7fcbd5831d492a1d77;hp=b1b33343ba5da6ec663a981d944e70f9256861c6;hpb=82b3cbf431e12b5c5f65eaa474d0328fb86ece87;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/notification-thread-commands.c b/src/bin/lttng-sessiond/notification-thread-commands.c index b1b33343b..64e5d2924 100644 --- a/src/bin/lttng-sessiond/notification-thread-commands.c +++ b/src/bin/lttng-sessiond/notification-thread-commands.c @@ -33,7 +33,7 @@ int run_command_wait(struct notification_thread_handle *handle, cds_list_add_tail(&cmd->cmd_list_node, &handle->cmd_queue.list); /* Wake-up thread. */ - ret = lttng_write(lttng_pipe_get_writefd(handle->cmd_queue.event_pipe), + ret = lttng_write(handle->cmd_queue.event_fd, ¬ification_counter, sizeof(notification_counter)); if (ret != sizeof(notification_counter)) { PERROR("write to notification thread's queue event fd"); @@ -89,7 +89,7 @@ int run_command_no_wait(struct notification_thread_handle *handle, cds_list_add_tail(&new_cmd->cmd_list_node, &handle->cmd_queue.list); /* Wake-up thread. */ - ret = lttng_write(lttng_pipe_get_writefd(handle->cmd_queue.event_pipe), + ret = lttng_write(handle->cmd_queue.event_fd, ¬ification_counter, sizeof(notification_counter)); if (ret != sizeof(notification_counter)) { PERROR("write to notification thread's queue event fd"); @@ -111,7 +111,8 @@ error: enum lttng_error_code notification_thread_command_register_trigger( struct notification_thread_handle *handle, - struct lttng_trigger *trigger) + struct lttng_trigger *trigger, + bool is_trigger_anonymous) { int ret; enum lttng_error_code ret_code; @@ -123,6 +124,8 @@ enum lttng_error_code notification_thread_command_register_trigger( cmd.type = NOTIFICATION_COMMAND_TYPE_REGISTER_TRIGGER; lttng_trigger_get(trigger); cmd.parameters.register_trigger.trigger = trigger; + cmd.parameters.register_trigger.is_trigger_anonymous = + is_trigger_anonymous; ret = run_command_wait(handle, &cmd); if (ret) { @@ -382,6 +385,32 @@ int notification_thread_client_communication_update( return run_command_no_wait(handle, &cmd); } +enum lttng_error_code notification_thread_command_get_trigger( + struct notification_thread_handle *handle, + const struct lttng_trigger *trigger, + struct lttng_trigger **real_trigger) +{ + int ret; + enum lttng_error_code ret_code; + struct notification_thread_command cmd = {}; + + init_notification_thread_command(&cmd); + + cmd.type = NOTIFICATION_COMMAND_TYPE_GET_TRIGGER; + cmd.parameters.get_trigger.trigger = trigger; + ret = run_command_wait(handle, &cmd); + if (ret) { + ret_code = LTTNG_ERR_UNK; + goto end; + } + + ret_code = cmd.reply_code; + *real_trigger = cmd.reply.get_trigger.trigger; + +end: + return ret_code; +} + /* * Takes ownership of the payload if present. */ @@ -399,7 +428,7 @@ struct lttng_event_notifier_notification *lttng_event_notifier_notification_crea notification = zmalloc(sizeof(struct lttng_event_notifier_notification)); if (notification == NULL) { - ERR("[notification-thread] Error allocating notification"); + ERR("Error allocating notification"); goto end; }