tracer: Allow outputting logs (in particular tracer logs) in Common Trace Format (ctf)
Submitted by Thibault Saunier
Currently we are going through the standard GStreamer logging subsystem to output the tracer logs, but it has several issues:
- it has not been designed to output structured data
- it is a plain text format which is not optimal at all in term of speed to write as well as size of the output
- it is not a standardized format and we need to write our own tools to analyze the traces
- we currently use a lock around each call to the debug function which is suboptimal
Starting from that I think many of us agree (from conversations we had during the hackfest) that a nice way to solve those issues would be to allow outputting our traces as Common Trace Format. This format is used by the lttng project and is the main tracing format outputted by the Linux kernel. Many tools are available from the LTTNG project and we can use the babeltrace library to simplify CTF trace generation (the important part of the library is licenced under MIT so we should not have any problem using it in GStreamer core ifaiu).
Also during the hackfest we talked about the possibility to use that same format to ouput our debug logs, but that work will be part of another bug.
This feature can currently be activated through the GST_DEBUG_FORMAT=ctf,directory=/some/dir environment variable, and this same variable should be used for any format (still supporting the GST_DEBUG_FILE var too).
I am attaching here the first iteration of the implementation.