Fix: grab more than one packet for snapshots
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 80eebf163a10af74b1edfdc1069ccd830050bdbb..e084aba61437961fe0f2d505bef57ed0f991c283 100644 (file)
@@ -1059,12 +1059,14 @@ static void *thread_manage_kernel(void *data)
                        update_poll_flag = 0;
                }
 
-               DBG("Thread kernel polling on %d fds", LTTNG_POLL_GETNB(&events));
+               DBG("Thread kernel polling");
 
                /* Poll infinite value of time */
        restart:
                health_poll_entry();
                ret = lttng_poll_wait(&events, -1);
+               DBG("Thread kernel return from poll on %d fds",
+                               LTTNG_POLL_GETNB(&events));
                health_poll_exit();
                if (ret < 0) {
                        /*
@@ -1527,12 +1529,14 @@ static void *thread_manage_apps(void *data)
        health_code_update();
 
        while (1) {
-               DBG("Apps thread polling on %d fds", LTTNG_POLL_GETNB(&events));
+               DBG("Apps thread polling");
 
                /* Inifinite blocking call, waiting for transmission */
        restart:
                health_poll_entry();
                ret = lttng_poll_wait(&events, -1);
+               DBG("Apps thread return from poll on %d fds",
+                               LTTNG_POLL_GETNB(&events));
                health_poll_exit();
                if (ret < 0) {
                        /*
@@ -5205,6 +5209,12 @@ int main(int argc, char **argv)
                goto exit_ht_cleanup_pipe;
        }
 
+       /* Set up max poll set size */
+       if (lttng_poll_set_max_size()) {
+               retval = -1;
+               goto exit_set_max_size;
+       }
+
        /* Create thread to clean up RCU hash tables */
        ret = pthread_create(&ht_cleanup_thread, NULL,
                        thread_ht_cleanup, (void *) NULL);
@@ -5539,9 +5549,6 @@ int main(int argc, char **argv)
         */
        session_list_ptr = session_get_list();
 
-       /* Set up max poll set size */
-       lttng_poll_set_max_size();
-
        cmd_init();
 
        /* Check for the application socket timeout env variable. */
@@ -5771,6 +5778,7 @@ exit_init_data:
                retval = -1;
        }
 exit_ht_cleanup:
+exit_set_max_size:
 
        utils_close_pipe(ht_cleanup_pipe);
 exit_ht_cleanup_pipe:
This page took 0.02374 seconds and 4 git commands to generate.