-enum lttng_error_code notification_thread_command_add_channel(
- struct notification_thread_handle *handle,
- char *session_name, uid_t uid, gid_t gid,
- char *channel_name, uint64_t key,
- enum lttng_domain_type domain, uint64_t capacity)
+enum lttng_error_code
+notification_thread_command_add_session(struct notification_thread_handle *handle,
+ uint64_t session_id,
+ const char *session_name,
+ uid_t session_uid,
+ gid_t session_gid)
+{
+ int ret;
+ enum lttng_error_code ret_code;
+ notification_thread_command cmd;
+
+ init_notification_thread_command(&cmd);
+
+ cmd.type = NOTIFICATION_COMMAND_TYPE_ADD_SESSION;
+ cmd.parameters.add_session.session_id = session_id;
+ cmd.parameters.add_session.session_name = session_name;
+ cmd.parameters.add_session.session_uid = session_uid;
+ cmd.parameters.add_session.session_gid = session_gid;
+
+ 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_session(struct notification_thread_handle *handle,
+ uint64_t session_id)
+{
+ int ret;
+ enum lttng_error_code ret_code;
+ notification_thread_command cmd;
+
+ init_notification_thread_command(&cmd);
+
+ cmd.type = NOTIFICATION_COMMAND_TYPE_REMOVE_SESSION;
+ cmd.parameters.remove_session.session_id = session_id;
+
+ 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_add_channel(struct notification_thread_handle *handle,
+ uint64_t session_id,
+ char *channel_name,
+ uint64_t key,
+ enum lttng_domain_type domain,
+ uint64_t capacity)