* Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
-#include <common/pipe.h>
-#include <common/utils.h>
+#include "health-sessiond.hpp"
+#include "kernel-consumer.hpp"
+#include "kernel.hpp"
+#include "manage-kernel.hpp"
+#include "testpoint.hpp"
+#include "thread.hpp"
+#include "utils.hpp"
-#include "manage-kernel.h"
-#include "testpoint.h"
-#include "health-sessiond.h"
-#include "utils.h"
-#include "thread.h"
-#include "kernel.h"
-#include "kernel-consumer.h"
+#include <common/pipe.hpp>
+#include <common/utils.hpp>
struct thread_notifiers {
struct lttng_pipe *quit_pipe;
int kernel_poll_pipe_read_fd;
};
struct thread_notifiers {
struct lttng_pipe *quit_pipe;
int kernel_poll_pipe_read_fd;
};
- cds_list_for_each_entry(channel,
- &session->kernel_session->channel_list.head, list) {
+ cds_list_for_each_entry (
+ channel, &session->kernel_session->channel_list.head, list) {
/* Add channel fd to the kernel poll set */
ret = lttng_poll_add(events, channel->fd, LPOLLIN | LPOLLRDNORM);
if (ret < 0) {
/* Add channel fd to the kernel poll set */
ret = lttng_poll_add(events, channel->fd, LPOLLIN | LPOLLRDNORM);
if (ret < 0) {
- cds_list_for_each_entry(channel,
- &ksess->channel_list.head, list) {
+ cds_list_for_each_entry (channel, &ksess->channel_list.head, list) {
- cds_lfht_for_each_entry(ksess->consumer->socks->ht,
- &iter.iter, socket, node.node) {
+ cds_lfht_for_each_entry (
+ ksess->consumer->socks->ht, &iter.iter, socket, node.node) {
- ret = kernel_consumer_send_channel_streams(socket,
- channel, ksess,
- session->output_traces ? 1 : 0);
+ ret = kernel_consumer_send_channel_streams(
+ socket, channel, ksess, session->output_traces ? 1 : 0);
- int ret, i, pollfd, update_poll_flag = 1, err = -1;
- uint32_t revents, nb_fd;
+ int ret, i, update_poll_flag = 1, err = -1;
+ uint32_t nb_fd;
- ret = lttng_poll_add(&events,
- notifiers->kernel_poll_pipe_read_fd,
- LPOLLIN);
+ ret = lttng_poll_add(&events, notifiers->kernel_poll_pipe_read_fd, LPOLLIN);
} else if (ret == 0) {
/* Should not happen since timeout is infinite */
ERR("Return value of poll is 0 with an infinite timeout.\n"
} else if (ret == 0) {
/* Should not happen since timeout is infinite */
ERR("Return value of poll is 0 with an infinite timeout.\n"
- revents = LTTNG_POLL_GETEV(&events, i);
- pollfd = LTTNG_POLL_GETFD(&events, i);
+ const auto revents = LTTNG_POLL_GETEV(&events, i);
+ const auto pollfd = LTTNG_POLL_GETFD(&events, i);
- if (pollfd == quit_pipe_read_fd) {
+ /* Activity on thread quit pipe, exiting. */
+ if (pollfd == thread_quit_pipe_fd) {
+ DBG("Activity on thread quit pipe");
- * Ret value is useless here, if this pipe gets any actions an
- * update is required anyway.
+ * Ret value is useless here, if this pipe gets any actions
+ * an update is required anyway.
health_error();
ERR("Health error occurred in %s", __func__);
WARN("Kernel thread died unexpectedly. "
health_error();
ERR("Health error occurred in %s", __func__);
WARN("Kernel thread died unexpectedly. "
notifiers->kernel_poll_pipe_read_fd = kernel_poll_pipe_read_fd;
thread = lttng_thread_create("Kernel management",
notifiers->kernel_poll_pipe_read_fd = kernel_poll_pipe_read_fd;
thread = lttng_thread_create("Kernel management",
- thread_kernel_management,
- shutdown_kernel_management_thread,
- cleanup_kernel_management_thread,
- notifiers);
+ thread_kernel_management,
+ shutdown_kernel_management_thread,
+ cleanup_kernel_management_thread,
+ notifiers);