projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clean-up: sessiond: rename public accessors
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
manage-kernel.cpp
diff --git
a/src/bin/lttng-sessiond/manage-kernel.cpp
b/src/bin/lttng-sessiond/manage-kernel.cpp
index 2ffe60919a08b08f08d51923704e040422630862..0920852501d486e2d1a6bbdf7ba07189a54a6423 100644
(file)
--- a/
src/bin/lttng-sessiond/manage-kernel.cpp
+++ b/
src/bin/lttng-sessiond/manage-kernel.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2011
David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011
EfficiOS Inc.
* 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>
*
@@
-7,21
+7,23
@@
*
*/
*
*/
-#include <common/pipe.h>
-#include <common/utils.h>
+#include <common/pipe.h
pp
>
+#include <common/utils.h
pp
>
-#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 "manage-kernel.h
pp
"
+#include "testpoint.h
pp
"
+#include "health-sessiond.h
pp
"
+#include "utils.h
pp
"
+#include "thread.h
pp
"
+#include "kernel.h
pp
"
+#include "kernel-consumer.h
pp
"
+namespace {
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;
};
+} /* namespace */
/*
* Update the kernel poll set of all channel fd available over all tracing
/*
* Update the kernel poll set of all channel fd available over all tracing
@@
-163,12
+165,12
@@
error:
*/
static void *thread_kernel_management(void *data)
{
*/
static void *thread_kernel_management(void *data)
{
- 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;
char tmp;
struct lttng_poll_event events;
struct thread_notifiers *notifiers = (thread_notifiers *) data;
char tmp;
struct lttng_poll_event events;
struct thread_notifiers *notifiers = (thread_notifiers *) data;
- const
int quit_pipe_read
_fd = lttng_pipe_get_readfd(notifiers->quit_pipe);
+ const
auto thread_quit_pipe
_fd = lttng_pipe_get_readfd(notifiers->quit_pipe);
DBG("[thread] Thread manage kernel started");
DBG("[thread] Thread manage kernel started");
@@
-210,7
+212,7
@@
static void *thread_kernel_management(void *data)
}
ret = lttng_poll_add(&events,
}
ret = lttng_poll_add(&events,
-
quit_pipe_read
_fd,
+
thread_quit_pipe
_fd,
LPOLLIN);
if (ret < 0) {
goto error;
LPOLLIN);
if (ret < 0) {
goto error;
@@
-252,12
+254,14
@@
static void *thread_kernel_management(void *data)
for (i = 0; i < nb_fd; i++) {
/* Fetch once the poll data */
for (i = 0; i < nb_fd; i++) {
/* Fetch once the poll data */
- 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);
health_code_update();
health_code_update();
- if (pollfd == quit_pipe_read_fd) {
+ /* Activity on thread quit pipe, exiting. */
+ if (pollfd == thread_quit_pipe_fd) {
+ DBG("Activity on thread quit pipe");
err = 0;
goto exit;
}
err = 0;
goto exit;
}
@@
-332,7
+336,7
@@
bool launch_kernel_management_thread(int kernel_poll_pipe_read_fd)
struct thread_notifiers *notifiers = NULL;
struct lttng_thread *thread;
struct thread_notifiers *notifiers = NULL;
struct lttng_thread *thread;
- notifiers =
(thread_notifiers *) zmalloc(sizeof(*notifiers)
);
+ notifiers =
zmalloc<thread_notifiers>(
);
if (!notifiers) {
goto error_alloc;
}
if (!notifiers) {
goto error_alloc;
}
This page took
0.025861 seconds
and
4
git commands to generate.