projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: lttng-relayd: unhandled out of memory error
[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 c60f7e4c9c4db0f3d00dff773b2c537b0cc4bd43..2940b2c6131bd63792fd34fe43badcdef3f359a7 100644
(file)
--- a/
src/bin/lttng-relayd/live.c
+++ b/
src/bin/lttng-relayd/live.c
@@
-17,6
+17,7
@@
*/
#define _GNU_SOURCE
*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <getopt.h>
#include <grp.h>
#include <limits.h>
#include <getopt.h>
#include <grp.h>
#include <limits.h>
@@
-43,6
+44,7
@@
#include <common/common.h>
#include <common/compat/poll.h>
#include <common/compat/socket.h>
#include <common/common.h>
#include <common/compat/poll.h>
#include <common/compat/socket.h>
+#include <common/compat/endian.h>
#include <common/defaults.h>
#include <common/futex.h>
#include <common/index/index.h>
#include <common/defaults.h>
#include <common/futex.h>
#include <common/index/index.h>
@@
-557,11
+559,12
@@
restart:
new_conn->sock = newsock;
/* Enqueue request for the dispatcher thread. */
new_conn->sock = newsock;
/* Enqueue request for the dispatcher thread. */
- cds_wfq_enqueue(&viewer_conn_queue.queue, &new_conn->qnode);
+ cds_wfcq_enqueue(&viewer_conn_queue.head, &viewer_conn_queue.tail,
+ &new_conn->qnode);
/*
* Wake the dispatch queue futex. Implicit memory barrier with
/*
* Wake the dispatch queue futex. Implicit memory barrier with
- * the exchange in cds_wfq_enqueue.
+ * the exchange in cds_wf
c
q_enqueue.
*/
futex_nto1_wake(&viewer_conn_queue.futex);
}
*/
futex_nto1_wake(&viewer_conn_queue.futex);
}
@@
-600,7
+603,7
@@
void *thread_dispatcher(void *data)
{
int err = -1;
ssize_t ret;
{
int err = -1;
ssize_t ret;
- struct cds_wfq_node *node;
+ struct cds_wf
c
q_node *node;
struct relay_connection *conn = NULL;
DBG("[thread] Live viewer relay dispatcher started");
struct relay_connection *conn = NULL;
DBG("[thread] Live viewer relay dispatcher started");
@@
-623,7
+626,8
@@
void *thread_dispatcher(void *data)
health_code_update();
/* Dequeue commands */
health_code_update();
/* Dequeue commands */
- node = cds_wfq_dequeue_blocking(&viewer_conn_queue.queue);
+ node = cds_wfcq_dequeue_blocking(&viewer_conn_queue.head,
+ &viewer_conn_queue.tail);
if (node == NULL) {
DBG("Woken up but nothing in the live-viewer "
"relay command queue");
if (node == NULL) {
DBG("Woken up but nothing in the live-viewer "
"relay command queue");
@@
-1205,6
+1209,7
@@
static int check_index_status(struct relay_viewer_stream *vstream,
*/
index->status = htobe32(LTTNG_VIEWER_INDEX_INACTIVE);
index->timestamp_end = htobe64(rstream->beacon_ts_end);
*/
index->status = htobe32(LTTNG_VIEWER_INDEX_INACTIVE);
index->timestamp_end = htobe64(rstream->beacon_ts_end);
+ index->stream_id = htobe64(rstream->ctf_stream_id);
goto index_ready;
} else if (rstream->total_index_received <= vstream->last_sent_index
&& !vstream->close_write_flag) {
goto index_ready;
} else if (rstream->total_index_received <= vstream->last_sent_index
&& !vstream->close_write_flag) {
@@
-2111,7
+2116,7
@@
int live_start_threads(struct lttng_uri *uri,
}
/* Init relay command queue. */
}
/* Init relay command queue. */
- cds_wf
q_init(&viewer_conn_queue.queue
);
+ cds_wf
cq_init(&viewer_conn_queue.head, &viewer_conn_queue.tail
);
/* Set up max poll set size */
lttng_poll_set_max_size();
/* Set up max poll set size */
lttng_poll_set_max_size();
This page took
0.024411 seconds
and
4
git commands to generate.