Re: [PATCH] trace2: increment event format version
- From
- Jeff Hostetler <git@jeffhostetler.com>
- Date
- Dec 1, 2021, 15:49 UTC
- Message-ID
- <9ce9c989-5a8c-1d5c-cc7e-9447760ed110@jeffhostetler.com>
- In-Reply-To
- <211112.867ddduhly.gmgdl@evledraar.gmail.com>
On 11/12/21 5:33 PM, Ævar Arnfjörð Bjarmason wrote:
Show 14 quoted lines
> > On Thu, Nov 11 2021, Junio C Hamano wrote: > >> Josh Steadmon <steadmon@google.com> writes: >> >>> On 2021.11.11 15:03, Junio C Hamano wrote: >>>> Josh Steadmon <steadmon@google.com> writes: >>>> >>>>> In 64bc752 (trace2: add trace2_child_ready() to report on background >>>>> children, 2021-09-20), we added a new "child_ready" event. In >>>>> Documentation/technical/api-trace2.txt, we promise that adding a new >>>>> event type will result in incrementing the trace2 event format version >>>>> number, but this was not done. Correct this in code & docs. >>>>>
...
Show 6 quoted lines
> > On the field itself I also wonder if it's useful at all. I'd think > anyone implementing a parser for the format would dispatch to a lookup > handling known keys, so having a version indicating "new keys here" > seems rather useless. >
That may be true, but it is easier to have a version number and allow parsers to ignore it, than it is to not have a version number and at some point in the future require parsers try to figure it out. IMHO.
So far we've only added new event types (cmd_ancestry and child_ready) and everything is in regular JSON forms, so parsing and dispatching is relatively easy and the version number is not really needed. But, if in the future we decide to change the contents within one of those events, then the version number may be significant.
Thanks, Jeff