X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf-text%2Fctf-text.c;h=16f156de6929d3d5aedd68a77e89f24725120f98;hb=53d369292fd30d0932fb9e810a0d9a7388c0ddda;hp=9d5123a1fdb5a43c19c4ee0d425f07810eb07524;hpb=2654fe9bab8f0eaeb17264ef7abadfd14e245b23;p=babeltrace.git diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index 9d5123a1..16f156de 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +60,8 @@ int opt_all_field_names, opt_loglevel_field, opt_emf_field, opt_callsite_field, - opt_delta_field = 1; + opt_delta_field = 1, + opt_debug_info_full_path; enum field_item { ITEM_SCOPE, @@ -115,7 +117,8 @@ static GQuark Q_STREAM_PACKET_CONTEXT_TIMESTAMP_BEGIN, Q_STREAM_PACKET_CONTEXT_TIMESTAMP_END, Q_STREAM_PACKET_CONTEXT_EVENTS_DISCARDED, Q_STREAM_PACKET_CONTEXT_CONTENT_SIZE, - Q_STREAM_PACKET_CONTEXT_PACKET_SIZE; + Q_STREAM_PACKET_CONTEXT_PACKET_SIZE, + Q_STREAM_PACKET_CONTEXT_PACKET_SEQ_NUM; static void __attribute__((constructor)) init_quarks(void) @@ -125,6 +128,7 @@ void __attribute__((constructor)) init_quarks(void) Q_STREAM_PACKET_CONTEXT_EVENTS_DISCARDED = g_quark_from_static_string("stream.packet.context.events_discarded"); Q_STREAM_PACKET_CONTEXT_CONTENT_SIZE = g_quark_from_static_string("stream.packet.context.content_size"); Q_STREAM_PACKET_CONTEXT_PACKET_SIZE = g_quark_from_static_string("stream.packet.context.packet_size"); + Q_STREAM_PACKET_CONTEXT_PACKET_SEQ_NUM = g_quark_from_static_string("stream.packet.context.packet_seq_num"); } static @@ -135,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 */ @@ -152,6 +164,8 @@ int print_field(struct bt_definition *definition) return 0; if (definition->path == Q_STREAM_PACKET_CONTEXT_PACKET_SIZE) return 0; + if (definition->path == Q_STREAM_PACKET_CONTEXT_PACKET_SEQ_NUM) + return 0; return 1; } @@ -233,7 +247,6 @@ const char *print_loglevel(int value) static int ctf_text_write_event(struct bt_stream_pos *ppos, struct ctf_stream_definition *stream) - { struct ctf_text_stream_pos *pos = container_of(ppos, struct ctf_text_stream_pos, parent); @@ -262,6 +275,8 @@ int ctf_text_write_event(struct bt_stream_pos *ppos, struct ctf_stream_definitio return -EINVAL; } + handle_debug_info_event(stream_class, event); + if (stream->has_timestamp) { set_field_names_print(pos, ITEM_HEADER); if (pos->print_names) @@ -335,6 +350,8 @@ int ctf_text_write_event(struct bt_stream_pos *ppos, struct ctf_stream_definitio set_field_names_print(pos, ITEM_HEADER); if (pos->print_names) { fprintf(pos->fp, "trace:domain = "); + } else if (dom_print) { + fprintf(pos->fp, ":"); } fprintf(pos->fp, "%s", stream_class->trace->env.domain); if (pos->print_names) @@ -540,6 +557,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;