X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread-commands.c;fp=src%2Fbin%2Flttng-sessiond%2Fnotification-thread-commands.c;h=7d47b77459d3aa4f149e2df52e5b4aa81c6ceb07;hp=a434b08cf47966309dc759d485d5ea23ce805bb3;hb=d02d7404fac685cd836b53e121afc64af71af140;hpb=7e802d0a78ee4010dc540db15b7c747b28c2eacf diff --git a/src/bin/lttng-sessiond/notification-thread-commands.c b/src/bin/lttng-sessiond/notification-thread-commands.c index a434b08cf..7d47b7745 100644 --- a/src/bin/lttng-sessiond/notification-thread-commands.c +++ b/src/bin/lttng-sessiond/notification-thread-commands.c @@ -270,6 +270,60 @@ end: 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,