[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <83767166-e379-a352-d920-ad8b6e923800@huawei.com>
Date: Wed, 6 Oct 2021 17:26:02 +0100
From: John Garry <john.garry@...wei.com>
To: James Clark <james.clark@....com>,
Andrew Kilroy <andrew.kilroy@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-perf-users@...r.kernel.org" <linux-perf-users@...r.kernel.org>,
"acme@...nel.org" <acme@...nel.org>
CC: Will Deacon <will@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Leo Yan <leo.yan@...aro.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
"Namhyung Kim" <namhyung@...nel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 1/4] perf vendor events: Syntax corrections in Neoverse N1
json
On 06/10/2021 09:43, James Clark wrote:
+ Andi
>
>
> On 05/10/2021 11:10, John Garry wrote:
>> On 04/10/2021 17:00, Andrew Kilroy wrote:
>>> There are some syntactical mistakes in the json files for the Cortex A76
>>> N1 (Neoverse N1). This was obstructing parsing from an external tool.
>>
>> If the trailing comma is not allowed by standard, then maybe we should fix our parsing tool to not allow it also. However maybe there is a good reason why we allow it..
>
> It would be nice to do, because I have also made similar fixes before. We looked at the STRICT option
> in the parser (https://github.com/zserge/jsmn), but even then it seems to allow trailing commas.
>
> Trailing commas are not allowed in the json standard, but there is a split between parsers
> where some allow it and others don't. Specifically the Python parser doesn't allow it, and Python
> can easily be involved in some workflow that parses these files.
>
> The only way forwards I can think of is either getting a change accepted upstream to the parser
> and then updating it in perf, switching to a different parser, or doing some hack to add an extra
> step in perf to look for commas. None of which sound ideal.
>
Looking at the license in jsmn.c, we seem to be ok to modify it (to
error on non-standard trailing ',') - that parser has already apparently
been modified in mainline.
If we do that then I hope that there are not to many violations in out
JSONs, including downstream.
Thanks,
John
Powered by blists - more mailing lists