From 227e824a28deb5b5d31955908827426a03f97802 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 24 Jan 2013 14:29:49 -0500 Subject: [PATCH] Cleanup unused health state reference The old health state structure are not used anymore since we now rely on TLS health state. This is backported from master because it does not alter any behavior and makes the next fix easier to merge from the master branch since this commit changes many lines. Signed-off-by: David Goulet --- src/bin/lttng-sessiond/consumer.h | 3 - src/bin/lttng-sessiond/health.h | 18 +--- src/bin/lttng-sessiond/kernel-consumer.c | 16 ++-- src/bin/lttng-sessiond/main.c | 100 ++++++++++----------- src/bin/lttng-sessiond/ust-app.c | 108 +++++++++++------------ src/bin/lttng-sessiond/ust-consumer.c | 20 ++--- 6 files changed, 122 insertions(+), 143 deletions(-) diff --git a/src/bin/lttng-sessiond/consumer.h b/src/bin/lttng-sessiond/consumer.h index 1e7e3b1d5..11c98773e 100644 --- a/src/bin/lttng-sessiond/consumer.h +++ b/src/bin/lttng-sessiond/consumer.h @@ -82,9 +82,6 @@ struct consumer_data { char err_unix_sock_path[PATH_MAX]; char cmd_unix_sock_path[PATH_MAX]; - /* Health check of the thread */ - struct health_state health; - /* communication lock */ pthread_mutex_t lock; }; diff --git a/src/bin/lttng-sessiond/health.h b/src/bin/lttng-sessiond/health.h index 91a90706a..34d2052e5 100644 --- a/src/bin/lttng-sessiond/health.h +++ b/src/bin/lttng-sessiond/health.h @@ -73,23 +73,11 @@ struct health_state { /* Declare TLS health state. */ extern DECLARE_URCU_TLS(struct health_state, health_state); -/* Health state counters for the client command thread */ -extern struct health_state health_thread_cmd; - -/* Health state counters for the application management thread */ -extern struct health_state health_thread_app_manage; - -/* Health state counters for the application registration thread */ -extern struct health_state health_thread_app_reg; - -/* Health state counters for the kernel thread */ -extern struct health_state health_thread_kernel; - /* * Update current counter by 1 to indicate that the thread entered or * left a blocking state caused by a poll(). */ -static inline void health_poll_update(struct health_state *state) +static inline void health_poll_update(void) { uatomic_add(&URCU_TLS(health_state).current, HEALTH_POLL_VALUE); } @@ -98,7 +86,7 @@ static inline void health_poll_update(struct health_state *state) * Update current counter by 2 indicates progress in execution of a * thread. */ -static inline void health_code_update(struct health_state *state) +static inline void health_code_update(void) { uatomic_add(&URCU_TLS(health_state).current, HEALTH_CODE_VALUE); } @@ -106,7 +94,7 @@ static inline void health_code_update(struct health_state *state) /* * Set health "error" flag. */ -static inline void health_error(struct health_state *state) +static inline void health_error(void) { uatomic_or(&URCU_TLS(health_state).flags, HEALTH_ERROR); } diff --git a/src/bin/lttng-sessiond/kernel-consumer.c b/src/bin/lttng-sessiond/kernel-consumer.c index 25f0e4799..8ae79f3eb 100644 --- a/src/bin/lttng-sessiond/kernel-consumer.c +++ b/src/bin/lttng-sessiond/kernel-consumer.c @@ -52,14 +52,14 @@ int kernel_consumer_add_channel(struct consumer_socket *sock, channel->channel->name, channel->stream_count); - health_code_update(&health_thread_kernel); + health_code_update(); ret = consumer_send_channel(sock, &lkm); if (ret < 0) { goto error; } - health_code_update(&health_thread_kernel); + health_code_update(); error: return ret; @@ -127,14 +127,14 @@ int kernel_consumer_add_metadata(struct consumer_socket *sock, "metadata", 1); - health_code_update(&health_thread_kernel); + health_code_update(); ret = consumer_send_channel(sock, &lkm); if (ret < 0) { goto error; } - health_code_update(&health_thread_kernel); + health_code_update(); /* Prep stream message structure */ consumer_init_stream_comm_msg(&lkm, @@ -152,7 +152,7 @@ int kernel_consumer_add_metadata(struct consumer_socket *sock, pathname, session->id); - health_code_update(&health_thread_kernel); + health_code_update(); /* Send stream and file descriptor */ ret = consumer_send_stream(sock, consumer, &lkm, @@ -161,7 +161,7 @@ int kernel_consumer_add_metadata(struct consumer_socket *sock, goto error; } - health_code_update(&health_thread_kernel); + health_code_update(); error: return ret; @@ -228,7 +228,7 @@ int kernel_consumer_add_stream(struct consumer_socket *sock, pathname, session->id); - health_code_update(&health_thread_kernel); + health_code_update(); /* Send stream and file descriptor */ ret = consumer_send_stream(sock, consumer, &lkm, &stream->fd, 1); @@ -236,7 +236,7 @@ int kernel_consumer_add_stream(struct consumer_socket *sock, goto error; } - health_code_update(&health_thread_kernel); + health_code_update(); error: return ret; diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 58333c22d..034621e9d 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -221,12 +221,6 @@ enum consumerd_state { static enum consumerd_state ust_consumerd_state; static enum consumerd_state kernel_consumerd_state; -/* Used for the health monitoring of the session daemon. See health.h */ -struct health_state health_thread_cmd; -struct health_state health_thread_app_manage; -struct health_state health_thread_app_reg; -struct health_state health_thread_kernel; - /* * Socket timeout for receiving and sending in seconds. */ @@ -705,14 +699,14 @@ static void *thread_manage_kernel(void *data) goto error_testpoint; } - health_code_update(&health_thread_kernel); + health_code_update(); if (testpoint(thread_manage_kernel_before_loop)) { goto error_testpoint; } while (1) { - health_code_update(&health_thread_kernel); + health_code_update(); if (update_poll_flag == 1) { /* Clean events object. We are about to populate it again. */ @@ -740,9 +734,9 @@ static void *thread_manage_kernel(void *data) /* Poll infinite value of time */ restart: - health_poll_update(&health_thread_kernel); + health_poll_update(); ret = lttng_poll_wait(&events, -1); - health_poll_update(&health_thread_kernel); + health_poll_update(); if (ret < 0) { /* * Restart interrupted system call. @@ -765,7 +759,7 @@ static void *thread_manage_kernel(void *data) revents = LTTNG_POLL_GETEV(&events, i); pollfd = LTTNG_POLL_GETFD(&events, i); - health_code_update(&health_thread_kernel); + health_code_update(); /* Thread quit pipe has been closed. Killing thread. */ ret = check_thread_quit_pipe(pollfd, revents); @@ -813,7 +807,7 @@ error_testpoint: utils_close_pipe(kernel_poll_pipe); kernel_poll_pipe[0] = kernel_poll_pipe[1] = -1; if (err) { - health_error(&health_thread_kernel); + health_error(); ERR("Health error occurred in %s", __func__); WARN("Kernel thread died unexpectedly. " "Kernel tracing can continue but CPU hotplug is disabled."); @@ -878,7 +872,7 @@ static void *thread_manage_consumer(void *data) * In a nutshell, the following poll update to the health state brings back * the state to an even value meaning a code path. */ - health_poll_update(&consumer_data->health); + health_poll_update(); /* * Pass 2 as size here for the thread quit pipe and kconsumerd_err_sock. @@ -899,18 +893,18 @@ static void *thread_manage_consumer(void *data) goto error; } - health_code_update(&consumer_data->health); + health_code_update(); /* Inifinite blocking call, waiting for transmission */ restart: - health_poll_update(&consumer_data->health); + health_poll_update(); if (testpoint(thread_manage_consumer)) { goto error; } ret = lttng_poll_wait(&events, -1); - health_poll_update(&consumer_data->health); + health_poll_update(); if (ret < 0) { /* * Restart interrupted system call. @@ -928,7 +922,7 @@ restart: revents = LTTNG_POLL_GETEV(&events, i); pollfd = LTTNG_POLL_GETFD(&events, i); - health_code_update(&consumer_data->health); + health_code_update(); /* Thread quit pipe has been closed. Killing thread. */ ret = check_thread_quit_pipe(pollfd, revents); @@ -957,7 +951,7 @@ restart: */ (void) utils_set_fd_cloexec(sock); - health_code_update(&consumer_data->health); + health_code_update(); DBG2("Receiving code from consumer err_sock"); @@ -968,7 +962,7 @@ restart: goto error; } - health_code_update(&consumer_data->health); + health_code_update(); if (code == LTTCOMM_CONSUMERD_COMMAND_SOCK_READY) { consumer_data->cmd_sock = @@ -998,13 +992,13 @@ restart: goto error; } - health_code_update(&consumer_data->health); + health_code_update(); /* Inifinite blocking call, waiting for transmission */ restart_poll: - health_poll_update(&consumer_data->health); + health_poll_update(); ret = lttng_poll_wait(&events, -1); - health_poll_update(&consumer_data->health); + health_poll_update(); if (ret < 0) { /* * Restart interrupted system call. @@ -1022,7 +1016,7 @@ restart_poll: revents = LTTNG_POLL_GETEV(&events, i); pollfd = LTTNG_POLL_GETFD(&events, i); - health_code_update(&consumer_data->health); + health_code_update(); /* Thread quit pipe has been closed. Killing thread. */ ret = check_thread_quit_pipe(pollfd, revents); @@ -1040,7 +1034,7 @@ restart_poll: } } - health_code_update(&consumer_data->health); + health_code_update(); /* Wait for any kconsumerd error */ ret = lttcomm_recv_unix_sock(sock, &code, @@ -1091,7 +1085,7 @@ error: lttng_poll_clean(&events); error_poll: if (err) { - health_error(&consumer_data->health); + health_error(); ERR("Health error occurred in %s", __func__); } health_unregister(); @@ -1121,7 +1115,7 @@ static void *thread_manage_apps(void *data) goto error_testpoint; } - health_code_update(&health_thread_app_manage); + health_code_update(); ret = create_thread_poll_set(&events, 2); if (ret < 0) { @@ -1137,16 +1131,16 @@ static void *thread_manage_apps(void *data) goto error; } - health_code_update(&health_thread_app_manage); + health_code_update(); while (1) { DBG("Apps thread polling on %d fds", LTTNG_POLL_GETNB(&events)); /* Inifinite blocking call, waiting for transmission */ restart: - health_poll_update(&health_thread_app_manage); + health_poll_update(); ret = lttng_poll_wait(&events, -1); - health_poll_update(&health_thread_app_manage); + health_poll_update(); if (ret < 0) { /* * Restart interrupted system call. @@ -1164,7 +1158,7 @@ static void *thread_manage_apps(void *data) revents = LTTNG_POLL_GETEV(&events, i); pollfd = LTTNG_POLL_GETFD(&events, i); - health_code_update(&health_thread_app_manage); + health_code_update(); /* Thread quit pipe has been closed. Killing thread. */ ret = check_thread_quit_pipe(pollfd, revents); @@ -1188,7 +1182,7 @@ static void *thread_manage_apps(void *data) goto error; } - health_code_update(&health_thread_app_manage); + health_code_update(); /* Register applicaton to the session daemon */ ret = ust_app_register(&ust_cmd.reg_msg, @@ -1199,7 +1193,7 @@ static void *thread_manage_apps(void *data) break; } - health_code_update(&health_thread_app_manage); + health_code_update(); /* * Validate UST version compatibility. @@ -1213,7 +1207,7 @@ static void *thread_manage_apps(void *data) update_ust_app(ust_cmd.sock); } - health_code_update(&health_thread_app_manage); + health_code_update(); ret = ust_app_register_done(ust_cmd.sock); if (ret < 0) { @@ -1244,7 +1238,7 @@ static void *thread_manage_apps(void *data) ust_cmd.sock); } - health_code_update(&health_thread_app_manage); + health_code_update(); break; } @@ -1266,7 +1260,7 @@ static void *thread_manage_apps(void *data) } } - health_code_update(&health_thread_app_manage); + health_code_update(); } } @@ -1285,7 +1279,7 @@ error_testpoint: */ if (err) { - health_error(&health_thread_app_manage); + health_error(); ERR("Health error occurred in %s", __func__); } health_unregister(); @@ -1424,9 +1418,9 @@ static void *thread_registration_apps(void *data) /* Inifinite blocking call, waiting for transmission */ restart: - health_poll_update(&health_thread_app_reg); + health_poll_update(); ret = lttng_poll_wait(&events, -1); - health_poll_update(&health_thread_app_reg); + health_poll_update(); if (ret < 0) { /* * Restart interrupted system call. @@ -1440,7 +1434,7 @@ static void *thread_registration_apps(void *data) nb_fd = ret; for (i = 0; i < nb_fd; i++) { - health_code_update(&health_thread_app_reg); + health_code_update(); /* Fetch once the poll data */ revents = LTTNG_POLL_GETEV(&events, i); @@ -1492,7 +1486,7 @@ static void *thread_registration_apps(void *data) sock = -1; continue; } - health_code_update(&health_thread_app_reg); + health_code_update(); ret = lttcomm_recv_unix_sock(sock, &ust_cmd->reg_msg, sizeof(struct ust_register_msg)); if (ret < 0 || ret < sizeof(struct ust_register_msg)) { @@ -1510,7 +1504,7 @@ static void *thread_registration_apps(void *data) sock = -1; continue; } - health_code_update(&health_thread_app_reg); + health_code_update(); ust_cmd->sock = sock; sock = -1; @@ -1541,7 +1535,7 @@ static void *thread_registration_apps(void *data) exit: error: if (err) { - health_error(&health_thread_app_reg); + health_error(); ERR("Health error occurred in %s", __func__); } @@ -3162,7 +3156,7 @@ static void *thread_manage_clients(void *data) goto error_testpoint; } - health_code_update(&health_thread_cmd); + health_code_update(); ret = lttcomm_listen_unix_sock(client_sock); if (ret < 0) { @@ -3195,16 +3189,16 @@ static void *thread_manage_clients(void *data) goto error; } - health_code_update(&health_thread_cmd); + health_code_update(); while (1) { DBG("Accepting client command ..."); /* Inifinite blocking call, waiting for transmission */ restart: - health_poll_update(&health_thread_cmd); + health_poll_update(); ret = lttng_poll_wait(&events, -1); - health_poll_update(&health_thread_cmd); + health_poll_update(); if (ret < 0) { /* * Restart interrupted system call. @@ -3222,7 +3216,7 @@ static void *thread_manage_clients(void *data) revents = LTTNG_POLL_GETEV(&events, i); pollfd = LTTNG_POLL_GETFD(&events, i); - health_code_update(&health_thread_cmd); + health_code_update(); /* Thread quit pipe has been closed. Killing thread. */ ret = check_thread_quit_pipe(pollfd, revents); @@ -3242,7 +3236,7 @@ static void *thread_manage_clients(void *data) DBG("Wait for client response"); - health_code_update(&health_thread_cmd); + health_code_update(); sock = lttcomm_accept_unix_sock(client_sock); if (sock < 0) { @@ -3278,7 +3272,7 @@ static void *thread_manage_clients(void *data) cmd_ctx->llm = NULL; cmd_ctx->session = NULL; - health_code_update(&health_thread_cmd); + health_code_update(); /* * Data is received from the lttng client. The struct @@ -3299,7 +3293,7 @@ static void *thread_manage_clients(void *data) continue; } - health_code_update(&health_thread_cmd); + health_code_update(); // TODO: Validate cmd_ctx including sanity check for // security purpose. @@ -3332,7 +3326,7 @@ static void *thread_manage_clients(void *data) continue; } - health_code_update(&health_thread_cmd); + health_code_update(); DBG("Sending response (size: %d, retcode: %s)", cmd_ctx->lttng_msg_size, @@ -3351,7 +3345,7 @@ static void *thread_manage_clients(void *data) clean_command_ctx(&cmd_ctx); - health_code_update(&health_thread_cmd); + health_code_update(); } exit: @@ -3378,7 +3372,7 @@ error_testpoint: } if (err) { - health_error(&health_thread_cmd); + health_error(); ERR("Health error occurred in %s", __func__); } diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 12c8f9224..acf68f66d 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -526,7 +526,7 @@ int create_ust_channel_context(struct ust_app_channel *ua_chan, { int ret; - health_code_update(&health_thread_cmd); + health_code_update(); ret = ustctl_add_context(app->sock, &ua_ctx->ctx, ua_chan->obj, &ua_ctx->obj); @@ -539,7 +539,7 @@ int create_ust_channel_context(struct ust_app_channel *ua_chan, DBG2("UST app context created successfully for channel %s", ua_chan->name); error: - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } @@ -552,7 +552,7 @@ int set_ust_event_filter(struct ust_app_event *ua_event, { int ret; - health_code_update(&health_thread_cmd); + health_code_update(); if (!ua_event->filter) { ret = 0; @@ -568,7 +568,7 @@ int set_ust_event_filter(struct ust_app_event *ua_event, DBG2("UST filter set successfully for event %s", ua_event->name); error: - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } @@ -580,7 +580,7 @@ static int disable_ust_event(struct ust_app *app, { int ret; - health_code_update(&health_thread_cmd); + health_code_update(); ret = ustctl_disable(app->sock, ua_event->obj); if (ret < 0) { @@ -594,7 +594,7 @@ static int disable_ust_event(struct ust_app *app, ua_event->attr.name, app->pid); error: - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } @@ -606,7 +606,7 @@ static int disable_ust_channel(struct ust_app *app, { int ret; - health_code_update(&health_thread_cmd); + health_code_update(); ret = ustctl_disable(app->sock, ua_chan->obj); if (ret < 0) { @@ -620,7 +620,7 @@ static int disable_ust_channel(struct ust_app *app, ua_chan->name, app->pid); error: - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } @@ -632,7 +632,7 @@ static int enable_ust_channel(struct ust_app *app, { int ret; - health_code_update(&health_thread_cmd); + health_code_update(); ret = ustctl_enable(app->sock, ua_chan->obj); if (ret < 0) { @@ -648,7 +648,7 @@ static int enable_ust_channel(struct ust_app *app, ua_chan->name, app->pid); error: - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } @@ -660,7 +660,7 @@ static int enable_ust_event(struct ust_app *app, { int ret; - health_code_update(&health_thread_cmd); + health_code_update(); ret = ustctl_enable(app->sock, ua_event->obj); if (ret < 0) { @@ -674,7 +674,7 @@ static int enable_ust_event(struct ust_app *app, ua_event->attr.name, app->pid); error: - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } @@ -687,7 +687,7 @@ static int open_ust_metadata(struct ust_app *app, int ret; struct lttng_ust_channel_attr uattr; - health_code_update(&health_thread_cmd); + health_code_update(); uattr.overwrite = ua_sess->metadata->attr.overwrite; uattr.subbuf_size = ua_sess->metadata->attr.subbuf_size; @@ -716,7 +716,7 @@ static int open_ust_metadata(struct ust_app *app, ua_sess->metadata->handle = ua_sess->metadata->obj->handle; error: - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } @@ -728,7 +728,7 @@ static int create_ust_metadata_stream(struct ust_app *app, { int ret; - health_code_update(&health_thread_cmd); + health_code_update(); /* We are going to receive 2 fds, we need to reserve them. */ ret = lttng_fd_get(LTTNG_FD_APPS, 2); @@ -745,7 +745,7 @@ static int create_ust_metadata_stream(struct ust_app *app, } error: - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } @@ -757,7 +757,7 @@ static int create_ust_channel(struct ust_app *app, { int ret; - health_code_update(&health_thread_cmd); + health_code_update(); /* TODO: remove cast and use lttng-ust-abi.h */ @@ -768,7 +768,7 @@ static int create_ust_channel(struct ust_app *app, goto error; } - health_code_update(&health_thread_cmd); + health_code_update(); ret = ustctl_create_channel(app->sock, ua_sess->handle, (struct lttng_ust_channel_attr *)&ua_chan->attr, &ua_chan->obj); @@ -786,7 +786,7 @@ static int create_ust_channel(struct ust_app *app, DBG2("UST app channel %s created successfully for pid:%d and sock:%d", ua_chan->name, app->pid, app->sock); - health_code_update(&health_thread_cmd); + health_code_update(); /* If channel is not enabled, disable it on the tracer */ if (!ua_chan->enabled) { @@ -797,7 +797,7 @@ static int create_ust_channel(struct ust_app *app, } error: - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } @@ -810,7 +810,7 @@ int create_ust_event(struct ust_app *app, struct ust_app_session *ua_sess, { int ret = 0; - health_code_update(&health_thread_cmd); + health_code_update(); /* Create UST event on tracer */ ret = ustctl_create_event(app->sock, &ua_event->attr, ua_chan->obj, @@ -826,7 +826,7 @@ int create_ust_event(struct ust_app *app, struct ust_app_session *ua_sess, DBG2("UST app event %s created successfully for pid:%d", ua_event->attr.name, app->pid); - health_code_update(&health_thread_cmd); + health_code_update(); /* Set filter if one is present. */ if (ua_event->filter) { @@ -861,7 +861,7 @@ int create_ust_event(struct ust_app *app, struct ust_app_session *ua_sess, } error: - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } @@ -1041,7 +1041,7 @@ static struct ust_app_session *create_ust_app_session( { struct ust_app_session *ua_sess; - health_code_update(&health_thread_cmd); + health_code_update(); ua_sess = lookup_session_by_app(usess, app); if (ua_sess == NULL) { @@ -1055,7 +1055,7 @@ static struct ust_app_session *create_ust_app_session( shadow_copy_session(ua_sess, usess, app); } - health_code_update(&health_thread_cmd); + health_code_update(); if (ua_sess->handle == -1) { int ret; @@ -1079,7 +1079,7 @@ static struct ust_app_session *create_ust_app_session( } end: - health_code_update(&health_thread_cmd); + health_code_update(); return ua_sess; } @@ -1605,7 +1605,7 @@ int ust_app_list_events(struct lttng_event **events) cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) { struct lttng_ust_tracepoint_iter uiter; - health_code_update(&health_thread_cmd); + health_code_update(); if (!app->compatible) { /* @@ -1623,7 +1623,7 @@ int ust_app_list_events(struct lttng_event **events) while ((ret = ustctl_tracepoint_list_get(app->sock, handle, &uiter)) != -LTTNG_UST_ERR_NOENT) { - health_code_update(&health_thread_cmd); + health_code_update(); if (count >= nbmem) { /* In case the realloc fails, we free the memory */ void *ptr; @@ -1657,7 +1657,7 @@ int ust_app_list_events(struct lttng_event **events) rcu_error: rcu_read_unlock(); error: - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } @@ -1685,7 +1685,7 @@ int ust_app_list_event_fields(struct lttng_event_field **fields) cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) { struct lttng_ust_field_iter uiter; - health_code_update(&health_thread_cmd); + health_code_update(); if (!app->compatible) { /* @@ -1703,7 +1703,7 @@ int ust_app_list_event_fields(struct lttng_event_field **fields) while ((ret = ustctl_tracepoint_field_list_get(app->sock, handle, &uiter)) != -LTTNG_UST_ERR_NOENT) { - health_code_update(&health_thread_cmd); + health_code_update(); if (count >= nbmem) { /* In case the realloc fails, we free the memory */ void *ptr; @@ -1742,7 +1742,7 @@ int ust_app_list_event_fields(struct lttng_event_field **fields) rcu_error: rcu_read_unlock(); error: - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } @@ -2284,7 +2284,7 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) goto error_rcu_unlock; } - health_code_update(&health_thread_cmd); + health_code_update(); ret = ustctl_create_stream(app->sock, ua_chan->obj, &ustream->obj); @@ -2302,7 +2302,7 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) } ustream->handle = ustream->obj->handle; - health_code_update(&health_thread_cmd); + health_code_update(); /* Order is important */ cds_list_add_tail(&ustream->list, &ua_chan->streams.head); @@ -2321,7 +2321,7 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) ustream->handle); } - health_code_update(&health_thread_cmd); + health_code_update(); } switch (app->bits_per_long) { @@ -2350,7 +2350,7 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) goto error_rcu_unlock; } - health_code_update(&health_thread_cmd); + health_code_update(); skip_setup: /* This start the UST tracing */ @@ -2363,19 +2363,19 @@ skip_setup: /* Indicate that the session has been started once */ ua_sess->started = 1; - health_code_update(&health_thread_cmd); + health_code_update(); /* Quiescent wait after starting trace */ ustctl_wait_quiescent(app->sock); end: rcu_read_unlock(); - health_code_update(&health_thread_cmd); + health_code_update(); return 0; error_rcu_unlock: rcu_read_unlock(); - health_code_update(&health_thread_cmd); + health_code_update(); return -1; } @@ -2412,7 +2412,7 @@ int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app) goto error_rcu_unlock; } - health_code_update(&health_thread_cmd); + health_code_update(); /* This inhibits UST tracing */ ret = ustctl_stop_session(app->sock, ua_sess->handle); @@ -2421,17 +2421,17 @@ int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app) goto error_rcu_unlock; } - health_code_update(&health_thread_cmd); + health_code_update(); /* Quiescent wait after stopping trace */ ustctl_wait_quiescent(app->sock); - health_code_update(&health_thread_cmd); + health_code_update(); /* Flushing buffers */ cds_lfht_for_each_entry(ua_sess->channels->ht, &iter.iter, ua_chan, node.node) { - health_code_update(&health_thread_cmd); + health_code_update(); ret = ustctl_sock_flush_buffer(app->sock, ua_chan->obj); if (ret < 0) { ERR("UST app PID %d channel %s flush failed with ret %d", @@ -2441,7 +2441,7 @@ int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app) } } - health_code_update(&health_thread_cmd); + health_code_update(); /* Flush all buffers before stopping */ ret = ustctl_sock_flush_buffer(app->sock, ua_sess->metadata->obj); @@ -2452,12 +2452,12 @@ int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app) end: rcu_read_unlock(); - health_code_update(&health_thread_cmd); + health_code_update(); return 0; error_rcu_unlock: rcu_read_unlock(); - health_code_update(&health_thread_cmd); + health_code_update(); return -1; } @@ -2497,10 +2497,10 @@ static int destroy_trace(struct ltt_ust_session *usess, struct ust_app *app) obj.shm_fd = -1; obj.wait_fd = -1; obj.memory_map_size = 0; - health_code_update(&health_thread_cmd); + health_code_update(); ustctl_release_object(app->sock, &obj); - health_code_update(&health_thread_cmd); + health_code_update(); delete_ust_app_session(app->sock, ua_sess); /* Quiescent wait after stopping trace */ @@ -2508,7 +2508,7 @@ static int destroy_trace(struct ltt_ust_session *usess, struct ust_app *app) end: rcu_read_unlock(); - health_code_update(&health_thread_cmd); + health_code_update(); return 0; } @@ -2860,7 +2860,7 @@ int ust_app_validate_version(int sock) app = find_app_by_sock(sock); assert(app); - health_code_update(&health_thread_cmd); + health_code_update(); ret = ustctl_tracer_version(sock, &app->version); if (ret < 0) { @@ -2877,7 +2877,7 @@ int ust_app_validate_version(int sock) UST_APP_MAJOR_VERSION); app->compatible = 1; rcu_read_unlock(); - health_code_update(&health_thread_cmd); + health_code_update(); return 0; error: @@ -2886,7 +2886,7 @@ error: UST_APP_MAJOR_VERSION); app->compatible = 0; rcu_read_unlock(); - health_code_update(&health_thread_cmd); + health_code_update(); return -1; } @@ -2910,7 +2910,7 @@ int ust_app_calibrate_glb(struct lttng_ust_calibrate *calibrate) continue; } - health_code_update(&health_thread_cmd); + health_code_update(); ret = ustctl_calibrate(app->sock, calibrate); if (ret < 0) { @@ -2932,7 +2932,7 @@ int ust_app_calibrate_glb(struct lttng_ust_calibrate *calibrate) rcu_read_unlock(); - health_code_update(&health_thread_cmd); + health_code_update(); return ret; } diff --git a/src/bin/lttng-sessiond/ust-consumer.c b/src/bin/lttng-sessiond/ust-consumer.c index e804f4b5a..768c8f4b1 100644 --- a/src/bin/lttng-sessiond/ust-consumer.c +++ b/src/bin/lttng-sessiond/ust-consumer.c @@ -57,14 +57,14 @@ static int send_channel(struct consumer_socket *sock, uchan->name, uchan->streams.count); - health_code_update(&health_thread_cmd); + health_code_update(); ret = consumer_send_channel(sock, &msg); if (ret < 0) { goto error; } - health_code_update(&health_thread_cmd); + health_code_update(); fd = uchan->obj->shm_fd; ret = consumer_send_fds(sock, &fd, 1); @@ -72,7 +72,7 @@ static int send_channel(struct consumer_socket *sock, goto error; } - health_code_update(&health_thread_cmd); + health_code_update(); error: return ret; @@ -114,7 +114,7 @@ static int send_channel_stream(struct consumer_socket *sock, pathname, usess->id); - health_code_update(&health_thread_cmd); + health_code_update(); /* Send stream and file descriptor */ fds[0] = stream->obj->shm_fd; @@ -124,7 +124,7 @@ static int send_channel_stream(struct consumer_socket *sock, goto error; } - health_code_update(&health_thread_cmd); + health_code_update(); error: return ret; @@ -230,14 +230,14 @@ static int send_metadata(struct consumer_socket *sock, "metadata", 1); - health_code_update(&health_thread_cmd); + health_code_update(); ret = consumer_send_channel(sock, &msg); if (ret < 0) { goto error; } - health_code_update(&health_thread_cmd); + health_code_update(); /* Sending metadata shared memory fd */ fd = usess->metadata->obj->shm_fd; @@ -246,7 +246,7 @@ static int send_metadata(struct consumer_socket *sock, goto error; } - health_code_update(&health_thread_cmd); + health_code_update(); /* Get correct path name destination */ if (consumer->type == CONSUMER_DST_LOCAL) { @@ -293,7 +293,7 @@ static int send_metadata(struct consumer_socket *sock, pathname, usess->id); - health_code_update(&health_thread_cmd); + health_code_update(); /* Send stream and file descriptor */ fds[0] = usess->metadata->stream_obj->shm_fd; @@ -303,7 +303,7 @@ static int send_metadata(struct consumer_socket *sock, goto error; } - health_code_update(&health_thread_cmd); + health_code_update(); error: return ret; -- 2.34.1