ctf.fs: bt_ctf_notif_iter_create(): assert() that all medops exist
[babeltrace.git] / formats / lttng-live / lttng-live-plugin.c
index adb7249dae8e16e5a30c82b34fff9468d0536e88..f2c7536ec0d4e6223f21d68985fa9fcbb0665b3b 100644 (file)
 
 static volatile int should_quit;
 
+void bt_lttng_live_hook(void)
+{
+       /*
+        * Dummy function to prevent the linker from discarding this format as
+        * "unused" in static builds.
+        */
+}
+
 int lttng_live_should_quit(void)
 {
        return should_quit;
@@ -119,6 +127,10 @@ int parse_url(const char *path, struct lttng_live_ctx *ctx)
        if (proto_offset > path_len) {
                goto end;
        }
+       if (proto == 6) {
+               fprintf(stderr, "[error] IPv6 is currently unsupported by lttng-live\n");
+               goto end;
+       }
        /* TODO : parse for IPv6 as well */
        /* Parse the hostname or IP */
        ret = sscanf(&path[proto_offset], "%[a-zA-Z.0-9%-]%s",
@@ -292,6 +304,12 @@ struct bt_trace_descriptor *lttng_live_open_trace(const char *path, int flags,
        pos->parent.rw_table = NULL;
        pos->parent.event_cb = NULL;
        pos->parent.trace = &pos->trace_descriptor;
+       /*
+        * Since we do *everything* in this function, we are skipping
+        * the output plugin handling that is part of Babeltrace 1.x.
+        * Therefore, don't expect the --output cmd line option to work.
+        * This limits the output of lttng-live to stderr and stdout.
+        */
        if (lttng_live_open_trace_read(path) < 0) {
                goto error;
        }
@@ -307,7 +325,7 @@ int lttng_live_close_trace(struct bt_trace_descriptor *td)
        struct ctf_text_stream_pos *pos =
                container_of(td, struct ctf_text_stream_pos,
                        trace_descriptor);
-       free(pos);
+       g_free(pos);
        return 0;
 }
 
@@ -322,7 +340,7 @@ void __attribute__((constructor)) lttng_live_init(void)
 {
        int ret;
 
-       lttng_live_format.name = g_quark_from_static_string("lttng-live");
+       lttng_live_format.name = g_quark_from_string("lttng-live");
        ret = bt_register_format(&lttng_live_format);
        assert(!ret);
 }
This page took 0.025136 seconds and 4 git commands to generate.