From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B934C433E0 for ; Tue, 26 Jan 2021 12:36:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 053AE230FD for ; Tue, 26 Jan 2021 12:36:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 053AE230FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=x8W64GysHgIDOSfaJyl7zBVY/IVdAPA4ntuHrZEDMbU=; b=bCcApJN9sgzmTX2zjGrJ1qS7l su1nZgX+JnMXj4/QYVC+7eM9j1MEZMFeCOtVW+poq6kZ/XNn08toAGfMUmAM4WqN++imMASuwOG2c 1tPJ5NOPohXu1bjAue96irTNoGZcZj2ZP0N0/TAGiwp1cdLZfzv3OfUE7kM1nZACoWCnloPCs1l97 qjMJn+x5qLd3BK7UosJl6gldRuT+5oVl+h/QSuE04gbxLMVW1cmQXD8wF9wAy9TPiaVPZuFZrjum+ 623GWt2NhW7zV0TRmpTAZ6kALYwgWO5ZzRyfcg7/4iRPROUlt8rT87yRo1/VLcMvs0VNr+8GnPDMD 06fZfgIxA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4NYb-0007sM-C3; Tue, 26 Jan 2021 12:34:53 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4NYZ-0007ru-Eo for linux-arm-kernel@lists.infradead.org; Tue, 26 Jan 2021 12:34:52 +0000 Received: from fraeml703-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DQ5h364sSz67Sk0; Tue, 26 Jan 2021 20:31:31 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml703-chm.china.huawei.com (10.206.15.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Tue, 26 Jan 2021 13:34:49 +0100 Received: from [10.47.2.35] (10.47.2.35) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 26 Jan 2021 12:34:48 +0000 Subject: Re: [PATCH 5/8] drivers/perf: hisi: Update DDRC PMU for programable counter To: Shaokun Zhang , References: <1609395576-32775-1-git-send-email-zhangshaokun@hisilicon.com> <1609395576-32775-6-git-send-email-zhangshaokun@hisilicon.com> From: John Garry Message-ID: <06dadbf0-cf24-fd71-d4c4-1684df439e32@huawei.com> Date: Tue, 26 Jan 2021 12:33:27 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <1609395576-32775-6-git-send-email-zhangshaokun@hisilicon.com> Content-Language: en-US X-Originating-IP: [10.47.2.35] X-ClientProxiedBy: lhreml717-chm.china.huawei.com (10.201.108.68) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210126_073451_595897_B67EDB87 X-CRM114-Status: GOOD ( 14.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Qi Liu , Will Deacon , Jonathan Cameron Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 31/12/2020 06:19, Shaokun Zhang wrote: > DDRC PMU's events are useful for performance profiling, but the events > are limited and counter is fixed. On HiSilicon Hip09 platform, PMU > counters are the programable and more events are supported. Let's programmable > add the DDRC PMU v2 driver. > > Cc: Mark Rutland > Cc: Will Deacon > Cc: John Garry > Cc: Jonathan Cameron > Co-developed-by: Qi Liu > Signed-off-by: Qi Liu > Signed-off-by: Shaokun Zhang > --- > drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 208 ++++++++++++++++++++++++-- > drivers/perf/hisilicon/hisi_uncore_pmu.h | 2 + > 2 files changed, 197 insertions(+), 13 deletions(-) > generally looks ok, but ... > } > @@ -332,8 +506,16 @@ static int hisi_ddrc_pmu_probe(struct platform_device *pdev) > return ret; > } > > - name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hisi_sccl%u_ddrc%u", > - ddrc_pmu->sccl_id, ddrc_pmu->index_id); > + if (ddrc_pmu->identifier >= HISI_PMU_V2) > + name = devm_kasprintf(&pdev->dev, GFP_KERNEL, > + "hisi_sccl%u_ddrc%u_%u", > + ddrc_pmu->sccl_id, ddrc_pmu->index_id, > + ddrc_pmu->sub_id); I don't think perf can support event aliasing in this format (hisi_scclX_Y_Z), but I need to double-check. > + else > + name = devm_kasprintf(&pdev->dev, GFP_KERNEL, > + "hisi_sccl%u_ddrc%u", ddrc_pmu->sccl_id, > + ddrc_pmu->index_id); > + > ddrc_pmu->pmu = (struct pmu) { > .name = name, > .module = THIS_MODULE, > @@ -346,7 +528,7 @@ static int hisi_ddrc_pmu_probe(struct platform_device *pdev) > .start = hisi_uncore_pmu_start, > .stop = hisi_uncore_pmu_stop, > .read = hisi_uncore_pmu_read, > - .attr_groups = hisi_ddrc_pmu_v1_attr_groups, > + .attr_groups = ddrc_pmu->pmu_events.attr_groups, > .capabilities = PERF_PMU_CAP_NO_EXCLUDE, > }; > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel