From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B127EC433F5 for ; Wed, 6 Oct 2021 08:43:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 934D2610A5 for ; Wed, 6 Oct 2021 08:43:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237729AbhJFIpe (ORCPT ); Wed, 6 Oct 2021 04:45:34 -0400 Received: from foss.arm.com ([217.140.110.172]:33214 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237420AbhJFIpd (ORCPT ); Wed, 6 Oct 2021 04:45:33 -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 551EAED1; Wed, 6 Oct 2021 01:43:41 -0700 (PDT) Received: from [10.57.22.130] (unknown [10.57.22.130]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DBDE83F7B4; Wed, 6 Oct 2021 01:43:38 -0700 (PDT) Subject: Re: [PATCH 1/4] perf vendor events: Syntax corrections in Neoverse N1 json To: John Garry , Andrew Kilroy , "linux-kernel@vger.kernel.org" , "linux-perf-users@vger.kernel.org" , "acme@kernel.org" Cc: Will Deacon , Mathieu Poirier , Leo Yan , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , "linux-arm-kernel@lists.infradead.org" References: <20211004160008.21645-1-andrew.kilroy@arm.com> From: James Clark Message-ID: <0743bf83-2e5d-8830-61bc-ed0731db108d@arm.com> Date: Wed, 6 Oct 2021 09:43:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. James