Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp503952pxb; Wed, 6 Oct 2021 09:24:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ8ascXmwlEk+IXMhNfJwENyS2vm1F9Yvw22KsMBbe+s1lENyLPE1A69j3WcoUDJHr4L9z X-Received: by 2002:a17:902:9a97:b0:13e:2da4:8132 with SMTP id w23-20020a1709029a9700b0013e2da48132mr11939902plp.34.1633537488844; Wed, 06 Oct 2021 09:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633537488; cv=none; d=google.com; s=arc-20160816; b=RgvsL5PE+MdQ7FHUMO8lmgQxxAwqpwqceBUFdROwmtPn/sMqLwniLxrUvZUUTEzwCe 9xxfvo1ftQSGkWLS7Y9mcoyR/I8SWdg6LrGXM+F9//z6M0e1pnRXxBqdG+cAndxjaRHZ AxqbA6EdiS9KC8fNxWz6wjBczmHQarLEVyT0FHnc89LsIvrggK1Hod8wEdZ/0z51PYbP J1sTEkYkbJKReWlub0WTrf2Nkt9ZPL4EgB1GQCw70Q+FqzzZENxcxUZzGrv2GNuFJzgF WFQRW7Isv1nZeNCxL08bTB+EvzkiEOIRDUhhM3weErA5Ku04uPiqnZSutx8d4utphPGx ANZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=2xoaCtbchesElCrYOlLVPcFRWdUNMmO1aHAGHyVjbyo=; b=PeiXLHVPoiR1t+cDxyzhA6T6DGV1fBdSMLCRhy5CNaGFmKLiSfunM9y7v7KrMs6N/n UC5Lte3TlSxHGkqxgSz2O3XxAgzqUf8TArDBHIIRU+hKGshY5Vjnd5O27HOUrr0fbBLi t7xnwcmyOGVFM4CXbo84kc/IuhWMTtdPR2oYbrQoj02ovuWvnE33G09yu51qZHXxCpUb UX9jAmMmoGNnyavrWs3tNn8I6Pmqol8SAAJoSjKFfwyAX7pUfeRA6HW0rjaqlv9Gmrp0 0sz4QPgSLIqowRO8BxFXA0PaOTs+W97r5eXjiHLrLnu23no4EZo+b+x7sHwsHx7o8awG YGOQ== 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=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r79si8029934pfc.273.2021.10.06.09.24.35; Wed, 06 Oct 2021 09:24:48 -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=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239230AbhJFQZ3 (ORCPT + 99 others); Wed, 6 Oct 2021 12:25:29 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3941 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbhJFQZV (ORCPT ); Wed, 6 Oct 2021 12:25:21 -0400 Received: from fraeml707-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4HPfnD5DnCz67Xd6; Thu, 7 Oct 2021 00:20:16 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml707-chm.china.huawei.com (10.206.15.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 6 Oct 2021 18:23:27 +0200 Received: from [10.47.95.252] (10.47.95.252) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.8; Wed, 6 Oct 2021 17:23:26 +0100 Subject: Re: [PATCH 1/4] perf vendor events: Syntax corrections in Neoverse N1 json To: James Clark , 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" , Andi Kleen References: <20211004160008.21645-1-andrew.kilroy@arm.com> <0743bf83-2e5d-8830-61bc-ed0731db108d@arm.com> From: John Garry Message-ID: <83767166-e379-a352-d920-ad8b6e923800@huawei.com> Date: Wed, 6 Oct 2021 17:26:02 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <0743bf83-2e5d-8830-61bc-ed0731db108d@arm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.47.95.252] X-ClientProxiedBy: lhreml709-chm.china.huawei.com (10.201.108.58) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/10/2021 09:43, James Clark wrote: + Andi > > > 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. > Looking at the license in jsmn.c, we seem to be ok to modify it (to error on non-standard trailing ',') - that parser has already apparently been modified in mainline. If we do that then I hope that there are not to many violations in out JSONs, including downstream. Thanks, John