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=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 278B9C4338F for ; Mon, 2 Aug 2021 10:05:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 DB8CF60F5A for ; Mon, 2 Aug 2021 10:05:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DB8CF60F5A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: 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=gcG93hFNap1tzdsPqbkbYlzuE7MEIhBpqLIoKsKcCsA=; b=Q7eGnX4+OXSQzS nngcKUGps5q+DW1M5XlWxsjwjqw2IrTFdBBTA2THz7Cxc4/elVTuIPCWLSfvPBT+pw+pQQ6MpSdSy SWkx0gTsY1bz4xMBUXBJLruyiCyJpr7zT9XA0VYyRj+cnr/O/M+TubEy9/e2fTGmZcETdcUEVzojs ynCQc+lf2ZqOOPcd0FsXlS/QK6n1LBh35UktArkvdznP5B1mMWMfm51y8R0pHs8Yf+jr2o9kmZT3q 4lRe9m1TslG9kNyfpjzplzNiRaL00Hm+YHyVG3XFhkOqZwkrYwJdAULhJGntIzMtlJmnBMz5Sw3S0 KZ8a9EpDGsgKSu0jFSQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAUnf-00Fh0G-En; Mon, 02 Aug 2021 10:03:59 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAUnc-00FgzS-2W for linux-arm-kernel@lists.infradead.org; Mon, 02 Aug 2021 10:03:57 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id C918760F5A; Mon, 2 Aug 2021 10:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627898634; bh=akReKGJUqE3T64EJM+sE0hSyoy5AfOsjmjai1ezNn5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ezmi1wtfv/KUeKUM4cWKnsBrT1UVQqZ99WYWoodlr9a3ajFZ830A0vV1SIhMa9+mX hMpZe7GAxG0ZVY2LmlKqsCQi4+kTNIXT/+t2u5NhbXtynIjy45G1Jq60nabDhTHhej iQ3Y9NC33LTE53lU0gYndDXz+W++7+lD5HpwvNv4vvoljyTZ9jC1g+BfHy4JJ7N0k0 fX3YmLUYy0kXszLEJZ4mFtu1RWPuna8UZIuC/Eo/3SmDZpovf+7tnNmIaQ/1LQG8nQ GmNZ1Ohxpt6GHlz3nt7PNR/eIuYYwq/rpOxk5UZRPggVp8dpsLaEkonG+uEPkM+CjE phdlt3g6I7tkQ== Date: Mon, 2 Aug 2021 11:03:43 +0100 From: Will Deacon To: Qi Liu Cc: mark.rutland@arm.com, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, zhangshaokun@hisilicon.com Subject: Re: [PATCH v8 2/2] drivers/perf: hisi: Add driver for HiSilicon PCIe PMU Message-ID: <20210802100343.GA27282@willie-the-truck> References: <20210728080932.72515-1-liuqi115@huawei.com> <20210728080932.72515-3-liuqi115@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210728080932.72515-3-liuqi115@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210802_030356_189743_351679AA X-CRM114-Status: GOOD ( 12.90 ) 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 Wed, Jul 28, 2021 at 04:09:32PM +0800, Qi Liu wrote: > PCIe PMU Root Complex Integrated End Point(RCiEP) device is supported > to sample bandwidth, latency, buffer occupation etc. > > Each PMU RCiEP device monitors multiple Root Ports, and each RCiEP is > registered as a PMU in /sys/bus/event_source/devices, so users can > select target PMU, and use filter to do further sets. > > Filtering options contains: > event - select the event. > subevent - select the subevent. Hmm, I was hoping that you would expose all the events as proper perf_events and get rid of the subevents entirely. Then userspace could do things like: // Count number of RX memory reads $ perf stat -e hisi_pcie0_0/rx_memory_read/ // Count delay cycles $ perf stat -e hisi_pcie0_0/latency/ // Count both of the above (events must be in the same group) $ perf stat -g -e hisi_pcie0_0/latency/ -e hisi_pcie0_0/rx_memory_read/ Note that in all three of these cases the hardware will be programmed in the same way and both HISI_PCIE_CNT and HISI_PCIE_EXT_CNT are allocated! So for example, doing this (i.e. without the '-g'): $ perf stat -e hisi_pcie0_0/latency/ -e hisi_pcie0_0/rx_memory_read/ would fail because the first event would allocate both of the counters. All you need to do is check the counter scheduling constraints when accepting an event group in the driver. No need for subevents at all. Does that make sense? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel