projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sessiond: ust: conditionally enable the underscore prefix variant quirk
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
manage-apps.cpp
diff --git
a/src/bin/lttng-sessiond/manage-apps.cpp
b/src/bin/lttng-sessiond/manage-apps.cpp
index 4ee3538b2b9e70703edf7f02d2f9a5adf79767b8..ea46f05277ca9aad79297afda111a2d1be461181 100644
(file)
--- a/
src/bin/lttng-sessiond/manage-apps.cpp
+++ b/
src/bin/lttng-sessiond/manage-apps.cpp
@@
-13,10
+13,12
@@
#include "utils.hpp"
#include "thread.hpp"
#include "utils.hpp"
#include "thread.hpp"
+namespace {
struct thread_notifiers {
struct lttng_pipe *quit_pipe;
int apps_cmd_pipe_read_fd;
};
struct thread_notifiers {
struct lttng_pipe *quit_pipe;
int apps_cmd_pipe_read_fd;
};
+} /* namespace */
static void cleanup_application_management_thread(void *data)
{
static void cleanup_application_management_thread(void *data)
{
@@
-41,12
+43,12
@@
static void cleanup_application_management_thread(void *data)
*/
static void *thread_application_management(void *data)
{
*/
static void *thread_application_management(void *data)
{
- int i, ret,
pollfd,
err = -1;
+ int i, ret, err = -1;
ssize_t size_ret;
ssize_t size_ret;
- uint32_t
revents,
nb_fd;
+ uint32_t nb_fd;
struct lttng_poll_event events;
struct thread_notifiers *notifiers = (thread_notifiers *) data;
struct lttng_poll_event events;
struct thread_notifiers *notifiers = (thread_notifiers *) data;
- const
int quit_pipe_read
_fd = lttng_pipe_get_readfd(
+ const
auto thread_quit_pipe
_fd = lttng_pipe_get_readfd(
notifiers->quit_pipe);
DBG("[thread] Manage application started");
notifiers->quit_pipe);
DBG("[thread] Manage application started");
@@
-73,7
+75,7
@@
static void *thread_application_management(void *data)
goto error;
}
goto error;
}
- ret = lttng_poll_add(&events,
quit_pipe_read_fd, LPOLLIN | LPOLLERR
);
+ ret = lttng_poll_add(&events,
thread_quit_pipe_fd, LPOLLIN
);
if (ret < 0) {
goto error;
}
if (ret < 0) {
goto error;
}
@@
-108,15
+110,19
@@
static void *thread_application_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;
- } else if (pollfd == notifiers->apps_cmd_pipe_read_fd) {
+ }
+
+ if (pollfd == notifiers->apps_cmd_pipe_read_fd) {
/* Inspect the apps cmd pipe */
if (revents & LPOLLIN) {
int sock;
/* Inspect the apps cmd pipe */
if (revents & LPOLLIN) {
int sock;
@@
-136,8
+142,7
@@
static void *thread_application_management(void *data)
* Since this is a command socket (write then read),
* we only monitor the error events of the socket.
*/
* Since this is a command socket (write then read),
* we only monitor the error events of the socket.
*/
- ret = lttng_poll_add(&events, sock,
- LPOLLERR | LPOLLHUP | LPOLLRDHUP);
+ ret = lttng_poll_add(&events, sock, LPOLLRDHUP);
if (ret < 0) {
goto error;
}
if (ret < 0) {
goto error;
}
@@
-211,7
+216,7
@@
bool launch_application_management_thread(int apps_cmd_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.029103 seconds
and
4
git commands to generate.