Lazily initialize max poll set size
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index fc954d28d46cccf1a4e55ab5a938a619c822f808..0c97b1cb64fe196370fae53634e7c65246f53729 100644 (file)
@@ -3086,6 +3086,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock,
        case LTTNG_LIST_EVENTS:
        case LTTNG_LIST_SYSCALLS:
        case LTTNG_LIST_TRACKER_PIDS:
+       case LTTNG_DATA_PENDING:
                break;
        default:
                /* Setup lttng message with no payload */
@@ -5474,14 +5475,14 @@ static int set_signal_handler(void)
 
 /*
  * Set open files limit to unlimited. This daemon can open a large number of
- * file descriptors in order to consumer multiple kernel traces.
+ * file descriptors in order to consume multiple kernel traces.
  */
 static void set_ulimit(void)
 {
        int ret;
        struct rlimit lim;
 
-       /* The kernel does not allowed an infinite limit for open files */
+       /* The kernel does not allow an infinite limit for open files */
        lim.rlim_cur = 65535;
        lim.rlim_max = 65535;
 
@@ -5661,12 +5662,6 @@ 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);
@@ -6225,6 +6220,13 @@ exit_init_data:
        rcu_thread_offline();
        rcu_unregister_thread();
 
+       /*
+        * Ensure all prior call_rcu are done. call_rcu callbacks may push
+        * hash tables to the ht_cleanup thread. Therefore, we ensure that
+        * the queue is empty before shutting down the clean-up thread.
+        */
+       rcu_barrier();
+
        ret = notify_thread_pipe(ht_cleanup_quit_pipe[1]);
        if (ret < 0) {
                ERR("write error on ht_cleanup quit pipe");
@@ -6238,7 +6240,6 @@ exit_init_data:
                retval = -1;
        }
 exit_ht_cleanup:
-exit_set_max_size:
 
        utils_close_pipe(ht_cleanup_pipe);
 exit_ht_cleanup_pipe:
@@ -6254,9 +6255,6 @@ exit_health_sessiond_cleanup:
 exit_create_run_as_worker_cleanup:
 
 exit_options:
-       /* Ensure all prior call_rcu are done. */
-       rcu_barrier();
-
        sessiond_cleanup_options();
 
 exit_set_signal_handler:
This page took 0.024429 seconds and 4 git commands to generate.