* Copyright 2010-2011 EfficiOS Inc. and Linux Foundation
*/
+#include <glib.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <babeltrace2/babeltrace.h>
+
#define BT_COMP_LOG_SELF_COMP self_comp
#define BT_LOG_OUTPUT_LEVEL log_level
#define BT_LOG_TAG "PLUGIN/SRC.CTF.LTTNG-LIVE/META"
#include "logging/comp-logging.h"
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <stdbool.h>
-#include <glib.h>
#include "compat/memstream.h"
-#include <babeltrace2/babeltrace.h>
+#include "../common/src/metadata/tsdl/ctf-meta-configure-ir-trace.hpp"
+#include "../common/src/metadata/tsdl/decoder.hpp"
+#include "lttng-live.hpp"
#include "metadata.hpp"
-#include "../common/metadata/decoder.hpp"
-#include "../common/metadata/ctf-meta-configure-ir-trace.hpp"
#define TSDL_MAGIC 0x75d11d57
return cc;
}
-BT_HIDDEN
enum lttng_live_iterator_status lttng_live_metadata_update(struct lttng_live_trace *trace)
{
struct lttng_live_session *session = trace->session;
/* No metadata stream yet. */
if (!metadata) {
- if (session->new_streams_needed) {
+ if (session->closed) {
+ /*
+ * The session is closed AND we never received any
+ * metadata this indicates that we will never receive
+ * any metadata.
+ */
+ status = LTTNG_LIVE_ITERATOR_STATUS_END;
+ } else if (session->new_streams_needed) {
status = LTTNG_LIVE_ITERATOR_STATUS_AGAIN;
} else {
session->new_streams_needed = true;
goto end;
}
- /* The relay sent zero bytes of metdata. */
+ /* The relay sent zero bytes of metadata. */
trace->metadata_stream_state = LTTNG_LIVE_METADATA_STREAM_STATE_NOT_NEEDED;
goto end;
}
trace->clock_class = borrow_any_clock_class(trace->trace_class);
}
- /* The metadata was updated succesfully. */
+ /* The metadata was updated successfully. */
trace->metadata_stream_state = LTTNG_LIVE_METADATA_STREAM_STATE_NOT_NEEDED;
break;
return status;
}
-BT_HIDDEN
int lttng_live_metadata_create_stream(struct lttng_live_session *session, uint64_t ctf_trace_id,
- uint64_t stream_id, const char *trace_name)
+ uint64_t stream_id)
{
bt_self_component *self_comp = session->self_comp;
bt_logging_level log_level = session->log_level;
return -1;
}
-BT_HIDDEN
void lttng_live_metadata_fini(struct lttng_live_trace *trace)
{
struct lttng_live_metadata *metadata = trace->metadata;