projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
relayd: use same pipe for live and main
[lttng-tools.git]
/
src
/
bin
/
lttng-relayd
/
live.c
diff --git
a/src/bin/lttng-relayd/live.c
b/src/bin/lttng-relayd/live.c
index 53cc660918d463aacae382c6a2c858281925f26d..bfa7b85259ad7d3d2a75fdba5dfb416feccfe13c 100644
(file)
--- a/
src/bin/lttng-relayd/live.c
+++ b/
src/bin/lttng-relayd/live.c
@@
-60,12
+60,6
@@
static struct lttng_uri *live_uri;
static struct lttng_uri *live_uri;
-/*
- * Quit pipe for all threads. This permits a single cancellation point
- * for all threads when receiving an event on the pipe.
- */
-static int live_thread_quit_pipe[2] = { -1, -1 };
-
/*
* This pipe is used to inform the worker thread that a command is queued and
* ready to be processed.
/*
* This pipe is used to inform the worker thread that a command is queued and
* ready to be processed.
@@
-126,7
+120,7
@@
void stop_threads(void)
/* Stopping all threads */
DBG("Terminating all live threads");
/* Stopping all threads */
DBG("Terminating all live threads");
- ret = notify_thread_pipe(
live_
thread_quit_pipe[1]);
+ ret = notify_thread_pipe(thread_quit_pipe[1]);
if (ret < 0) {
ERR("write error on thread quit pipe");
}
if (ret < 0) {
ERR("write error on thread quit pipe");
}
@@
-155,7
+149,7
@@
int create_thread_poll_set(struct lttng_poll_event *events, int size)
}
/* Add quit pipe */
}
/* Add quit pipe */
- ret = lttng_poll_add(events,
live_thread_quit_pipe[0], LPOLLIN
);
+ ret = lttng_poll_add(events,
thread_quit_pipe[0], LPOLLIN | LPOLLERR
);
if (ret < 0) {
goto error;
}
if (ret < 0) {
goto error;
}
@@
-174,7
+168,7
@@
error:
static
int check_thread_quit_pipe(int fd, uint32_t events)
{
static
int check_thread_quit_pipe(int fd, uint32_t events)
{
- if (fd ==
live_
thread_quit_pipe[0] && (events & LPOLLIN)) {
+ if (fd == thread_quit_pipe[0] && (events & LPOLLIN)) {
return 1;
}
return 1;
}
@@
-245,9
+239,7
@@
void *thread_listener(void *data)
goto error_sock_control;
}
goto error_sock_control;
}
- /*
- * Pass 3 as size here for the thread quit pipe, control and data socket.
- */
+ /* Pass 2 as size here for the thread quit pipe and control sockets. */
ret = create_thread_poll_set(&events, 2);
if (ret < 0) {
goto error_create_poll;
ret = create_thread_poll_set(&events, 2);
if (ret < 0) {
goto error_create_poll;
@@
-259,6
+251,8
@@
void *thread_listener(void *data)
goto error_poll_add;
}
goto error_poll_add;
}
+ lttng_relay_notify_ready();
+
while (1) {
health_code_update();
while (1) {
health_code_update();
@@
-1121,6
+1115,7
@@
void destroy_viewer_stream(struct relay_viewer_stream *vstream)
* stream.
*/
if (ret_ref == 1 && vstream->ctf_trace->viewer_metadata_stream) {
* stream.
*/
if (ret_ref == 1 && vstream->ctf_trace->viewer_metadata_stream) {
+ delete_viewer_stream(vstream->ctf_trace->viewer_metadata_stream);
destroy_viewer_stream(vstream->ctf_trace->viewer_metadata_stream);
vstream->ctf_trace->metadata_stream = NULL;
DBG("Freeing ctf_trace %" PRIu64, vstream->ctf_trace->id);
destroy_viewer_stream(vstream->ctf_trace->viewer_metadata_stream);
vstream->ctf_trace->metadata_stream = NULL;
DBG("Freeing ctf_trace %" PRIu64, vstream->ctf_trace->id);
@@
-2043,7
+2038,7
@@
error:
* main
*/
int live_start_threads(struct lttng_uri *uri,
* main
*/
int live_start_threads(struct lttng_uri *uri,
- struct relay_local_data *relay_ctx
, int quit_pipe[2]
)
+ struct relay_local_data *relay_ctx)
{
int ret = 0;
void *status;
{
int ret = 0;
void *status;
@@
-2052,9
+2047,6
@@
int live_start_threads(struct lttng_uri *uri,
assert(uri);
live_uri = uri;
assert(uri);
live_uri = uri;
- live_thread_quit_pipe[0] = quit_pipe[0];
- live_thread_quit_pipe[1] = quit_pipe[1];
-
/* Check if daemon is UID = 0 */
is_root = !getuid();
/* Check if daemon is UID = 0 */
is_root = !getuid();
This page took
0.025071 seconds
and
4
git commands to generate.