X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf-text%2Fctf-text.c;h=017f31113f0f442672339f66958cefa994bdb59c;hb=c13e6f6d63053af00157695ed514d4c084bd85c5;hp=afdc07c1d80576c367743e0e49a25e98c5fe17aa;hpb=458af89d3baff393a4c38f70520fb51b811ad932;p=babeltrace.git diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index afdc07c1..017f3111 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -139,6 +139,14 @@ struct ctf_callsite_dups *ctf_trace_callsite_lookup(struct ctf_trace *trace, (gpointer) (unsigned long) callsite_name); } +void bt_ctf_text_hook(void) +{ + /* + * Dummy function to prevent the linker from discarding this format as + * "unused" in static builds. + */ +} + int print_field(struct bt_definition *definition) { /* Print all fields in verbose mode */ @@ -547,6 +555,10 @@ struct bt_trace_descriptor *ctf_text_open_trace(const char *path, int flags, FILE *fp; pos = g_new0(struct ctf_text_stream_pos, 1); + if (!pos) { + goto error; + } + init_trace_descriptor(&pos->trace_descriptor); pos->last_real_timestamp = -1ULL; pos->last_cycles_timestamp = -1ULL;