Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp843045iog; Wed, 29 Jun 2022 11:18:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s/eU3kdzo2+B/N4yJ0AtYq7XdFX79h0d/6a0qxE14yzM2EWkF4C3vg68MUzltTE7LIOfWF X-Received: by 2002:a17:903:1c3:b0:16b:a8f8:882c with SMTP id e3-20020a17090301c300b0016ba8f8882cmr1096325plh.158.1656526730544; Wed, 29 Jun 2022 11:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656526730; cv=none; d=google.com; s=arc-20160816; b=ZaJ/DQaNCWVQnyQSn4v46Ug5QxnUDJtJyJlO10PfhK7WAKBAj4vfMNVUE/fbPpR/kH YfoDFRViDocRs81liNXHvjDCPGVYZowIdNk9lL5PXJ0aGDL1a5AaEHaC95YyQNUNU9vV ida2pdt5N088g91AX3SV3rttez0N/U38fvYLFZgXlwZ/Xy4OrPwpV3zDWyJ0yTwdLq8A txduCMUU0Rwd0a8YFowGEi7M86two8cTeDaeKoe5Ecla/HwZ14FAEx33e4q+zopFzciQ TeaU4xX2DPh5otdecCmgcIVNyRenyHT/llBq+kQI0TUYQSzGj/mx3SH3EKcE78hQqW9o dT5w== 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=lKWWlQLOEb5CNhiWUSoPZ3c2KB23CiF89xYNjZt498Y=; b=b+PCO6UClgRreFThT0LVo3nfb4yPBNWxl3LxLEa/2NESkljdUMVAG1zg1PW2ImU5qK 8GZX23aB3UfS9Evlr232O6VEMAQfodCHSLpSpNkOb/ijubR4CWxTlcFCClTIIFgD7XUi uhHZYCWUHDF0Id0EFxwOgAlDd75TsjG2U97jhMbWLFR/Zt75EgleKLg7yNo+MTR5wVaC Zh0wkh2fCh9W7uicpvT3Dqk2yk9hqaHxF53adIoa2+2wrfYMVZxph3WmUVFMduRI6GEh 8lS6+nF9VTn0q9KbTCLpi9H32QNwrXjmIJe+IbA6KdkfvNfnDHTYOoseBBpYaif3KLMV Gz6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=hEzhln9y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a63f542000000b003fccbc8a085si22008588pgk.782.2022.06.29.11.18.37; Wed, 29 Jun 2022 11:18:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=hEzhln9y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230035AbiF2SLt (ORCPT + 99 others); Wed, 29 Jun 2022 14:11:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbiF2SLs (ORCPT ); Wed, 29 Jun 2022 14:11:48 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8D761C128 for ; Wed, 29 Jun 2022 11:11:45 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id n1so23647006wrg.12 for ; Wed, 29 Jun 2022 11:11:45 -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=lKWWlQLOEb5CNhiWUSoPZ3c2KB23CiF89xYNjZt498Y=; b=hEzhln9y815dHz1vopcSdH6UgxjBQ26JMPrFOd0r0Zu7E85XmpX1Fgaq9jLqTdvA2A ugy4WoiHPI4PV1sZUEOJdIEE/5egU2gw0CQ9o5RICcrt/Qnb0UGZsKA+XkRV+kMguTLP XBEHP3+DdBmGEkZgDdNq+ap/hV7AQN6yT85mfawcMdKC3fupwE4J8wrg+V9qpPmcTgCD /TPvzIT2ORoWtHUpGKXY4RYVFCLM3ObAm1nIIUMbRC7HICkIffkc/sB0Potd2qiCEPcd x5Agw+5CcwkMv49GJwcU7KzsCbTEo/r7kiFakoN7nfHQvW+XZo3NDEHtFvSx/aL4zkwZ Wz9g== 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=lKWWlQLOEb5CNhiWUSoPZ3c2KB23CiF89xYNjZt498Y=; b=Z0O+ka1RuPD8akHl8UzzXWtBkz5auX9ldR97RZkXFRbsaEw9/wmJZu9BmLiUAKjoac V9MVonnga15IXi9kQS/C7PRf+5mDSaU8DsMp4g3a5rahY3cHy4R/6lAk9N954nLmkun4 GeQSaKAWyae7pVfc7FKFv12IWkckkt3bNG8pcQyqeu3Ipd/LPLCEbBKkj7t81U4yog/n l1OACK0YFBfyk0H6emOI2/QiBXL7++7ALUyNsnHHh6iiGVHCYOe4Pl7XdtJhmSFltLPK kIvkstw4HF3PcAMMDq0/HqYTx+4FPAilRSpbSQH9KCR0YNWUef6Sfvxj9F6zZLC/I3Tf mZjw== X-Gm-Message-State: AJIora9T51SHylnG1V2dTsu0rqiSE+tGDRCmlAt5NiToGMYb5MCLdrnC 7wG0gjcCb31fwIrtq+IJQkcl5vNUDYKUlcWsKNGuRA== X-Received: by 2002:a5d:5983:0:b0:21b:b7cb:f84e with SMTP id n3-20020a5d5983000000b0021bb7cbf84emr4599496wri.654.1656526304117; Wed, 29 Jun 2022 11:11:44 -0700 (PDT) MIME-Version: 1.0 References: <20220627025744.106527-1-irogers@google.com> <20220627025744.106527-3-irogers@google.com> <26fb5fec-500d-61c2-f009-556c5f7e86e6@huawei.com> In-Reply-To: <26fb5fec-500d-61c2-f009-556c5f7e86e6@huawei.com> From: Ian Rogers Date: Wed, 29 Jun 2022 11:11:31 -0700 Message-ID: Subject: Re: [PATCH v6 2/4] perf jevents: Add python converter script To: John Garry Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Kan Liang , Andi Kleen , Zhengjun Xing , Felix Fietkau , Qi Liu , Like Xu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Nick Forrington , Kajol Jain , James Clark , Andrew Kilroy , "Paul A . Clarke" , Will Deacon , Mathieu Poirier , ananth.narayan@amd.com, ravi.bangoria@amd.com, santosh.shukla@amd.com, sandipan.das@amd.com, Caleb Biggers , Perry Taylor , Kshipra Bopardikar , Stephane Eranian , Ian Rogers , Thomas Richter Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 29, 2022 at 9:56 AM John Garry wrote: > > On 27/06/2022 03:57, Ian Rogers wrote: > > + > > + def unit_to_pmu(unit: str) -> str: > > + """Convert a JSON Unit to Linux PMU name.""" > > + if not unit: > > + return None > > + # Comment brought over from jevents.c: > > + # it's not realistic to keep adding these, we need something more scalable ... > > Since we're converting to python it might be a good idea to consider > this - ever have an ideas on something better? I think it is something ripe for cleanup, no particular thoughts on this case. I'd like to make it so that jevents/pmu-events is aligned with sysfs, which this relates to. Thanks, Ian > Thanks, > John > > > + table = { > > + 'CBO': 'uncore_cbox', > > + 'QPI LL': 'uncore_qpi', > > + 'SBO': 'uncore_sbox', > > + 'iMPH-U': 'uncore_arb', > > + 'CPU-M-CF': 'cpum_cf', > > + 'CPU-M-SF': 'cpum_sf', > > + 'UPI LL': 'uncore_upi', > > + 'hisi_sicl,cpa': 'hisi_sicl,cpa', > > + 'hisi_sccl,ddrc': 'hisi_sccl,ddrc', > > + 'hisi_sccl,hha': 'hisi_sccl,hha', > > + 'hisi_sccl,l3c': 'hisi_sccl,l3c', > > + 'imx8_ddr': 'imx8_ddr', > > + 'L3PMC': 'amd_l3', > > + 'DFPMC': 'amd_df', > > + 'cpu_core': 'cpu_core', > > + 'cpu_atom': 'cpu_atom', > > + } > > + return table[unit] if unit in table else f'uncore_{unit.lower()}' > > + >