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 4EB28C433E0 for ; Tue, 26 Jan 2021 12:13:52 +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 0FA2820637 for ; Tue, 26 Jan 2021 12:13:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0FA2820637 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=H/MxN0nVU4mH5U8hXv8YQjIaFlK/2dLv6BZA0/bFdbs=; b=V2pdvahOZKxDMLFOmazcf0Lmf hkvDYXI/4Vk0PwVLbdb1WBa+j0MVH75VusLQGMs5v8pMbnOzsvtFKVRbrg1rB5lk3ITii8f4dimqq 78C8LSLaP/641fT8ZlPSjx45q7e41dsYvvAchnjXj9VOGVEtQG3WD58CYzdmUeYiSJF9dQTiNsfyT lHBTU42Hzg6QKMPZNLhWQQ1Y4zeEHJzhCdrH2pz3977niLJsDcPVXpFFgzOq7bAccksbfW/LB/DPD KKB952mp/rBoNeRLlzXWsgaKuA19vMdFEqi6/GHsjqfyZNiD5RY/XHQFwM7U6W6pxauvw/WLuFp/t CHxGzYbuw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4NCk-000486-5D; Tue, 26 Jan 2021 12:12:18 +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 1l4NCh-00047R-Kk for linux-arm-kernel@lists.infradead.org; Tue, 26 Jan 2021 12:12:16 +0000 Received: from fraeml713-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DQ5B00W5Xz67Xqk; Tue, 26 Jan 2021 20:08:56 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml713-chm.china.huawei.com (10.206.15.32) 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 13:12:14 +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:12:13 +0000 Subject: Re: [PATCH 4/8] drivers/perf: hisi: Add new functions for HHA PMU To: Shaokun Zhang , References: <1609395576-32775-1-git-send-email-zhangshaokun@hisilicon.com> <1609395576-32775-5-git-send-email-zhangshaokun@hisilicon.com> From: John Garry Message-ID: <236563c9-1588-3102-2e3b-9417b79261f8@huawei.com> Date: Tue, 26 Jan 2021 12:10:52 +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-5-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_071215_779747_7D9CED13 X-CRM114-Status: GOOD ( 20.05 ) 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: > On HiSilicon Hip09 platform, some new functions are also supported on > HHA PMU, it can filter gathered statistics by the Master ID and mask > from the SoC if the user wants to do deep-going profiling. > Tracetag support is also added with L3C PMU in the SoC system. > > $# perf stat -a -e hisi_sccl3_hha0/config=0x02,tracetag_en=0x1/ sleep 5 > > $# perf stat -a -e hisi_sccl3_hha0/config=0x02,srcid_cmd=0x1/ sleep 5 > Much more introduction is added in documentation: > Documentation/admin-guide/perf/hisi-pmu.rst I think that it would make sense to add that prior to the driver change, like how we do with dt bindings, but not so important > > 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 Reviewed-by: John Garry I suppose the change in hisi_hha_pmu_init_data() is ok (not shown). > --- > drivers/perf/hisilicon/hisi_uncore_hha_pmu.c | 203 +++++++++++++++++++++++++-- > 1 file changed, 188 insertions(+), 15 deletions(-) > > diff --git a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c > index 2f55e5864d39..5e1c4b61ffce 100644 > --- a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c > +++ b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c > @@ -25,19 +25,136 @@ > #define HHA_VERSION 0x1cf0 > #define HHA_PERF_CTRL 0x1E00 > #define HHA_EVENT_CTRL 0x1E04 > +#define HHA_SRCID_CTRL 0x1E08 > +#define HHA_DATSRC_CTRL 0x1BF0 > #define HHA_EVENT_TYPE0 0x1E80 > /* > - * Each counter is 48-bits and [48:63] are reserved > - * which are Read-As-Zero and Writes-Ignored. > + * If the HW version only supports a 48-bit counter, then > + * bits [63:48] are reserved, which are Read-As-Zero and > + * Writes-Ignored. > */ > #define HHA_CNT0_LOWER 0x1F00 > > -/* HHA has 16-counters */ > +/* HHA PMU v1 has 16-counter and v2 only has 8-counter */ nit: "has 16 counters and v2 has only 8 counters */ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel