Re: [PATCH 0/3] perf tools: Enable strict JSON parsing

From: kajoljain
Date: Fri Oct 08 2021 - 03:44:24 EST




On 10/7/21 4:35 PM, James Clark wrote:
> After a discussion on "[PATCH 1/4] perf vendor events: Syntax corrections in Neoverse N1 json",
> John Garry suggested that we can just modify the parser to make it more strict. Hopefully this will
> remove the need to apply any future JSON comma fixup commits.
>
> Applies on top of "[PATCH v2 1/3] perf vendor events: Syntax corrections in Neoverse N1 json" on
> perf/core.
>
> Also available at:
> git clone --branch james-json-parse-fix git@xxxxxxxxxxxxxxxxxx:linux-arm/linux-jc.git

Hi James,
Do we have any dependency patches on top of this patch series. I am
reviewing and testing it, but in both powerpc and x86 system I am
getting build issue. Not sure if I am missing something.

I am trying your changes on top of upstream perf.

pmu-events/arch/test/test_soc/sys/uncore.json: json error Invalid
character inside JSON string
make[3]: *** [pmu-events/Build:18: pmu-events/pmu-events.c] Error 1
make[3]: *** Deleting file 'pmu-events/pmu-events.c'
make[2]: *** [Makefile.perf:667: pmu-events/pmu-events-in.o] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile.perf:238: sub-make] Error 2
make: *** [Makefile:70: all] Error 2

Also, Is it possible to add line number along with file name while
showing this error `json error Invalid character inside JSON string`.
It might make it easy to fix.

Thanks,
Kajol Jain

>
> James Clark (3):
> perf vendor-events: Fix all remaining invalid JSON files
> perf tools: Make the JSON parser more conformant when in strict mode
> perf tools: Enable strict JSON parsing
>
> .../arch/arm64/ampere/emag/bus.json | 2 +-
> .../arch/arm64/ampere/emag/cache.json | 20 ++++-----
> .../arch/arm64/ampere/emag/clock.json | 2 +-
> .../arch/arm64/ampere/emag/exception.json | 4 +-
> .../arch/arm64/ampere/emag/instruction.json | 10 ++---
> .../arch/arm64/ampere/emag/memory.json | 4 +-
> .../arch/arm64/hisilicon/hip08/metrics.json | 2 +-
> .../pmu-events/arch/nds32/n13/atcpmu.json | 2 +-
> .../pmu-events/arch/s390/cf_z10/basic.json | 2 +-
> .../pmu-events/arch/s390/cf_z10/crypto.json | 2 +-
> .../pmu-events/arch/s390/cf_z10/extended.json | 2 +-
> .../pmu-events/arch/s390/cf_z13/basic.json | 2 +-
> .../pmu-events/arch/s390/cf_z13/crypto.json | 2 +-
> .../pmu-events/arch/s390/cf_z13/extended.json | 2 +-
> .../pmu-events/arch/s390/cf_z14/basic.json | 2 +-
> .../pmu-events/arch/s390/cf_z14/crypto.json | 2 +-
> .../pmu-events/arch/s390/cf_z14/extended.json | 2 +-
> .../pmu-events/arch/s390/cf_z15/basic.json | 2 +-
> .../pmu-events/arch/s390/cf_z15/crypto.json | 2 +-
> .../pmu-events/arch/s390/cf_z15/crypto6.json | 2 +-
> .../pmu-events/arch/s390/cf_z15/extended.json | 2 +-
> .../pmu-events/arch/s390/cf_z196/basic.json | 2 +-
> .../pmu-events/arch/s390/cf_z196/crypto.json | 2 +-
> .../arch/s390/cf_z196/extended.json | 2 +-
> .../pmu-events/arch/s390/cf_zec12/basic.json | 2 +-
> .../pmu-events/arch/s390/cf_zec12/crypto.json | 2 +-
> .../arch/s390/cf_zec12/extended.json | 2 +-
> .../arch/test/test_soc/cpu/uncore.json | 2 +-
> .../arch/x86/icelakex/icx-metrics.json | 2 +-
> tools/perf/pmu-events/jsmn.c | 43 ++++++++++++++++++-
> 30 files changed, 85 insertions(+), 46 deletions(-)
>