#include <limits.h>
#include <urcu.h>
#include <urcu/wfqueue.h>
+#include <urcu/list.h>
#include <common/hashtable/hashtable.h>
-#include <common/index/lttng-index.h>
+#include <common/index/ctf-index.h>
#include "ctf-trace.h"
RELAY_VIEWER_NOTIFICATION = 4,
};
+/*
+ * When we receive a stream, it gets stored in a list (on a per connection
+ * basis) until we have all the streams of the same channel and the metadata
+ * associated with it, then it gets flagged with viewer_ready.
+ */
+struct relay_stream_recv_handle {
+ uint64_t id; /* stream handle */
+ struct cds_list_head node;
+};
+
/*
* Represents a session for the relay point of view
*/
* update the oldest_tracefile_id.
*/
unsigned int tracefile_overwrite:1;
+ /*
+ * Can this stream be used by a viewer or are we waiting for additional
+ * information.
+ */
+ unsigned int viewer_ready:1;
};
/*
uint64_t total_index_received;
uint64_t tracefile_count;
uint64_t tracefile_count_current;
+ /* Stop after reading this tracefile. */
+ uint64_t tracefile_count_last;
struct lttng_ht_node_u64 stream_n;
struct rcu_head rcu_node;
struct ctf_trace *ctf_trace;
+ /*
+ * This lock blocks only when the writer is about to start overwriting
+ * a file currently read by the reader.
+ *
+ * This is nested INSIDE the viewer_stream_rotation_lock.
+ */
+ pthread_mutex_t overwrite_lock;
/* Information telling us if the stream is a metadata stream. */
unsigned int metadata_flag:1;
/*
struct lttng_ht_node_ulong sock_n;
struct rcu_head rcu_node;
enum connection_type type;
- unsigned int version_check_done:1;
/* protocol version to use for this session */
uint32_t major;
uint32_t minor;
struct lttng_ht *ctf_traces_ht; /* indexed by path name */
uint64_t session_id;
+ struct cds_list_head recv_head;
+ unsigned int version_check_done:1;
};
struct relay_local_data {
extern const char *tracing_group_name;
+extern const char * const config_section_name;
+
struct relay_stream *relay_stream_find_by_id(uint64_t stream_id);
#endif /* LTTNG_RELAYD_H */