From: Francis Deslauriers Date: Thu, 22 Oct 2020 15:32:15 +0000 (-0400) Subject: sessiond: client commands: print command enum as a string X-Git-Tag: v2.13.0-rc1~356 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=19f912db83b1c2763c0708ef3e86d4c69841d3c3;p=lttng-tools.git sessiond: client commands: print command enum as a string Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau Change-Id: I10ce8911372a6926b7aa234b9d1595a5052d4a0e --- diff --git a/src/bin/lttng-sessiond/client.c b/src/bin/lttng-sessiond/client.c index e1552c345..9e4d446ae 100644 --- a/src/bin/lttng-sessiond/client.c +++ b/src/bin/lttng-sessiond/client.c @@ -844,7 +844,9 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int *sock, bool need_domain; bool need_consumerd; - DBG("Processing client command %d", cmd_ctx->lsm.cmd_type); + DBG("Processing client command '%s\' (%d)", + lttcomm_sessiond_command_str(cmd_ctx->lsm.cmd_type), + cmd_ctx->lsm.cmd_type); assert(!rcu_read_ongoing()); diff --git a/src/common/sessiond-comm/sessiond-comm.h b/src/common/sessiond-comm/sessiond-comm.h index d1a2bd97d..d946aa3a3 100644 --- a/src/common/sessiond-comm/sessiond-comm.h +++ b/src/common/sessiond-comm/sessiond-comm.h @@ -109,6 +109,99 @@ enum lttcomm_sessiond_command { LTTNG_LIST_TRIGGERS = 51, }; +static inline +const char *lttcomm_sessiond_command_str(enum lttcomm_sessiond_command cmd) +{ + switch (cmd) { + case LTTNG_ADD_CONTEXT: + return "LTTNG_ADD_CONTEXT"; + case LTTNG_DISABLE_CHANNEL: + return "LTTNG_DISABLE_CHANNEL"; + case LTTNG_DISABLE_EVENT: + return "LTTNG_DISABLE_EVENT"; + case LTTNG_LIST_SYSCALLS: + return "LTTNG_LIST_SYSCALLS"; + case LTTNG_ENABLE_CHANNEL: + return "LTTNG_ENABLE_CHANNEL"; + case LTTNG_ENABLE_EVENT: + return "LTTNG_ENABLE_EVENT"; + case LTTNG_DESTROY_SESSION: + return "LTTNG_DESTROY_SESSION"; + case LTTNG_LIST_CHANNELS: + return "LTTNG_LIST_CHANNELS"; + case LTTNG_LIST_DOMAINS: + return "LTTNG_LIST_DOMAINS"; + case LTTNG_LIST_EVENTS: + return "LTTNG_LIST_EVENTS"; + case LTTNG_LIST_SESSIONS: + return "LTTNG_LIST_SESSIONS"; + case LTTNG_LIST_TRACEPOINTS: + return "LTTNG_LIST_TRACEPOINTS"; + case LTTNG_REGISTER_CONSUMER: + return "LTTNG_REGISTER_CONSUMER"; + case LTTNG_START_TRACE: + return "LTTNG_START_TRACE"; + case LTTNG_STOP_TRACE: + return "LTTNG_STOP_TRACE"; + case LTTNG_LIST_TRACEPOINT_FIELDS: + return "LTTNG_LIST_TRACEPOINT_FIELDS"; + case LTTNG_DISABLE_CONSUMER: + return "LTTNG_DISABLE_CONSUMER"; + case LTTNG_ENABLE_CONSUMER: + return "LTTNG_ENABLE_CONSUMER"; + case LTTNG_SET_CONSUMER_URI: + return "LTTNG_SET_CONSUMER_URI"; + case LTTNG_DATA_PENDING: + return "LTTNG_DATA_PENDING"; + case LTTNG_SNAPSHOT_ADD_OUTPUT: + return "LTTNG_SNAPSHOT_ADD_OUTPUT"; + case LTTNG_SNAPSHOT_DEL_OUTPUT: + return "LTTNG_SNAPSHOT_DEL_OUTPUT"; + case LTTNG_SNAPSHOT_LIST_OUTPUT: + return "LTTNG_SNAPSHOT_LIST_OUTPUT"; + case LTTNG_SNAPSHOT_RECORD: + return "LTTNG_SNAPSHOT_RECORD"; + case LTTNG_SAVE_SESSION: + return "LTTNG_SAVE_SESSION"; + case LTTNG_PROCESS_ATTR_TRACKER_ADD_INCLUDE_VALUE: + return "LTTNG_PROCESS_ATTR_TRACKER_ADD_INCLUDE_VALUE"; + case LTTNG_PROCESS_ATTR_TRACKER_REMOVE_INCLUDE_VALUE: + return "LTTNG_PROCESS_ATTR_TRACKER_REMOVE_INCLUDE_VALUE"; + case LTTNG_PROCESS_ATTR_TRACKER_GET_POLICY: + return "LTTNG_PROCESS_ATTR_TRACKER_GET_POLICY"; + case LTTNG_PROCESS_ATTR_TRACKER_SET_POLICY: + return "LTTNG_PROCESS_ATTR_TRACKER_SET_POLICY"; + case LTTNG_PROCESS_ATTR_TRACKER_GET_INCLUSION_SET: + return "LTTNG_PROCESS_ATTR_TRACKER_GET_INCLUSION_SET"; + case LTTNG_SET_SESSION_SHM_PATH: + return "LTTNG_SET_SESSION_SHM_PATH"; + case LTTNG_REGENERATE_METADATA: + return "LTTNG_REGENERATE_METADATA"; + case LTTNG_REGENERATE_STATEDUMP: + return "LTTNG_REGENERATE_STATEDUMP"; + case LTTNG_REGISTER_TRIGGER: + return "LTTNG_REGISTER_TRIGGER"; + case LTTNG_UNREGISTER_TRIGGER: + return "LTTNG_UNREGISTER_TRIGGER"; + case LTTNG_ROTATE_SESSION: + return "LTTNG_ROTATE_SESSION"; + case LTTNG_ROTATION_GET_INFO: + return "LTTNG_ROTATION_GET_INFO"; + case LTTNG_ROTATION_SET_SCHEDULE: + return "LTTNG_ROTATION_SET_SCHEDULE"; + case LTTNG_SESSION_LIST_ROTATION_SCHEDULES: + return "LTTNG_SESSION_LIST_ROTATION_SCHEDULES"; + case LTTNG_CREATE_SESSION_EXT: + return "LTTNG_CREATE_SESSION_EXT"; + case LTTNG_CLEAR_SESSION: + return "LTTNG_CLEAR_SESSION"; + case LTTNG_LIST_TRIGGERS: + return "LTTNG_LIST_TRIGGERS"; + default: + abort(); + } +} + enum lttcomm_relayd_command { RELAYD_ADD_STREAM = 1, RELAYD_CREATE_SESSION = 2, diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 38df4cb7b..151ceed64 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -116,7 +116,8 @@ static int send_session_msg(struct lttcomm_session_msg *lsm) goto end; } - DBG("LSM cmd type : %d", lsm->cmd_type); + DBG("LSM cmd type: '%s' (%d)", lttcomm_sessiond_command_str(lsm->cmd_type), + lsm->cmd_type); ret = lttcomm_send_creds_unix_sock(sessiond_socket, lsm, sizeof(struct lttcomm_session_msg));