Remove session list lock acquisition of the search
[lttng-tools.git] / ltt-sessiond / main.c
index c72087ef25ddb88d27634e5d97d1967d1bec0277..d9c9d7b9a12923ab5c66c1eaff53ff6432c8cf69 100644 (file)
@@ -701,6 +701,12 @@ static void *thread_manage_kernel(void *data)
 
        while (1) {
                if (update_poll_flag == 1) {
+                       /*
+                        * Reset number of fd in the poll set. Always 2 since there is the thread
+                        * quit pipe and the kernel pipe.
+                        */
+                       events.nb_fd = 2;
+
                        ret = update_kernel_poll(&events);
                        if (ret < 0) {
                                goto error;
@@ -1567,7 +1573,7 @@ static int create_ust_session(struct ltt_session *session,
                struct lttng_domain *domain)
 {
        int ret;
-       struct ltt_ust_session *lus;
+       struct ltt_ust_session *lus = NULL;
        struct ust_app *app;
 
        switch (domain->type) {
@@ -1579,6 +1585,7 @@ static int create_ust_session(struct ltt_session *session,
                }
                break;
        default:
+               ret = LTTCOMM_UNKNOWN_DOMAIN;
                goto error;
        }
 
@@ -2306,7 +2313,7 @@ static int cmd_destroy_session(struct ltt_session *session, char *name)
                perror("write kernel poll pipe");
        }
 
-       ret = session_destroy(name);
+       ret = session_destroy(session);
 
        return ret;
 }
@@ -2518,7 +2525,9 @@ static int process_client_msg(struct command_ctx *cmd_ctx)
                break;
        default:
                DBG("Getting session %s by name", cmd_ctx->lsm->session.name);
+               session_lock_list();
                cmd_ctx->session = session_find_by_name(cmd_ctx->lsm->session.name);
+               session_unlock_list();
                if (cmd_ctx->session == NULL) {
                        if (cmd_ctx->lsm->session.name != NULL) {
                                ret = LTTCOMM_SESS_NOT_FOUND;
This page took 0.024151 seconds and 4 git commands to generate.