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.9 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,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 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 3BF29C433ED for ; Mon, 10 May 2021 15:51:56 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 A839861359 for ; Mon, 10 May 2021 15:51:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A839861359 Authentication-Results: mail.kernel.org; dmarc=fail (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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QBYS8K4oBszfz4HnWd0hEX+WUwj7ZD0vTF7M18yHRhY=; b=XMfBYdAUsiCf9q/1QM7dTRwmY qA8BvEgtjb9AKZ1N8lG0H765l8u2DMUU+TBMPlgf2FhsOcf466gOqCOHhuVCcUzA7FNcfnKegW0z1 wTc6+Dmp7npunEVARNeP15dU3mqUmxCB9eMkVL2prWiKxiDENSdAHvmsylnhBDfhV55Fa8TwVWhOu yETWN+C0HYcxzy8vAkngZtyDeVKw1gQhPCbQ3Fl8PcSw/Y6ErJ0fk8cTbznivve70/I+4jyYhxHSD WnI2t/A5Ntd95233/Nzmg5S+ootId1hdsP0HvvLaKFLWRkNm6YonsyVN0QgpYSRCO0n2d8KdCmGmp iLOsjIGWw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lg8Aq-00Ep84-7r; Mon, 10 May 2021 15:50:24 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lg8An-00Ep7R-Mn for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 15:50:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:CC:To: From:Date:Sender:Reply-To:Content-ID:Content-Description; bh=MJ+4FmNerXOhYHUp3BQGYlyQGzxy8LSKanCiFu7FMd8=; b=OHzwpnTEvOOtgYCLjAnAfbaBAH lqcS/3P8+xKyF7VDC5JB7pUTYzLhnWtIowMzLLzHq9aqCebHdeaOWj68OYR613ay40MTG5kBPeVaO sgo/+XntRlKxow686smtBX972irb5rurHnuOGQ8Uel4VeH69nDA1lyZmSpJxyohQGNVGPqVA4b+Qu o5xuliP+GEEbB3NbY1uAESoK9m8Iojva/l74jpKuZ8Hnbc6qtakDgHhCCzIIQMxxpA5D2HHJaqUqW /Swgq9+I697stIgyHcRx2/jAKc7BkQ0+XulqH6rZZZuBqwMs1cDkfeluwV9WSugRyLysvb0eQu9k1 SahxHeyg==; Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lg8Ak-008t1T-5j for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 15:50:20 +0000 Received: from fraeml735-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Ff4wD3KLsz70gF7; Mon, 10 May 2021 23:38:52 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml735-chm.china.huawei.com (10.206.15.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 10 May 2021 17:50:04 +0200 Received: from localhost (10.52.123.16) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 10 May 2021 16:50:03 +0100 Date: Mon, 10 May 2021 16:48:20 +0100 From: Jonathan Cameron To: Guangbin Huang CC: , , , , , , , , , , , , , Subject: Re: [RFC PATCH v3 1/2] drivers/perf: hisi: Add description for HNS3 PMU driver Message-ID: <20210510164820.00000ccf@Huawei.com> In-Reply-To: <1620467096-25986-2-git-send-email-huangguangbin2@huawei.com> References: <1620467096-25986-1-git-send-email-huangguangbin2@huawei.com> <1620467096-25986-2-git-send-email-huangguangbin2@huawei.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; i686-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.52.123.16] X-ClientProxiedBy: lhreml720-chm.china.huawei.com (10.201.108.71) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_085018_567898_ECDD3C26 X-CRM114-Status: GOOD ( 26.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, 8 May 2021 17:44:55 +0800 Guangbin Huang wrote: > HNS3 PMU End Point device is supported on HiSilicon HIP09 platform, so > add document hns3-pmu.rst to provide guidance on how to use it. > > Signed-off-by: Guangbin Huang A few question and suggestions inline. Thanks, Jonathan > --- > Documentation/admin-guide/perf/hns3-pmu.rst | 129 ++++++++++++++++++++++++++++ > 1 file changed, 129 insertions(+) > create mode 100644 Documentation/admin-guide/perf/hns3-pmu.rst > > diff --git a/Documentation/admin-guide/perf/hns3-pmu.rst b/Documentation/admin-guide/perf/hns3-pmu.rst > new file mode 100644 > index 0000000..9695688 > --- /dev/null > +++ b/Documentation/admin-guide/perf/hns3-pmu.rst > @@ -0,0 +1,129 @@ > +====================================== > +HNS3 Performance Monitoring Unit (PMU) > +====================================== > + > +HNS3(HiSilicon network system 3) Performance Monitoring Unit (PMU) is an > +End Point device to collect performance statistics of HiSilicon SoC NIC. > +On Hip09, each SICL(Super I/O cluster) has one PMU device. > + > +HNS3 PMU is supported to collect performance statistics of bandwidth, Perhaps replace with: HNS3 PMU supports collection of performance statistics such as bandwidth, latency, packet rate and interrupt rate. > +latency, packet rate and interrupt rate. > + > +Each HNS3 PMU supports up to 8 hardware events. Do we have hardware versions that support less? If not replace with: Each HNS3 PMU supports 8 hardware events. > + > +HNS3 PMU driver > +=============== > + > +The HNS3 PMU driver registers a perf PMU with the name of its device id.:: > + > + /sys/devices/hns3_pmu_ > + > +The device_id is read from hardware register, it contains information of > +chip_id(bit 31:2) and SICL_ID(bit 1:0). One chip may have one or more SICL. > + > +PMU driver provides description of available events, filter modes, format, > +identifier and cpumask in sysfs. > + > +The "events" directory describes the event code and subevent code of all > +supported events shown in perf list. > + > +The "filtermode" directory describes the supported filter modes of each > +event. > + > +The "format" directory describes all formats of the config (events) and > +config1 (filter options) fields of the perf_event_attr structure. > + > +The "identifier" file shows version of PMU hardware device. > + > +Example usage of checking event code and subevent code:: > + > + $# cat /sys/devices/hns3_pmu_0/events/bw_igu_ssu > + config=0x0000 > + > +The upper 8 bits of config is event code, lower 8 bits of config is > +subevent code. Could you use an example that isn't 0x0000? That way you could illustrate this comment by saying something like: config=0x0103 The upper 8 bits of config (here 0x01) are the event code. The lower 8 bits of config (here 0x03) are the subevent code. > + > +Example usage of checking supported filter mode:: > + > + $# cat /sys/devices/hns3_pmu_0/filtermode/bw_igu_ssu > + filter mode supported: global/port/port-tc/ This formatting seems unusual for a sysfs attribute are there similar examples already in use? > + > +Example usage of perf:: > + > + $# perf list > + hns3_pmu_0/bw_igu_ssu/ [kernel PMU event] > + ------------------------------------------ > + > + $# perf stat -a -e hns3_pmu_0/bw_igu_ssu,global=1/ -I 1000 > + or > + $# perf stat -a -e hns3_pmu_0/event=0,subevent=0,global=1/ -I 1000 > + > +The current driver does not support sampling. So "perf record" is unsupported. One sentence: The current driver does not support sampling, so "perf record" is unsupported. Given this is effectively an uncore device, I'd imagine there is no sensible way of supporting sampling? In which case I'd just say it is not supported. > +Also attach to a task is unsupported for HNS3 PMU. > + > +Filter modes > +-------------- > + > +1. global mode > +PMU collect performance statistic of all functions of IO DIE. Set the statistics for all > +"global" filter option to 1 will enable this mode. I'm assuming HNS related functions of the IO die? Perhaps "HNS3 PCI functions" is worth saying rather than just "functions" > +Example usage of perf:: > + > + $# perf stat -a -e hns3_pmu_0/event=0,subevent=0,global=1/ -I 1000 > + > +2. port mode > +PMU collect performance statistic of one whole physical port. The port id > +is same as mac id. The "tc" filter option must be set to 0xF in this mode. > +Example usage of perf:: > + > + $# perf stat -a -e hns3_pmu_0/event=0,subevent=0,port=0,tc=0xF/ -I 1000 > + > +3. port-tc mode > +PMU collect performance statistic of one tc of physical port. The port id > +is same as mac id. The "tc" filter option must be set to 0 ~ 7 in this > +mode. Say what tc stands for - I would assume traffic class? > +Example usage of perf:: > + > + $# perf stat -a -e hns3_pmu_0/event=0,subevent=0,port=0,tc=0/ -I 1000 > + > +4. func mode > +PMU collect performance statistic of one PF/VF. The function id is BDF of > +PF/VF, its conversion formula:: > + > + func = (bus << 8) + (device << 3) + (function) > + > +for example: > + BDF func > + 35:00.0 0x3500 > + 35:00.1 0x3501 > + 35:01.0 0x3508 > + > +In this mode, the "queue" filter option must be set to 0xFFFF. > +Example usage of perf:: > + > + $# perf stat -a -e hns3_pmu_0/event=0,subevent=0,bdf=0x3500,queue=0xFFFF/ -I 1000 > + > +5. func-queue mode > +PMU collect performance statistic of one queue of PF/VF. The function id > +is BDF of PF/VF, its conversion formula:: > + > + func = (bus << 8) + (device << 3) + (function) > + > +In this mode, the "queue" filter option must be set to the exact queue id > +of function. > +Example usage of perf:: > + > + $# perf stat -a -e hns3_pmu_0/event=0,subevent=0,bdf=0x3500,queue=0/ -I 1000 > + > + Drop one blank line here for consistency > +6. func-intr mode > +PMU collect performance statistic of one interrupt of PF/VF. The function > +id is BDF of PF/VF, its conversion formula:: > + > + func = (bus << 8) + (device << 3) + (function) > + > +In this mode, the "intr" filter option must be set to the exact interrupt > +id of function. > +Example usage of perf:: > + > + $# perf stat -a -e hns3_pmu_0/event=0,subevent=0,bdf=0x3500,intr=0/ -I 1000 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel