On Mon, 20 Oct 2025 13:19:46 +0100
Douglas Raillard <[email protected]> wrote:

> Hi Steve,
> 
> On 15-10-2025 18:32, Steven Rostedt wrote:
> > From: Steven Rostedt <[email protected]>
> > 
> > When the "fields" option is enabled, it prints each trace event field
> > based on its type. But a dynamic array and a dynamic string can both have
> > a "char *" type. Printing it as a string can cause escape characters to be
> > printed and mess up the output of the trace.  
> 
> We faced the same issue when converting trace.dat to other formats that 
> distinguish
> between a byte buffer and an actual string. The current solution we have is to
> reserve "char []" for actual string and use "u8 []"/"uint8_t []" for byte 
> buffers.
> 
> Obviously it does not solve the problem for existing events but that could be 
> worth
> establishing a convention like that for new code and support it in 
> trace_output.c ?
> Most uses of trace data beyond direct printing would require knowing the data 
> schema
> from the header info, so value-based criteria are typically not suitable for 
> that.

Well, what the types are is not quite controlled by me, but by whoever
writes a trace event. Thus, it's not going to be something I can control in 
trace_output.c

-- Steve

Reply via email to