X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=dc442035a3fe21e6b4c487a1007c9f05d1b38c56;hp=dc1249ff1c845bef46a560e4221fd207a49d9b37;hb=d7b377ed1acd4043bde353d99122e0e56fa4e975;hpb=3da864a94ccc39239fea82c4803b58b6b56a1003 diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index dc1249ff1..dc442035a 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -6,9 +6,6 @@ * */ -#include "bin/lttng-sessiond/tracker.h" -#include "lttng/lttng-error.h" -#include "lttng/tracker.h" #define _LGPL_SOURCE #include #include @@ -40,6 +37,8 @@ #include #include #include +#include +#include #include #include "channel.h" @@ -59,6 +58,7 @@ #include "rotation-thread.h" #include "timer.h" #include "agent-thread.h" +#include "tracker.h" #include "cmd.h" @@ -946,7 +946,7 @@ static enum lttng_error_code send_consumer_relayd_socket( struct consumer_socket *consumer_sock, const char *session_name, const char *hostname, const char *base_path, int session_live_timer, - const uint64_t *current_chunk_id, + const uint64_t *current_chunk_id, time_t session_creation_time, bool session_name_contains_creation_time) { @@ -1074,9 +1074,9 @@ int cmd_setup_relayd(struct ltt_session *session) struct ltt_kernel_session *ksess; struct consumer_socket *socket; struct lttng_ht_iter iter; - LTTNG_OPTIONAL(uint64_t) current_chunk_id = {}; + LTTNG_OPTIONAL(uint64_t) current_chunk_id = {}; - assert(session); + assert(session); usess = session->ust_session; ksess = session->kernel_session; @@ -2288,7 +2288,7 @@ static int _cmd_enable_event(struct ltt_session *session, */ ret = validate_ust_event_name(event->name); if (ret) { - WARN("Userspace event name %s failed validation.", + WARN("Userspace event name %s failed validation.", event->name); ret = LTTNG_ERR_INVALID_EVENT_NAME; goto error; @@ -3164,10 +3164,10 @@ void cmd_destroy_session_reply(const struct ltt_session *session, lttng_dynamic_buffer_init(&payload); ret = lttng_dynamic_buffer_append(&payload, &llm, sizeof(llm)); - if (ret) { + if (ret) { ERR("Failed to append session destruction message"); goto error; - } + } cmd_header.rotation_state = (int32_t) (reply_context->implicit_rotation_on_destroy ? @@ -3290,10 +3290,10 @@ int cmd_destroy_session(struct ltt_session *session, session->name, lttng_strerror(-ret)); destruction_last_error = -ret; } - if (reply_context) { + if (reply_context) { reply_context->implicit_rotation_on_destroy = true; - } - } else if (session->has_been_started && session->current_trace_chunk) { + } + } else if (session->has_been_started && session->current_trace_chunk) { /* * The user has not triggered a session rotation. However, to * ensure all data has been consumed, the session is rotated @@ -3391,8 +3391,8 @@ int cmd_destroy_session(struct ltt_session *session, } else { *sock_fd = -1; } - } - ret = LTTNG_OK; + } + ret = LTTNG_OK; end: return ret; } @@ -3699,7 +3699,7 @@ void cmd_list_lttng_sessions(struct lttng_session *sessions, unsigned int i = 0; struct ltt_session *session; struct ltt_session_list *list = session_get_list(); - struct lttng_session_extended *extended = + struct lttng_session_extended *extended = (typeof(extended)) (&sessions[session_count]); DBG("Getting all available session for UID %d GID %d", @@ -3715,7 +3715,7 @@ void cmd_list_lttng_sessions(struct lttng_session *sessions, /* * Only list the sessions the user can control. */ - if (!session_access_ok(session, uid, gid) || + if (!session_access_ok(session, uid) || session->destroyed) { session_put(session); continue; @@ -5010,7 +5010,7 @@ int cmd_rotate_session(struct ltt_session *session, cmd_ret = LTTNG_ERR_CREATE_DIR_FAIL; goto error; } - } + } /* * The current trace chunk becomes the chunk being archived.