From: Jérémie Galarneau Date: Mon, 27 Jun 2016 19:18:38 +0000 (-0400) Subject: Lazily initialize max poll set size X-Git-Tag: v2.9.0-rc1~117 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=22dad56815ce0201c5ae7d5ef5d79cc0c6a42c5e;p=lttng-tools.git Lazily initialize max poll set size Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-consumerd/lttng-consumerd.c b/src/bin/lttng-consumerd/lttng-consumerd.c index 00660fcd6..1cc1eb9ae 100644 --- a/src/bin/lttng-consumerd/lttng-consumerd.c +++ b/src/bin/lttng-consumerd/lttng-consumerd.c @@ -362,12 +362,6 @@ int main(int argc, char **argv) goto exit_health_consumerd_cleanup; } - /* Set up max poll set size */ - if (lttng_poll_set_max_size()) { - retval = -1; - goto exit_init_data; - } - if (*command_sock_path == '\0') { switch (opt_type) { case LTTNG_CONSUMER_KERNEL: diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 6ad656625..007f95131 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -2802,12 +2802,6 @@ int main(int argc, char **argv) /* Init relay command queue. */ cds_wfcq_init(&relay_conn_queue.head, &relay_conn_queue.tail); - /* Set up max poll set size */ - if (lttng_poll_set_max_size()) { - retval = -1; - goto exit_init_data; - } - /* Initialize communication library */ lttcomm_init(); lttcomm_inet_init(); diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index ee19ef840..0c97b1cb6 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -5662,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); @@ -6246,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: diff --git a/src/common/compat/compat-epoll.c b/src/common/compat/compat-epoll.c index 6259fd389..9c2688d33 100644 --- a/src/common/compat/compat-epoll.c +++ b/src/common/compat/compat-epoll.c @@ -76,8 +76,9 @@ int compat_epoll_create(struct lttng_poll_event *events, int size, int flags) } if (!poll_max_size) { - ERR("poll_max_size not initialized yet"); - goto error; + if (lttng_poll_set_max_size()) { + goto error; + } } /* Don't bust the limit here */