Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp783844rwd; Thu, 15 Jun 2023 01:53:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5GGj1Ujey4HCnNaMc5qXT6XuJyTDlb/frz0LJXaz+M275564aZ739xGf+u3pJsGwPWKm5v X-Received: by 2002:a17:907:2da4:b0:981:a949:2807 with SMTP id gt36-20020a1709072da400b00981a9492807mr12424785ejc.1.1686819209061; Thu, 15 Jun 2023 01:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686819209; cv=none; d=google.com; s=arc-20160816; b=tjklLotKEaO7JNyWoNKi7z/hcHMfjbcwocgteAMf7iBP+Wie5vBd+krsGlhqbVSv1U Kc/L3dVrEOTfgcg4ccmzP1/69Jc7MntQFsoMhvf9E3kspihx2qJyjf91VoNlYlUyvcRA 0txYZCSvwQ1eSc9lDtZcqPaZE2GDa6NVVUFHwEY+bd9xx8/yELO8ZDKbbYqf5tZjGloQ wnjHIzPFxP1rqYzIzHEjmqMA+Q5ZW/7GDUqIrwQXYlrCfc27+/JrkZxuGhk1sgrSzKNv /5Rmk4ZqBUA1xc4ie62MnkbHJ/zmsGbWlPy9/2lp97BKXQkQSnqTXYTXIPTbJx2GvAPa dUgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=TOUuXh6LkHViNleXIOakwtRWdQ9JIjITkUXKZrXdE44=; b=HdrJj5KlLyt7hxsJaX+5eIBrAXhHkY1SVV9TldIOhctlwt15xXUckw9rxJrmAefJBu WJLFGqOwlYD3YnoHv7p0fGkUk/pbXagZDP7sSU+r31oq0ZUX/wdVsfMX0EBnG65tPPhz RGjO7P4FYpWtHevMp8BHweqyN/G9DVrpMp1whq8IVtLKQUjm13VW/jRetkJI3gcd16Y6 hl6Yc6F83shNoSvar+XCBiLYb57M6yTxms85s40GKHKYOPEkSoUYgPtq/T2RNkL5tsas RG6kcAZMdqEaQgQXXL+Y/E6pVUVBy8SuH/z1Aq53w801rKXJd5dOJ9nuwrjqIHMOaEff 02jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=dsFsxX9N; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kq19-20020a170906abd300b00965cf8f1be1si6961788ejb.617.2023.06.15.01.53.04; Thu, 15 Jun 2023 01:53:29 -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=@atishpatra.org header.s=google header.b=dsFsxX9N; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244833AbjFOIee (ORCPT + 99 others); Thu, 15 Jun 2023 04:34:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244866AbjFOIeZ (ORCPT ); Thu, 15 Jun 2023 04:34:25 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 800212940 for ; Thu, 15 Jun 2023 01:34:23 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2b448b24a66so2125171fa.1 for ; Thu, 15 Jun 2023 01:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; t=1686818062; x=1689410062; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TOUuXh6LkHViNleXIOakwtRWdQ9JIjITkUXKZrXdE44=; b=dsFsxX9NzLHxh8ziw/gPNEVf2K7Iiy/Q308RAWmRpFaYqIQJ1r5328jelF+drS0JS2 +2hKkC13N/IuU48umjqUbsFQwa0tGqHeuulBLsC34FvZRp39kpROk+zItB1aZtjKli6H douxZUHkvyYCrvyNZqPjqVgd7R+ClO2B1t5FI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686818062; x=1689410062; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TOUuXh6LkHViNleXIOakwtRWdQ9JIjITkUXKZrXdE44=; b=jWkUsX+ga6qMflQIH52fwH5kq+RZAEb8Kz/GgEbeNeu0AfTercj1coEdgQU55Ywq+W ujaY24XQZlpf3BUvNjElf4tokisH+FaV7phaza6fyaKHx5xkMlNv5DUAHwvXzNRBd5VM VuALLk4yRmHXmJROZ7UWTiZZdLlAkHOA8vXlof7feb8DyVmYWmi7GWpdlv3kglqc/f+D 88Gp48l1RbJrrvdQ2ijVJQ6fE0JK41ITtRdNy6FDjurwm1yZumU3zwX8KtVvL5STsLLK CAUQjnszOaoUqZnemKJGUCmlvCIxbYxoF92Zh4yqW16BGX5db2jy2ipaY0tbaxyw7W4F Wx0w== X-Gm-Message-State: AC+VfDypLUv97MarEhzkpsUHyCo3+DxR4RoRUiMxeEAmz7jw0IbNie7T ZiTJavXid2oPrRHwr6HCtL/ySgF+wEGhTpdV066A X-Received: by 2002:a2e:7c15:0:b0:2b1:d6bf:d8b2 with SMTP id x21-20020a2e7c15000000b002b1d6bfd8b2mr9598864ljc.22.1686818061744; Thu, 15 Jun 2023 01:34:21 -0700 (PDT) MIME-Version: 1.0 References: <20230512085321.13259-1-alexghiti@rivosinc.com> <20230512085321.13259-5-alexghiti@rivosinc.com> <20230531-49ed4c2054db0abbacd03632@orel> <6d9fefd9-472c-b8d3-d871-b81bfdbe4f6d@ghiti.fr> In-Reply-To: <6d9fefd9-472c-b8d3-d871-b81bfdbe4f6d@ghiti.fr> From: Atish Patra Date: Thu, 15 Jun 2023 01:34:10 -0700 Message-ID: Subject: Re: [PATCH v2 04/10] drivers: perf: Rename riscv pmu driver To: Alexandre Ghiti Cc: Andrew Jones , Alexandre Ghiti , Jonathan Corbet , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Will Deacon , Rob Herring , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Thu, Jun 15, 2023 at 12:25=E2=80=AFAM Alexandre Ghiti wr= ote: > > > On 31/05/2023 16:09, Andrew Jones wrote: > > On Fri, May 12, 2023 at 10:53:15AM +0200, Alexandre Ghiti wrote: > >> In addition to being more pretty, it will be useful in upcoming commit= s > >> to distinguish those pmu drivers from the other pmu drivers. > >> > >> Signed-off-by: Alexandre Ghiti > >> --- > >> drivers/perf/riscv_pmu_legacy.c | 2 +- > >> drivers/perf/riscv_pmu_sbi.c | 2 +- > >> 2 files changed, 2 insertions(+), 2 deletions(-) > >> > >> diff --git a/drivers/perf/riscv_pmu_legacy.c b/drivers/perf/riscv_pmu_= legacy.c > >> index 0d8c9d8849ee..ffe09d857366 100644 > >> --- a/drivers/perf/riscv_pmu_legacy.c > >> +++ b/drivers/perf/riscv_pmu_legacy.c > >> @@ -95,7 +95,7 @@ static void pmu_legacy_init(struct riscv_pmu *pmu) > >> pmu->ctr_clear_idx =3D NULL; > >> pmu->ctr_read =3D pmu_legacy_read_ctr; > >> > >> - perf_pmu_register(&pmu->pmu, "cpu", PERF_TYPE_RAW); > >> + perf_pmu_register(&pmu->pmu, RISCV_PMU_LEGACY_PDEV_NAME, PERF_TYP= E_RAW); > >> } > >> > >> static int pmu_legacy_device_probe(struct platform_device *pdev) > >> diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi= .c > >> index 70cb50fd41c2..3b0ee2148054 100644 > >> --- a/drivers/perf/riscv_pmu_sbi.c > >> +++ b/drivers/perf/riscv_pmu_sbi.c > >> @@ -897,7 +897,7 @@ static int pmu_sbi_device_probe(struct platform_de= vice *pdev) > >> if (ret) > >> goto out_unregister; > >> > >> - ret =3D perf_pmu_register(&pmu->pmu, "cpu", PERF_TYPE_RAW); > >> + ret =3D perf_pmu_register(&pmu->pmu, RISCV_PMU_PDEV_NAME, PERF_TY= PE_RAW); > > Should we include "sbi" in this name? > > > I'd say that it is safe to do so and I understand your point, @Atish WDYT= ? > Actually, the argument in perf_pmu_register is about the pmu instance name rather than the driver name. Both legacy & SBI PMU drivers are just ways to access the "cpu" pmu instanc= e. In future we may have separate drivers for counter delegation extensions that won't use the SBI PMU extension at all for supported hardware. However, the PMU would still be cpu pmu. There will be different SoC PMU drivers which will have different names because it will represent SoC PMU instead of cpu pmu. > > > > >> if (ret) > >> goto out_unregister; > >> > >> -- > >> 2.37.2 > >> > > Otherwise, > > > > Reviewed-by: Andrew Jones --=20 Regards, Atish