Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1665667pxb; Thu, 7 Oct 2021 12:23:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmJqH55sVpK0nVUBBoGaUaLYKlOOse/VWzy6JJG41q0B60JNfusCYiyJoAludrp3LyAYs6 X-Received: by 2002:a17:902:e78f:b0:139:a3c3:5eaa with SMTP id cp15-20020a170902e78f00b00139a3c35eaamr5389080plb.47.1633634615278; Thu, 07 Oct 2021 12:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633634615; cv=none; d=google.com; s=arc-20160816; b=vX0wedKS8dSR2nq+CfRuyI04kIusfSinlASH+S4vSDi75MAu58fw/98pEOpf1NynMt 0SzjU0MOJLHHEdDJ8+qzOZ1xqpfYqldfyIuiyo5Afut7q0PR6UfwlJGbZU1Vm1F172gQ vAxlwZtNGQAk6Nh00gEQ73sUTo2snpCY/ObC068i7rFMhvZkUUBNC5mPAWnUgBN92O35 O2mZhvKI4HrgTfMpFgcU82pL/8Ot65yOi4tNjrZWXMMTzdJk0zUhWQYGyBomaq38NPZK OMrG+V1L3zs1J81tkPxaWBqvrqcEoj2HiPeMZIEv0NH0oTN+CCcBAPf9GAtJ0vaiAhJC GPPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=b53st6m+jMYtRWLt0q2JapYtujlb6dwHMBHZKJK72Ek=; b=cJJp8ikjUbIGEhDPL0fY4fw3bJxqfOkP6H9OFjcBDey6m359zCwA/KJO6cuj/zPDwj Zj4B11Py6G0zxysNbESrLr8CulYUSvD6lkjs9YVxuTfVu2bU9LtK/gur9oX6xAUR0J4K +dS48NRgJeJmnnAGfOnMwBL7Psu/LAO7S7DYzVp2p+dLkveVsu7r4PuvbHmYkfSulgbf 4KRY4dgmUJXnH4BNj192FVpR9lhjY7dFCFNHjAjVJnDxlTVdQxvhG4ePdWFuE6zsPCIC dHhw3aTc+0OKdVCy2ULW6PdvqYWppHzYP/XP0Jl8I+tkzillKQ2vB8Z0yHj7agZhDkAB xPeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si235304pgv.205.2021.10.07.12.23.21; Thu, 07 Oct 2021 12:23:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240918AbhJGLIP (ORCPT + 99 others); Thu, 7 Oct 2021 07:08:15 -0400 Received: from foss.arm.com ([217.140.110.172]:45896 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241038AbhJGLIK (ORCPT ); Thu, 7 Oct 2021 07:08:10 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D2D1A6D; Thu, 7 Oct 2021 04:06:16 -0700 (PDT) Received: from e121896.Emea.Arm.com (e121896.Emea.Arm.com [10.32.36.22]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0E2AA3F70D; Thu, 7 Oct 2021 04:06:12 -0700 (PDT) From: James Clark 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 , Will Deacon , Mathieu Poirier , Leo Yan , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , 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 Message-Id: <20211007110543.564963-4-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20211007110543.564963-1-james.clark@arm.com> References: <20211007110543.564963-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 #include "jsmn.h" +#define JSMN_STRICT /* * Allocates a fresh unused token from the token pool. -- 2.28.0