X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=475d6f72f3e3af0936b078af14c448926fc947b0;hb=f3985ab106d89d8e764c1a8dd0c8bda09b755d10;hp=5578e68d49b52c815465315edf536f716b78c645;hpb=5dafc78d347a7316fc1d4b57ba78fc347216edfb;p=babeltrace.git diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 5578e68d..475d6f72 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -159,6 +159,14 @@ struct bt_format ctf_format = { .convert_index_timestamp = ctf_convert_index_timestamp, }; +void bt_ctf_hook(void) +{ + /* + * Dummy function to prevent the linker from discarding this format as + * "unused" in static builds. + */ +} + static int ctf_timestamp_begin(struct bt_trace_descriptor *descriptor, struct bt_trace_handle *handle, enum bt_clock_type type, @@ -1407,7 +1415,7 @@ int ctf_trace_metadata_stream_read(struct ctf_trace *td, FILE **fp, * because its size includes garbage at the end (after final * \0). This is the allocated size, not the actual string size. */ - out = babeltrace_open_memstream(buf, &size); + out = bt_open_memstream(buf, &size); if (out == NULL) { perror("Metadata open_memstream"); return -errno; @@ -1423,7 +1431,7 @@ int ctf_trace_metadata_stream_read(struct ctf_trace *td, FILE **fp, } } /* close to flush the buffer */ - ret = babeltrace_close_memstream(buf, &size, out); + ret = bt_close_memstream(buf, &size, out); if (ret < 0) { int closeret; @@ -1445,7 +1453,7 @@ int ctf_trace_metadata_stream_read(struct ctf_trace *td, FILE **fp, *fp = NULL; return -ENOENT; } - *fp = babeltrace_fmemopen(*buf, buflen, "rb"); + *fp = bt_fmemopen(*buf, buflen, "rb"); if (!*fp) { perror("Metadata fmemopen"); return -errno; @@ -1789,7 +1797,7 @@ begin: fprintf(stderr, "[error] Unable to read packet header: %s\n", strerror(-ret)); return ret; } - len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("magic")); + len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_string("magic")); if (len_index >= 0) { struct bt_definition *field; uint64_t magic; @@ -1806,7 +1814,7 @@ begin: } /* check uuid */ - len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("uuid")); + len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_string("uuid")); if (len_index >= 0) { struct definition_array *defarray; struct bt_definition *field; @@ -1831,7 +1839,7 @@ begin: } } - len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("stream_id")); + len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_string("stream_id")); if (len_index >= 0) { struct bt_definition *field; @@ -1862,7 +1870,7 @@ begin: return ret; } /* read packet size from header */ - len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("packet_size")); + len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("packet_size")); if (len_index >= 0) { struct bt_definition *field; @@ -1874,7 +1882,7 @@ begin: } /* read content size from header */ - len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("content_size")); + len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("content_size")); if (len_index >= 0) { struct bt_definition *field; @@ -1886,7 +1894,7 @@ begin: } /* read timestamp begin from header */ - len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("timestamp_begin")); + len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("timestamp_begin")); if (len_index >= 0) { struct bt_definition *field; @@ -1901,7 +1909,7 @@ begin: } /* read timestamp end from header */ - len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("timestamp_end")); + len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("timestamp_end")); if (len_index >= 0) { struct bt_definition *field; @@ -1916,7 +1924,7 @@ begin: } /* read events discarded from header */ - len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("events_discarded")); + len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("events_discarded")); if (len_index >= 0) { struct bt_definition *field; @@ -1928,7 +1936,7 @@ begin: /* read packet_seq_num from header */ len_index = bt_struct_declaration_lookup_field_index( file_stream->parent.stream_packet_context->declaration, - g_quark_from_static_string("packet_seq_num")); + g_quark_from_string("packet_seq_num")); if (len_index >= 0) { struct bt_definition *field; @@ -2848,7 +2856,7 @@ void __attribute__((constructor)) ctf_init(void) { int ret; - ctf_format.name = g_quark_from_static_string("ctf"); + ctf_format.name = g_quark_from_string("ctf"); ret = bt_register_format(&ctf_format); assert(!ret); }