cmd.type = NOTIFICATION_COMMAND_TYPE_REGISTER_TRIGGER;
lttng_trigger_get(trigger);
- cmd.parameters.trigger = trigger;
+ cmd.parameters.register_trigger.trigger = trigger;
ret = run_command_wait(handle, &cmd);
if (ret) {
enum lttng_error_code notification_thread_command_unregister_trigger(
struct notification_thread_handle *handle,
- struct lttng_trigger *trigger)
+ const struct lttng_trigger *trigger)
{
int ret;
enum lttng_error_code ret_code;
init_notification_thread_command(&cmd);
cmd.type = NOTIFICATION_COMMAND_TYPE_UNREGISTER_TRIGGER;
- cmd.parameters.trigger = trigger;
+ cmd.parameters.unregister_trigger.trigger = trigger;
ret = run_command_wait(handle, &cmd);
if (ret) {
return ret_code;
}
+enum lttng_error_code notification_thread_command_add_tracer_event_source(
+ struct notification_thread_handle *handle,
+ int tracer_event_source_fd,
+ enum lttng_domain_type domain)
+{
+ int ret;
+ enum lttng_error_code ret_code;
+ struct notification_thread_command cmd = {};
+
+ assert(tracer_event_source_fd >= 0);
+
+ init_notification_thread_command(&cmd);
+
+ cmd.type = NOTIFICATION_COMMAND_TYPE_ADD_TRACER_EVENT_SOURCE;
+ cmd.parameters.tracer_event_source.tracer_event_source_fd =
+ tracer_event_source_fd;
+ cmd.parameters.tracer_event_source.domain = domain;
+
+ ret = run_command_wait(handle, &cmd);
+ if (ret) {
+ ret_code = LTTNG_ERR_UNK;
+ goto end;
+ }
+
+ ret_code = cmd.reply_code;
+end:
+ return ret_code;
+}
+
+enum lttng_error_code notification_thread_command_remove_tracer_event_source(
+ struct notification_thread_handle *handle,
+ int tracer_event_source_fd)
+{
+ int ret;
+ enum lttng_error_code ret_code;
+ struct notification_thread_command cmd = {};
+
+ init_notification_thread_command(&cmd);
+
+ cmd.type = NOTIFICATION_COMMAND_TYPE_REMOVE_TRACER_EVENT_SOURCE;
+ cmd.parameters.tracer_event_source.tracer_event_source_fd =
+ tracer_event_source_fd;
+
+ ret = run_command_wait(handle, &cmd);
+ if (ret) {
+ ret_code = LTTNG_ERR_UNK;
+ goto end;
+ }
+
+ ret_code = cmd.reply_code;
+end:
+ return ret_code;
+}
+
enum lttng_error_code notification_thread_command_list_triggers(
struct notification_thread_handle *handle,
uid_t uid,
cmd.parameters.client_communication_update.status = transmission_status;
return run_command_no_wait(handle, &cmd);
}
+
+LTTNG_HIDDEN
+struct lttng_event_notifier_notification *
+lttng_event_notifier_notification_create(uint64_t tracer_token,
+ enum lttng_domain_type domain)
+{
+ struct lttng_event_notifier_notification *notification = NULL;
+
+ assert(domain != LTTNG_DOMAIN_NONE);
+
+ notification = zmalloc(
+ sizeof(struct lttng_event_notifier_notification));
+ if (notification == NULL) {
+ ERR("[notification-thread] Error allocating notification");
+ goto end;
+ }
+
+ notification->tracer_token = tracer_token;
+ notification->type = domain;
+
+end:
+ return notification;
+}
+
+LTTNG_HIDDEN
+void lttng_event_notifier_notification_destroy(
+ struct lttng_event_notifier_notification *notification)
+{
+ if (!notification) {
+ return;
+ }
+
+ free(notification);
+}