From: Philippe Proulx Date: Tue, 9 Jul 2019 23:40:45 +0000 (-0400) Subject: ctf: refactor metadata decoder to always have an instance X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=06be99464988953e390114337ccdd20622fb50d1;hp=06be99464988953e390114337ccdd20622fb50d1;p=babeltrace.git ctf: refactor metadata decoder to always have an instance This patch changes the internal `ctf` plugin's metadata decoder API so that you need to create a decoder instance to read properties instead of calling ctf_metadata_decoder_packetized_file_stream_to_buf(). Now, you create a metadata decoder, you call ctf_metadata_decoder_append_content() (similar to what was called ctf_metadata_decoder_decode()), and then you can get the decoder's current properties: * ctf_metadata_decoder_get_ir_trace_class() * ctf_metadata_decoder_borrow_ctf_trace_class() * ctf_metadata_decoder_get_byte_order() * ctf_metadata_decoder_get_uuid() * ctf_metadata_decoder_get_text() The decoder's configuration contains two new flags: `create_trace_class`: Controls whether or not ctf_metadata_decoder_append_content() invokes the AST visitor to generate trace class objects. Trace classes are not needed, for example, for the `metadata-info` query. `keep_plain_text`: Controls whether or not the decoder accumulates the metadata stream's plain text when you call ctf_metadata_decoder_append_content(). This needs to be true to use ctf_metadata_decoder_get_text(). The goal of all this is to eventually add new metadata property getters which do not need to create trace classes or to keep the metadata plain text. Signed-off-by: Philippe Proulx Change-Id: If1095da91aee0f446d7f5efcec765e5abbb2b30a Reviewed-on: https://review.lttng.org/c/babeltrace/+/1842 CI-Build: Simon Marchi Reviewed-by: Simon Marchi Tested-by: jenkins ---