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) {
/*
health_code_update();
+ if (!revents) {
+ /* No activity for this FD (poll implementation). */
+ continue;
+ }
+
/* Thread quit pipe has been closed. Killing thread. */
ret = sessiond_check_thread_quit_pipe(pollfd, revents);
if (ret) {
health_code_update();
+ if (!revents) {
+ /* No activity for this FD (poll implementation). */
+ continue;
+ }
+
/* Thread quit pipe has been closed. Killing thread. */
ret = sessiond_check_thread_quit_pipe(pollfd, revents);
if (ret) {
health_code_update();
+ if (!revents) {
+ /* No activity for this FD (poll implementation). */
+ continue;
+ }
+
/*
* Thread quit pipe has been triggered, flag that we should stop
* but continue the current loop to handle potential data from
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) {
/*
health_code_update();
+ if (!revents) {
+ /* No activity for this FD (poll implementation). */
+ continue;
+ }
+
/* Thread quit pipe has been closed. Killing thread. */
ret = sessiond_check_thread_quit_pipe(pollfd, revents);
if (ret) {
uint32_t revents = LTTNG_POLL_GETEV(&events, i);
int pollfd = LTTNG_POLL_GETFD(&events, i);
+ if (!revents) {
+ /* No activity for this FD (poll implementation). */
+ continue;
+ }
+
cds_list_for_each_entry_safe(wait_node, tmp_wait_node,
&wait_queue->head, head) {
if (pollfd == wait_node->app->sock &&
revents = LTTNG_POLL_GETEV(&events, i);
pollfd = LTTNG_POLL_GETFD(&events, i);
+ if (!revents) {
+ /* No activity for this FD (poll implementation). */
+ continue;
+ }
+
/* Thread quit pipe has been closed. Killing thread. */
ret = sessiond_check_thread_quit_pipe(pollfd, revents);
if (ret) {
revents = LTTNG_POLL_GETEV(&events, i);
pollfd = LTTNG_POLL_GETFD(&events, i);
+ if (!revents) {
+ /* No activity for this FD (poll implementation). */
+ continue;
+ }
+
/* Thread quit pipe has been closed. Killing thread. */
ret = sessiond_check_thread_quit_pipe(pollfd, revents);
if (ret) {
health_code_update();
+ if (!revents) {
+ /* No activity for this FD (poll implementation). */
+ continue;
+ }
+
/* Thread quit pipe has been closed. Killing thread. */
ret = sessiond_check_thread_quit_pipe(pollfd, revents);
if (ret) {
}
tracing_group_name = strdup(arg);
if (!tracing_group_name) {
- perror("strdup");
+ PERROR("strdup");
ret = -ENOMEM;
}
tracing_group_name_override = 1;
}
consumerd32_bin = strdup(arg);
if (!consumerd32_bin) {
- perror("strdup");
+ PERROR("strdup");
ret = -ENOMEM;
}
consumerd32_bin_override = 1;
}
consumerd32_libdir = strdup(arg);
if (!consumerd32_libdir) {
- perror("strdup");
+ PERROR("strdup");
ret = -ENOMEM;
}
consumerd32_libdir_override = 1;
}
consumerd64_bin = strdup(arg);
if (!consumerd64_bin) {
- perror("strdup");
+ PERROR("strdup");
ret = -ENOMEM;
}
consumerd64_bin_override = 1;
}
consumerd64_libdir = strdup(arg);
if (!consumerd64_libdir) {
- perror("strdup");
+ PERROR("strdup");
ret = -ENOMEM;
}
consumerd64_libdir_override = 1;
free(opt_pidfile);
opt_pidfile = strdup(arg);
if (!opt_pidfile) {
- perror("strdup");
+ PERROR("strdup");
ret = -ENOMEM;
}
break;
free(opt_load_session_path);
opt_load_session_path = strdup(arg);
if (!opt_load_session_path) {
- perror("strdup");
+ PERROR("strdup");
ret = -ENOMEM;
}
break;
free(kmod_probes_list);
kmod_probes_list = strdup(arg);
if (!kmod_probes_list) {
- perror("strdup");
+ PERROR("strdup");
ret = -ENOMEM;
}
break;
free(kmod_extra_probes_list);
kmod_extra_probes_list = strdup(arg);
if (!kmod_extra_probes_list) {
- perror("strdup");
+ PERROR("strdup");
ret = -ENOMEM;
}
break;
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);
*/
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. */
retval = -1;
}
exit_ht_cleanup:
+exit_set_max_size:
utils_close_pipe(ht_cleanup_pipe);
exit_ht_cleanup_pipe: