Fix: `ctf` plugin: do not have an `mdec` variable where not strictly needed
Issue
=====
The `metadata-info` query needs to call
ctf_metadata_decoder_packetized_file_stream_to_buf() with a custom log
level and no self component (`NULL`). Eventually, this reaches
decode_packet() which is in the `decoder.c` file and thus uses
`mdec->self_comp` to find its self component in the BT_COMP_LOG*()
macros. But in this case, `mdec` is `NULL`, so there's an invalid
memory access.
Solution
========
Instead of using BT_COMP_LOG_CUR_LVL() everywhere in this function, and
because decode_packet() and
ctf_metadata_decoder_packetized_file_stream_to_buf_with_mdec() do not
strictly need `mdec` except for logging its address at some places, move
the functions to the new `decoder-packetized-file-stream-to-buf.c` file
and make them not accept an `mdec` argument.
This new file's logging uses the local `log_level` and `self_comp`
variables, so the logging statement are not modified.
Known drawbacks
===============
None.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I55874790b2b873ff1718a774e57011300e57518d
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1526
Tested-by: jenkins <jenkins@lttng.org>
This page took 0.038662 seconds and 5 git commands to generate.