linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Clark <james.clark@arm.com>
To: acme@kernel.org, john.garry@huawei.com, ak@linux.intel.com,
	linux-perf-users@vger.kernel.org
Cc: Nick.Forrington@arm.com, Andrew.Kilroy@arm.com,
	James Clark <james.clark@arm.com>, Will Deacon <will@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Leo Yan <leo.yan@linaro.org>, Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] perf tools: Enable strict JSON parsing
Date: Thu,  7 Oct 2021 12:05:42 +0100	[thread overview]
Message-ID: <20211007110543.564963-4-james.clark@arm.com> (raw)
In-Reply-To: <20211007110543.564963-1-james.clark@arm.com>

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

Signed-off-by: James Clark <james.clark@arm.com>
---
 tools/perf/pmu-events/jsmn.c | 1 +
 1 file changed, 1 insertion(+)

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.
-- 
2.28.0


  parent reply	other threads:[~2021-10-07 11:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07 11:05 [PATCH 0/3] perf tools: Enable strict JSON parsing James Clark
2021-10-07 11:05 ` [PATCH 1/3] perf vendor-events: Fix all remaining invalid JSON files James Clark
2021-10-07 17:22   ` John Garry
2021-10-07 11:05 ` [PATCH 2/3] perf tools: Make the JSON parser more conformant when in strict mode James Clark
2021-10-07 17:52   ` Jiri Olsa
2021-10-08 10:08     ` James Clark
2021-10-08 13:12       ` Jiri Olsa
2021-10-08 18:56         ` Arnaldo Carvalho de Melo
2021-10-08 19:01           ` Arnaldo Carvalho de Melo
2021-10-07 11:05 ` James Clark [this message]
2021-10-07 23:51 ` [PATCH 0/3] perf tools: Enable strict JSON parsing Andi Kleen
2021-10-08  7:43 ` kajoljain
2021-10-08 10:02   ` James Clark
2021-10-08 11:26     ` kajoljain
2021-10-08 19:00       ` Arnaldo Carvalho de Melo
2021-10-12 13:30         ` James Clark
2021-10-12 20:15           ` Arnaldo Carvalho de Melo
2021-10-13 16:57           ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211007110543.564963-4-james.clark@arm.com \
    --to=james.clark@arm.com \
    --cc=Andrew.Kilroy@arm.com \
    --cc=Nick.Forrington@arm.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=john.garry@huawei.com \
    --cc=jolsa@redhat.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=namhyung@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).