Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1960877pxb; Thu, 7 Oct 2021 20:03:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyP64xPSIxujtUVSO8hTEQk+x27u0hpsvhvabbD5YUjw4pNZ8igywnKTHYPX5BTs36j4/xw X-Received: by 2002:a05:6a00:138a:b0:44c:b200:38d7 with SMTP id t10-20020a056a00138a00b0044cb20038d7mr7889282pfg.5.1633662212105; Thu, 07 Oct 2021 20:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633662212; cv=none; d=google.com; s=arc-20160816; b=kdAwXzQzg2/sr/6YYXz/RX/cMWO0n9R8FhHjrD/fhkDDtlsCNd1TptoveHNsOEZcD9 UruAijbD7O/r/VqPVgrhYUNZUT0ZcxAN5v6755jkE7YJiEXKBtR78axC++UvxY196sB3 Q7/RXBTBRHvEQZd1tKsdPlHhCWugwKEZoMXhhTkE+4Bk/bWpHiGuLHtMpG5bvcrKtOHH wKDj3ZScLu9Ik3rezf47Y2DZCxi1xGYbUHpEI7XuX3EZzKG/L14nURqgNp+AsaRMIVsi dME77DhQgBEK5Kk0obTtY5vx0XP5uWkDl1H8Se59nfL75eL6/mK7YgWWrKxRIikVaDfK kwOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=r1A8V1SEkH/lgI3j7mtHzdXO5tdn/QGpiavQnC667ps=; b=EjIePpmdrVPcoy/vS7v9+8yT4wOnQbZPxPBOF3x/eTInTmqHNqJ3iIkkTwBBBlzAU6 3UTqksXI9Tj1rTbxiDx9qLC2ayNu48yHrX/PkieVxYLfVUJcbFu2xM0A6X18srBYFfO6 p+qO8XJCWjLhkSJ2bjUUPZV6BLn8Sgp2cwvlQj+GDFTZB3j+7ba+OylGUr2NJIRsrvOP NB7a1CRWBS3O+U2HCx/p518F/gmU7Z5I+nk3viiTvhIxeMh7Qdy+DGe36jt94L4XM0Ru s+NGTZ4YBG4c4UEr5lSqU4YSnSoXn6m4naemx1guWUMhT2yj4OdcEuDhH9CRfUgn6ied icgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BuDcIVCU; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u25si1511512pgk.454.2021.10.07.20.03.19; Thu, 07 Oct 2021 20:03:32 -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; dkim=pass header.i=@google.com header.s=20210112 header.b=BuDcIVCU; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229883AbhJHDBx (ORCPT + 99 others); Thu, 7 Oct 2021 23:01:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbhJHDBx (ORCPT ); Thu, 7 Oct 2021 23:01:53 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 642ECC061714 for ; Thu, 7 Oct 2021 19:59:58 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id 5so9050696iov.9 for ; Thu, 07 Oct 2021 19:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=r1A8V1SEkH/lgI3j7mtHzdXO5tdn/QGpiavQnC667ps=; b=BuDcIVCUPKw/J6k1BK4QvJ25qg/hxNSNa7Kwl33LotoPUvuP37oMA0UyupjuAsSdiS LQr7Msib/WTxkJk7aQVmLng/QxqzCxI3Yhe3p2pMeNHR0H939jtID6xhf586c3AWGF5Q dlE++26KGf81fy0OkkxWhYPybu+4RQmOrsE6YRFon/1/HS+kLFGxmt/E/fgiSZLeBrLr wxoao5Wnq5qlxj67ZzUliSJXnRC7aJ2NmWvcib4acZVwZ5TKXfjii0fEJe3fl0lFw7Gr XnwPSbqoNJqUIv57I3zarFIMSMRKMYBHkQfbsB+7M0XQa3ShyxuAaumNUPElmhNqYumB bhGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=r1A8V1SEkH/lgI3j7mtHzdXO5tdn/QGpiavQnC667ps=; b=awWYU8enuutlB/LHpVrMxbaybKt8SPT4ztvsGc/7Ggm6xX3gDsQ8MkkMGTrYMMiDcs Nm+ALSZFQfDXXUOh75ItEb2OKZsO/hWJ7hDjGDADOw7hKpfSiOljMKX6VbKCTMRWikJ9 3ycfKTehAMtrA/o5gd338VCWO9OO+2U7wR5AV4rBFREBUn+Dj/kslxX+W5mcud3haGLk AHTjiu02gHGF+LQiw9V4DvVDSQFqWHFkFpu3CF5yz1NtOCaGkNiqTTzU8CUwOfVPMEA/ 9Jjc3MGWqTbGIEhs5gysH6RBzifJ2NooI20D+uGcZWhOKzkNfODXuwyc+Ffi4amP57En 2nww== X-Gm-Message-State: AOAM531Py7DNFzfA/eENtwyzs/qjTjIIDLWfrDdSnEDo0kclEL/5yZIH 1QPIbI41BO/5ofNfXrM7WlU6MLPBFZ0y633804sChg== X-Received: by 2002:a02:662d:: with SMTP id k45mr5284836jac.14.1633661995993; Thu, 07 Oct 2021 19:59:55 -0700 (PDT) MIME-Version: 1.0 References: <20211004160008.21645-1-andrew.kilroy@arm.com> <0743bf83-2e5d-8830-61bc-ed0731db108d@arm.com> <83767166-e379-a352-d920-ad8b6e923800@huawei.com> In-Reply-To: From: Ian Rogers Date: Thu, 7 Oct 2021 19:59:42 -0700 Message-ID: Subject: Re: [PATCH 1/4] perf vendor events: Syntax corrections in Neoverse N1 json To: Andi Kleen Cc: John Garry , James Clark , 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" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks, Ian [1] https://lore.kernel.org/lkml/20201110100346.2527031-1-irogers@google.com/