From: Mathieu Desnoyers Date: Tue, 15 Nov 2011 03:40:54 +0000 (-0500) Subject: lttng-sessiond: keep track of UST consumer fd for all UST sessions. X-Git-Tag: v2.0-pre15~111 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=ba5d816ea3010aa4a2a205e3c594b5464f82291a lttng-sessiond: keep track of UST consumer fd for all UST sessions. Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c index 0c93395b4..d1cc3fa8f 100644 --- a/lttng-sessiond/main.c +++ b/lttng-sessiond/main.c @@ -157,6 +157,8 @@ static struct ust_cmd_queue ust_cmd_queue; */ static struct ltt_session_list *session_list_ptr; +int ust_consumer_fd; + /* * Create a poll set with O_CLOEXEC and add the thread quit pipe to the set. */ @@ -3010,8 +3012,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx) goto error; } - cmd_ctx->session->ust_session->consumer_fd = - ustconsumer_data.cmd_sock; + ust_consumer_fd = ustconsumer_data.cmd_sock; } pthread_mutex_unlock(&ustconsumer_data.pid_mutex); } diff --git a/lttng-sessiond/trace-ust.c b/lttng-sessiond/trace-ust.c index 4df481c12..20e3dc5f1 100644 --- a/lttng-sessiond/trace-ust.c +++ b/lttng-sessiond/trace-ust.c @@ -98,7 +98,6 @@ struct ltt_ust_session *trace_ust_create_session(char *path, unsigned int uid, } /* Init data structure */ - lus->consumer_fds_sent = 0; lus->uid = uid; lus->start_trace = 0; diff --git a/lttng-sessiond/trace-ust.h b/lttng-sessiond/trace-ust.h index 9235ca62c..f0b639cba 100644 --- a/lttng-sessiond/trace-ust.h +++ b/lttng-sessiond/trace-ust.h @@ -100,8 +100,6 @@ struct ltt_ust_domain_exec { /* UST session */ struct ltt_ust_session { int uid; /* Unique identifier of session */ - int consumer_fds_sent; - int consumer_fd; int start_trace; char pathname[PATH_MAX]; struct ltt_ust_domain_global domain_global; diff --git a/lttng-sessiond/ust-app.c b/lttng-sessiond/ust-app.c index 43832aacb..f23fd306b 100644 --- a/lttng-sessiond/ust-app.c +++ b/lttng-sessiond/ust-app.c @@ -1141,7 +1141,7 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) } /* Setup UST consumer socket and send fds to it */ - ret = ust_consumer_send_session(usess->consumer_fd, ua_sess); + ret = ust_consumer_send_session(ust_consumer_fd, ua_sess); if (ret < 0) { goto error_rcu_unlock; } diff --git a/lttng-sessiond/ust-app.h b/lttng-sessiond/ust-app.h index f369a8a2f..14e04c121 100644 --- a/lttng-sessiond/ust-app.h +++ b/lttng-sessiond/ust-app.h @@ -26,6 +26,8 @@ #define UST_APP_EVENT_LIST_SIZE 32 +extern int ust_consumer_fd; + /* * Application registration data structure. */