[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <18ef658a-48d3-0038-f988-f39f9498d31e@arm.com>
Date: Fri, 8 Oct 2021 11:34:17 +0100
From: James Clark <james.clark@....com>
To: Ian Rogers <irogers@...gle.com>, Andi Kleen <ak@...ux.intel.com>
Cc: John Garry <john.garry@...wei.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>, 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>
Subject: Re: [PATCH 1/4] perf vendor events: Syntax corrections in Neoverse N1
json
On 08/10/2021 03:59, Ian Rogers wrote:
> On Thu, Oct 7, 2021 at 5:03 PM Andi Kleen <ak@...ux.intel.com> wrote:
>>
>>
>> On 10/6/2021 9:26 AM, John Garry wrote:
>>> 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.
>>
>>
>> Sure we can modify the file. I already did some minor changes when I
>> submitted it originally.
>>
>> -Andi
>
> jsmn is a somewhat frustrating way to work on json code and working on
> a forked version of jsmn was frustrating in [1]. Could we assume
> python on build systems and rewrite jevents in python?
Seems reasonable to me, although maybe a big job. I suppose there could be
an empty generated pmu file for systems that don't have Python and only the
ones listed in pmu-events/arch/ would need it.
James
>
> Thanks,
> Ian
>
> [1] https://lore.kernel.org/lkml/20201110100346.2527031-1-irogers@google.com/
>
Powered by blists - more mailing lists