Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1176644ioo; Sun, 22 May 2022 06:10:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyV173SYNkuS3ctmmkbR8izD2chmgCB4QOFTXhTfdNkD+iJWUTE8l5dDiReJUXnqAfUYWaw X-Received: by 2002:a17:906:3ec1:b0:6e8:aae3:90de with SMTP id d1-20020a1709063ec100b006e8aae390demr15588274ejj.127.1653225040725; Sun, 22 May 2022 06:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653225040; cv=none; d=google.com; s=arc-20160816; b=q6rkBh+hN1pCLdc0pyDD1j/Fa/TQiRfYjNIA5Dkf31bFKMzIf9dzegTXiBvZ77mzhg QYz3uOHiTGJ4ARPXyaajJuSLD/IEvjfJR0VH2+MoDaXOBE/7uF/XQLgcbqoSEqzNciZV RuyAqqPscZ8lJHhTQjZLMqEGFAr6wspnodNo4o7A7ReYzQlLicIfU5Ca67K24TcHWfrl Kt3AzMFuuKn7R+vIgVIZ6ERzC/6dw4Clh1RqF6NQzClR1ISu5m4MCliLVdUwKkI/U+YJ isx3OSeSbRXB13of/fg7BNO9A3AAMsR1/PGCruo8LhSXNgRU6Md+cNsFN1PbnvPxx7WA zhiQ== 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=PlBrfFXLkcBjzvaU5ZE61p8d0548/U8plsIcnYc6nwM=; b=SXDF+N9A/VhA03l/uxsq/L5/JVJMxwAQ0kHgb9EaK6kGbXiFohV71eiXAyPb2yw32a k5DYka+73zzectjDt/WxHne9zNmzQUdFWRBg0i9oXiRop1vsxBLBy17Q1gboFHyC+Wm3 sEbOURYrlrV5aGqv9GyUZXJEQ8mjVt1rgncgaiW3MP2x7pl1X++zKwsGpbrNRReMlq8a eBEMRsbvhdJ0EdL5YasF2c63dS1LjbsBIlY3HSHs2W3kyV2F4b7ZMhiotoLss5JP3Bmm O+1/e2viOyKsdxGtIonGIhd2Il52QyL0J8PZjjVbqEWDXcYxwLB44PL7JIOx/ogSsN/R BoOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AmbYVUjm; 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 qb1-20020a1709077e8100b006e812fe9f78si14033710ejc.461.2022.05.22.06.10.14; Sun, 22 May 2022 06:10:40 -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=AmbYVUjm; 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 S1350798AbiETR2g (ORCPT + 99 others); Fri, 20 May 2022 13:28:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237887AbiETR2b (ORCPT ); Fri, 20 May 2022 13:28:31 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 306BE17D399 for ; Fri, 20 May 2022 10:28:30 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id u27so11576262wru.8 for ; Fri, 20 May 2022 10:28:30 -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=PlBrfFXLkcBjzvaU5ZE61p8d0548/U8plsIcnYc6nwM=; b=AmbYVUjm1Vvk52XX+gT8m9nyVd9UytuO7zSN8e691d+mbvoHmjsMc3RLNZylvOQYEd zVzN2oVZE5VSxSZ0ETLdp1LjgvBp4qRgPDMzDPAVIU0gpQVTswTvQECG8uwX066LpKKI YEIRmDtjNrpaO3W4dM2Ky78GbZkwkzyF2vpuDPED4OCG9qDL3saqa+x6tp8L6DuVhM59 QbK5RBe3Cq/eVInec37zHdr3yFJ3c9xUJRYg2uiKRtowHai8bi6VAsjGu3EFmt6GffUt lnrtvgFNmq5JClrkBHf7tNeCTeBQMw6mCfTlR54dmHw6YlJUZ2DGyB3juoK/oBhcIZ4E m0PA== 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=PlBrfFXLkcBjzvaU5ZE61p8d0548/U8plsIcnYc6nwM=; b=LE/sxkjNJNwils9/pUBzHLA4qcQqYZseNpOfOty5o/xzI1rkP/MMnecpoobM2HEoXf D1O8Jk1H7CP/qQklhuGA33LprKjvxPZh3D1P7YVXbEPfSOZB5Uc5/rHYZsOD+QxDtQ0J rFomXe/YIlUbNGPSLpHzNILrRwb+2qmZQ6yGuGqtf++KwlL+RLKuPx1qiFE9sgE59qkq FBdSDUD2dXSRBddfLY6fHy6/U9QPjDD7irFMYuLlwL10tZ50bF4qU4ZOi/AtXf4ijU0X z/1MIg3XYVPuzWkoKUL+h3De50L+SIatKtN1uZSH9ihj1EtBIj/KcGJPZ+3QyzS0tTtd YwLA== X-Gm-Message-State: AOAM532bDcX/l2luYE++S9IKgA5bxqOh1kUcd4t80JKfG1wDJQWgy0Cs 2Af/fBTYRskTPWiw7WaNwWxEUo5yWXNjsRbWm7uB2Q== X-Received: by 2002:a5d:448d:0:b0:20d:744:7663 with SMTP id j13-20020a5d448d000000b0020d07447663mr9282426wrq.654.1653067708557; Fri, 20 May 2022 10:28:28 -0700 (PDT) MIME-Version: 1.0 References: <20220510104758.64677-1-nick.forrington@arm.com> <28509191-3a45-de6d-f5bc-a8e7331c0a9e@huawei.com> <5773b630-8159-1eba-481a-1bf3c406c055@arm.com> <7a17256d-cad0-bd94-02e7-f8adaa959654@arm.com> <2d73146a-86fc-e0d1-11b9-432c7431d58a@huawei.com> In-Reply-To: From: Ian Rogers Date: Fri, 20 May 2022 10:28:16 -0700 Message-ID: Subject: Re: [PATCH 00/20] perf vendors events arm64: Multiple Arm CPUs To: Nick Forrington Cc: John Garry , Robin Murphy , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org, Will Deacon , Mathieu Poirier , Leo Yan , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Andi Kleen , Kajol Jain , James Clark , Andrew Kilroy 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=ham 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 Thu, May 19, 2022 at 6:53 AM Nick Forrington wrote: > > > On 19/05/2022 08:59, John Garry wrote: > > On 18/05/2022 15:14, Robin Murphy wrote: > >>> Sure, we should have these 32b cores supported for ARCH=arm if they > >>> are supported for ARCH=arm64. But then does it even make sense to > >>> have A7 support in arch/arm64? > >> > >> That's what I'm getting at. If it is tied to the build target as > >> you've said above, then there is no point in an AArch64 perf tool > >> including data for CPUs on which that tool cannot possibly run; it's > >> simply a waste of space. > >> > >> If there is interest in plumbing in support on AArch32 builds as > >> well, then I'd still be inclined to have a single arch/arm events > >> directory, and either do some build-time path munging or just symlink > >> an arch/arm64 sibling back to it. Yes, technically there are > >> AArch64-only CPUs whose data would then be redundant when building > >> for AArch32, > > > > If size is an issue then we have ways to cut this down, like doing the > > arch standard events fixup dynamically when running perf tool, or even > > not describing those events in the JSONs and rely on reading the CPU > > PMU events folder to learn which of those events are supported. > > > > > but those are > > > such a minority that it seems like an entirely reasonable compromise. > > > > @Nick, Can you drop the 32b core support for arm64? Or, if you really > > want them, look into ARCH=arm pmu-events support? > > No problem - I'll resubmit without the 32b-only CPUs. > > Thanks, > Nick > I'm hoping with jevents.py [1] then we can do a few things on the size front: 1) relocations - the current pattern of generating '.foo = "foo_Bar"' means that when perf starts the .foo pointer needs to be updated for the relocation. If we concatenate the strings together then we can have 1 relocation, but we'll need an offset and length to get .foo's value and some kind of iteration abstraction. If we do this then we could also look to compress the string at compile time. 2) sorting events - not really a compiler size improvement but should lower some runtime memory usage. We shouldn't need to linearly search event names, sorting at compile time means we can locate faster, less paging, etc. 3) we've spoken in the past of the problems of cross-architecture testing of events, metrics, etc. For metrics, we may want to record events on one architecture and compute metrics on another. One idea is to have a fuller jevents mode where everything is built into one binary, which would make size improvements more valuable. Another thing with jevents.py is trying to make the pmu-events.c presentation more consistent with sysfs', which may regress things on size. Anyway, I think it is good to have more events and I'm excited to see this merged in a way that's suitable for John. I'm happy to do more optionality stuff with jevents.py or the build if that can mean having more events on ARM32. Thanks, Ian [1] https://lore.kernel.org/linux-perf-users/20220511211526.1021908-1-irogers@google.com/ - show your love with Acked-bys :-D