Re: [PATCH v2 31/87] trace-cmd library: Fit CPU latency trace data in the new trace file version 7 format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 29 Jul 2021 08:09:03 +0300
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote:

> +++ b/lib/trace-cmd/include/private/trace-cmd-private.h
> @@ -135,6 +135,7 @@ enum {
>  	TRACECMD_OPTION_TIME_SHIFT,
>  	TRACECMD_OPTION_GUEST,
>  	TRACECMD_OPTION_TSC2NSEC,
> +	TRACECMD_OPTION_BUFFER_LAT,

I just realized that this will break the parsing.

You can't add an enum in the middle. That will cause all the other
enums to shift in value,  and these are already a file API.

>  	TRACECMD_OPTION_HEADER_INFO,

For example, if you saved a file before this patch, the
TRACECMD_OPTION_HEADER_INFO will be one number, and stored in the
trace.dat file.

Then if you try to read that same trace.dat file after this patch, it
will interpret the TRACECMD_OPTION_HEADER_INFO as
TRACECMD_OPTION_BUFFER_LAT, which will obviously be incorrect.

-- Steve



>  	TRACECMD_OPTION_FTRACE_EVENTS,
>  	TRACECMD_OPTION_EVENT_FORMATS,



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux