Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2224019pxb; Fri, 8 Oct 2021 03:36:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT1B2WczCovs1QR6xe8LPJqpy2aV0K1XrianNyPO+xknDJuW212KvNRzlFOICZD5FLiFSs X-Received: by 2002:a17:903:31c2:b0:13c:9de8:d314 with SMTP id v2-20020a17090331c200b0013c9de8d314mr8929791ple.1.1633689382279; Fri, 08 Oct 2021 03:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633689382; cv=none; d=google.com; s=arc-20160816; b=XDH9bBm1W9LSwau3ghxs+3svfDGEQm4RRuVn7SOfGMRb3F9zPAQ0pMZnzCCJD1tidk eUqJIgrqa1RBusdPZIxuuXjNtQFruO8ewaiSkLiAHMVNts3+qlsC3pTj8lZBXEBidAk/ Zsfa/ZumRFY9RGWfmqqx52mnVSjhB2F7h/oJx95Y3t730tO0tkX87ZXD+IFRP3BNx39M 7SGLkn3sCs0Etipvwn/qXM49+iOt2z/qmyK4UcB5xdJmmnt3lclEGILEvOUIwNdy6KZq i/dFRe1skVK0dAxkk5KW98XT0p7NLubmsBajAm4O2Rz/5GMon4Bg4i5tIEx7H2KST+m+ YVsQ== 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=POCIW4cHW3sHpISjUII+NKh5utisi0GCz48gspfhzto=; b=PFr5sgzH+E5hvNnoaN5YC/WqdPnYQqcU3nBQgRYZ1kKm9WzLrXMWwlr3zLrLrUFnVm iFsk/AdLx+kcKsf6cTXSZEuDBxpgWwNKQwQS1+BQG+8TpTy9Yj4jvDXlCw1ng7w1HSiO 4jVIFlnZKapX+yBfw/D+N1eE9zrzdo/Mq6u/qFDuILlAl2XTYmJDW4HynOuDJKRoFas7 WTieqiIHs8ygs4fuaoXHoelhARTIQ5jfWEotzzZO81jfTaqt+KgeEc+EdTA9QEPrMEbN +RXwxj/HLBkioo1qa1AK5Sipf72wBMj+m8UUquLs6l3uX4GwhIyBvC4R0405Jv7IEncC cEZg== 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 k14si14496672pji.19.2021.10.08.03.36.09; Fri, 08 Oct 2021 03:36:22 -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 S239828AbhJHKgR (ORCPT + 99 others); Fri, 8 Oct 2021 06:36:17 -0400 Received: from foss.arm.com ([217.140.110.172]:41512 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230032AbhJHKgQ (ORCPT ); Fri, 8 Oct 2021 06:36:16 -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 D390EED1; Fri, 8 Oct 2021 03:34:20 -0700 (PDT) Received: from [10.57.25.67] (unknown [10.57.25.67]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 63FB13F70D; Fri, 8 Oct 2021 03:34:18 -0700 (PDT) Subject: Re: [PATCH 1/4] perf vendor events: Syntax corrections in Neoverse N1 json To: Ian Rogers , Andi Kleen Cc: John Garry , Andrew Kilroy , "linux-kernel@vger.kernel.org" , "linux-perf-users@vger.kernel.org" , "acme@kernel.org" , 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> <0743bf83-2e5d-8830-61bc-ed0731db108d@arm.com> <83767166-e379-a352-d920-ad8b6e923800@huawei.com> From: James Clark Message-ID: <18ef658a-48d3-0038-f988-f39f9498d31e@arm.com> Date: Fri, 8 Oct 2021 11:34:17 +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: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/10/2021 03:59, Ian Rogers wrote: > On Thu, Oct 7, 2021 at 5:03 PM Andi Kleen wrote: >> >> >> On 10/6/2021 9:26 AM, John Garry wrote: >>> 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. >> >> >> Sure we can modify the file. I already did some minor changes when I >> submitted it originally. >> >> -Andi > > jsmn is a somewhat frustrating way to work on json code and working on > a forked version of jsmn was frustrating in [1]. Could we assume > python on build systems and rewrite jevents in python? Seems reasonable to me, although maybe a big job. I suppose there could be an empty generated pmu file for systems that don't have Python and only the ones listed in pmu-events/arch/ would need it. James > > Thanks, > Ian > > [1] https://lore.kernel.org/lkml/20201110100346.2527031-1-irogers@google.com/ >