X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fbt-dummy%2Fbt-dummy.c;h=fd10ccad39e3f79a500ddf12a87124ec135380ca;hb=7e3e3582f6fc79c97b07fad7fa7019e8a80aeb0e;hp=9fde1c966316a85a465d7ba387a54f364ff0e0c6;hpb=37b99bdba8478569634dd5ceecea50d1e9f9ac0a;p=babeltrace.git diff --git a/formats/bt-dummy/bt-dummy.c b/formats/bt-dummy/bt-dummy.c index 9fde1c96..fd10ccad 100644 --- a/formats/bt-dummy/bt-dummy.c +++ b/formats/bt-dummy/bt-dummy.c @@ -38,6 +38,14 @@ #include #include +void bt_dummy_hook(void) +{ + /* + * Dummy function to prevent the linker from discarding this format as + * "unused" in static builds. + */ +} + static int bt_dummy_write_event(struct bt_stream_pos *ppos, struct ctf_stream_definition *stream) { @@ -54,6 +62,7 @@ struct bt_trace_descriptor *bt_dummy_open_trace(const char *path, int flags, pos = g_new0(struct ctf_text_stream_pos, 1); pos->parent.rw_table = NULL; pos->parent.event_cb = bt_dummy_write_event; + pos->parent.trace = &pos->trace_descriptor; return &pos->trace_descriptor; } @@ -78,7 +87,7 @@ void __attribute__((constructor)) bt_dummy_init(void) { int ret; - bt_dummy_format.name = g_quark_from_static_string("dummy"); + bt_dummy_format.name = g_quark_from_string("dummy"); ret = bt_register_format(&bt_dummy_format); assert(!ret); }