while (1) {
DBG("Listener accepting connections");
- /* Zeroed the events structure */
- lttng_poll_reset(&events);
-
- nb_fd = LTTNG_POLL_GETNB(&events);
-
restart:
ret = lttng_poll_wait(&events, -1);
if (ret < 0) {
goto error;
}
+ nb_fd = ret;
+
DBG("Relay new connection received");
for (i = 0; i < nb_fd; i++) {
/* Fetch once the poll data */
}
while (1) {
- /* Zeroed the events structure */
- lttng_poll_reset(&events);
-
- nb_fd = LTTNG_POLL_GETNB(&events);
-
/* Infinite blocking call, waiting for transmission */
restart:
DBG3("Relayd worker thread polling...");
goto error;
}
+ nb_fd = ret;
+
for (i = 0; i < nb_fd; i++) {
/* Fetch once the poll data */
revents = LTTNG_POLL_GETEV(&events, i);
update_poll_flag = 0;
}
- nb_fd = LTTNG_POLL_GETNB(&events);
-
- DBG("Thread kernel polling on %d fds", nb_fd);
-
- /* Zeroed the poll events */
- lttng_poll_reset(&events);
+ DBG("Thread kernel polling on %d fds", events.nb_fd);
/* Poll infinite value of time */
restart:
continue;
}
+ nb_fd = ret;
+
for (i = 0; i < nb_fd; i++) {
/* Fetch once the poll data */
revents = LTTNG_POLL_GETEV(&events, i);
goto error;
}
- nb_fd = LTTNG_POLL_GETNB(&events);
-
health_code_update(&consumer_data->health);
/* Inifinite blocking call, waiting for transmission */
goto error;
}
+ nb_fd = ret;
+
for (i = 0; i < nb_fd; i++) {
/* Fetch once the poll data */
revents = LTTNG_POLL_GETEV(&events, i);
health_code_update(&consumer_data->health);
- /* Update number of fd */
- nb_fd = LTTNG_POLL_GETNB(&events);
-
/* Inifinite blocking call, waiting for transmission */
restart_poll:
health_poll_update(&consumer_data->health);
goto error;
}
+ nb_fd = ret;
+
for (i = 0; i < nb_fd; i++) {
/* Fetch once the poll data */
revents = LTTNG_POLL_GETEV(&events, i);
health_code_update(&health_thread_app_manage);
while (1) {
- /* Zeroed the events structure */
- lttng_poll_reset(&events);
-
- nb_fd = LTTNG_POLL_GETNB(&events);
-
- DBG("Apps thread polling on %d fds", nb_fd);
+ DBG("Apps thread polling on %d fds", events.nb_fd);
/* Inifinite blocking call, waiting for transmission */
restart:
goto error;
}
+ nb_fd = ret;
+
for (i = 0; i < nb_fd; i++) {
/* Fetch once the poll data */
revents = LTTNG_POLL_GETEV(&events, i);
while (1) {
DBG("Accepting application registration");
- nb_fd = LTTNG_POLL_GETNB(&events);
-
/* Inifinite blocking call, waiting for transmission */
restart:
health_poll_update(&health_thread_app_reg);
goto error;
}
+ nb_fd = ret;
+
for (i = 0; i < nb_fd; i++) {
health_code_update(&health_thread_app_reg);
while (1) {
DBG("Health check ready");
- nb_fd = LTTNG_POLL_GETNB(&events);
-
/* Inifinite blocking call, waiting for transmission */
restart:
ret = lttng_poll_wait(&events, -1);
goto error;
}
+ nb_fd = ret;
+
for (i = 0; i < nb_fd; i++) {
/* Fetch once the poll data */
revents = LTTNG_POLL_GETEV(&events, i);
while (1) {
DBG("Accepting client command ...");
- nb_fd = LTTNG_POLL_GETNB(&events);
-
/* Inifinite blocking call, waiting for transmission */
restart:
health_poll_update(&health_thread_cmd);
goto error;
}
+ nb_fd = ret;
+
for (i = 0; i < nb_fd; i++) {
/* Fetch once the poll data */
revents = LTTNG_POLL_GETEV(&events, i);
DBG("Metadata main loop started");
while (1) {
- lttng_poll_reset(&events);
-
- nb_fd = LTTNG_POLL_GETNB(&events);
-
/* Only the metadata pipe is set */
- if (nb_fd == 0 && consumer_quit == 1) {
+ if (events.nb_fd == 0 && consumer_quit == 1) {
goto end;
}
restart:
- DBG("Metadata poll wait with %d fd(s)", nb_fd);
+ DBG("Metadata poll wait with %d fd(s)", events.nb_fd);
ret = lttng_poll_wait(&events, -1);
DBG("Metadata event catched in thread");
if (ret < 0) {
goto error;
}
+ nb_fd = ret;
+
/* From here, the event is a metadata wait fd */
for (i = 0; i < nb_fd; i++) {
revents = LTTNG_POLL_GETEV(&events, i);