From 0c89d7959f4af7a2b39e925b2e8dc3a8954ccfa5 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 24 Sep 2013 12:20:41 -0400 Subject: [PATCH] Move health comm to health-internal.h Signed-off-by: Mathieu Desnoyers --- include/lttng/health-internal.h | 13 +++++++++++++ src/bin/lttng-sessiond/main.c | 4 ++-- src/common/sessiond-comm/sessiond-comm.h | 11 +---------- src/lib/lttng-ctl/lttng-ctl.c | 7 ++++--- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/include/lttng/health-internal.h b/include/lttng/health-internal.h index 764e998e3..f4270647f 100644 --- a/include/lttng/health-internal.h +++ b/include/lttng/health-internal.h @@ -59,6 +59,19 @@ struct health_state { struct cds_list_head node; }; +enum health_cmd { + HEALTH_CMD_CHECK = 0, +}; + +struct health_comm_msg { + uint32_t component; + uint32_t cmd; /* enum health_cmd */ +} LTTNG_PACKED; + +struct health_comm_reply { + uint32_t ret_code; +} LTTNG_PACKED; + /* Declare TLS health state. */ extern DECLARE_URCU_TLS(struct health_state, health_state); diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 550aa1b83..e119c8bf0 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -3457,8 +3457,8 @@ static void *thread_manage_health(void *data) int sock = -1, new_sock = -1, ret, i, pollfd, err = -1; uint32_t revents, nb_fd; struct lttng_poll_event events; - struct lttcomm_health_msg msg; - struct lttcomm_health_data reply; + struct health_comm_msg msg; + struct health_comm_reply reply; DBG("[thread] Manage health check started"); diff --git a/src/common/sessiond-comm/sessiond-comm.h b/src/common/sessiond-comm/sessiond-comm.h index f86ba7323..229b91e59 100644 --- a/src/common/sessiond-comm/sessiond-comm.h +++ b/src/common/sessiond-comm/sessiond-comm.h @@ -81,7 +81,7 @@ enum lttcomm_sessiond_command { LTTNG_ENABLE_CONSUMER = 20, LTTNG_SET_CONSUMER_URI = 21, LTTNG_ENABLE_EVENT_WITH_FILTER = 22, - LTTNG_HEALTH_CHECK = 23, + /* Unused */ LTTNG_DATA_PENDING = 24, LTTNG_SNAPSHOT_ADD_OUTPUT = 25, LTTNG_SNAPSHOT_DEL_OUTPUT = 26, @@ -300,15 +300,6 @@ struct lttcomm_lttng_output_id { uint32_t id; } LTTNG_PACKED; -struct lttcomm_health_msg { - uint32_t component; - uint32_t cmd; -} LTTNG_PACKED; - -struct lttcomm_health_data { - uint32_t ret_code; -} LTTNG_PACKED; - /* * lttcomm_consumer_msg is the message sent from sessiond to consumerd * to either add a channel, add a stream, update a stream, or stop diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index e6dbb678f..0efc15915 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "filter/filter-ast.h" #include "filter/filter-parser.h" @@ -1412,8 +1413,8 @@ static int set_health_socket_path(void) int lttng_health_check(enum lttng_health_component c) { int sock, ret; - struct lttcomm_health_msg msg; - struct lttcomm_health_data reply; + struct health_comm_msg msg; + struct health_comm_reply reply; /* Connect to the sesssion daemon */ sock = lttcomm_connect_unix_sock(health_sock_path); @@ -1422,7 +1423,7 @@ int lttng_health_check(enum lttng_health_component c) goto error; } - msg.cmd = LTTNG_HEALTH_CHECK; + msg.cmd = HEALTH_CMD_CHECK; msg.component = c; ret = lttcomm_send_unix_sock(sock, (void *)&msg, sizeof(msg)); -- 2.34.1