diff options
author | James Clark <[email protected]> | 2021-10-07 12:05:42 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2021-10-08 15:59:55 -0300 |
commit | eda1a84cb4e9375984563c23a950377f915e7e1b (patch) | |
tree | 82aed0d2dedee2e5ad3e7bd79435adde3c21d7f3 | |
parent | 21813684e46df1c979f714b20b369b3474f5e933 (diff) |
perf tools: Enable strict JSON parsing
This is to ensure that the PMU event files can always be parsed by
other tools.
Testing
=======
* There are no errors when parsing files for all architectures:
# pmu-events/jevents nds32 pmu-events/arch/ test
# pmu-events/jevents s390 pmu-events/arch/ test
# pmu-events/jevents powerpc pmu-events/arch/ test
# pmu-events/jevents arm64 pmu-events/arch/ test
# pmu-events/jevents test pmu-events/arch/ test
# pmu-events/jevents x86 pmu-events/arch/ test
* Trailing and leading commas now cause a parse error
* Double commas now cause a parse error
* Compilation and parsing works with strict mode disabled and enabled
* A diff of the output files shows no changes
Reviewed-by: Andi Kleen <[email protected]>
Reviewed-by: Kajol Jain<[email protected]>
Signed-off-by: James Clark <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: [email protected]
Cc: John Garry <[email protected]>
Cc: Leo Yan <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Mathieu Poirier <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: [email protected]
Cc: Will Deacon <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r-- | tools/perf/pmu-events/jsmn.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/pmu-events/jsmn.c b/tools/perf/pmu-events/jsmn.c index 8124d2d3ff0c..831dc44c4558 100644 --- a/tools/perf/pmu-events/jsmn.c +++ b/tools/perf/pmu-events/jsmn.c @@ -24,6 +24,7 @@ #include <stdlib.h> #include "jsmn.h" +#define JSMN_STRICT /* * Allocates a fresh unused token from the token pool. |