From nobody Mon Feb 9 12:25:07 2026 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C3FAE578 for ; Sun, 4 Feb 2024 07:49:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707032980; cv=none; b=QkiTBZYoBQzOIFsreVOVSPWd1Z8SUqIAFlzxdbdo9aDKWd+P/7MeoYa8xx4SBX4F8wI1OvYJCmLNnSq1qukjmr9YYaptTfBXLMRewOIgTRB95swLpNqTpeUhp8RymYG2aHle7ybCmN6eONBzvqo+8AtP5mN3QQTLUkqpS4n104g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707032980; c=relaxed/simple; bh=sjrcDCbhSwKtcGnasHHrnMOZkhXGt64pWlRqOR6tDZA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iQZrKuqJpLC5tNOJdiTu7U1GGpIeoz+XR3Khm23ZaQkk3I3JWYJUTRXtPSRXaG31Vko5H/TVUdDT6ZdBW1mZkHeuFFgLo7dNerQm8F0TYuOLqWC2nqLzYqGh8ovM0yibm2JRtaJteQx3aHTStVVUu9SAWPLkd98fObfdKQVCwWQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4TSM800v2Mz1xnBQ; Sun, 4 Feb 2024 15:48:32 +0800 (CST) Received: from canpemm500009.china.huawei.com (unknown [7.192.105.203]) by mail.maildlp.com (Postfix) with ESMTPS id 479921A0178; Sun, 4 Feb 2024 15:49:36 +0800 (CST) Received: from localhost.localdomain (10.50.165.33) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 4 Feb 2024 15:49:36 +0800 From: Yicong Yang To: , , , , , CC: , , , Subject: [PATCH 7/7] docs: perf: Update usage for target filter of hisi-pcie-pmu Date: Sun, 4 Feb 2024 15:45:27 +0800 Message-ID: <20240204074527.47110-8-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20240204074527.47110-1-yangyicong@huawei.com> References: <20240204074527.47110-1-yangyicong@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500009.china.huawei.com (7.192.105.203) Content-Type: text/plain; charset="utf-8" From: Junhao He One of the "port" and "bdf" target filter interface must be set, and the related events should preferably used in the same group. Update the usage in the documentation. Signed-off-by: Junhao He Signed-off-by: Yicong Yang --- .../admin-guide/perf/hisi-pcie-pmu.rst | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/perf/hisi-pcie-pmu.rst b/Documentati= on/admin-guide/perf/hisi-pcie-pmu.rst index 7e863662e2d4..c98ea4b0f0d4 100644 --- a/Documentation/admin-guide/perf/hisi-pcie-pmu.rst +++ b/Documentation/admin-guide/perf/hisi-pcie-pmu.rst @@ -37,9 +37,20 @@ Example usage of perf:: hisi_pcie0_core0/rx_mwr_cnt/ [kernel PMU event] ------------------------------------------ =20 - $# perf stat -e hisi_pcie0_core0/rx_mwr_latency/ - $# perf stat -e hisi_pcie0_core0/rx_mwr_cnt/ - $# perf stat -g -e hisi_pcie0_core0/rx_mwr_latency/ -e hisi_pcie0_core0/= rx_mwr_cnt/ + $# perf stat -e hisi_pcie0_core0/rx_mwr_latency,port=3D0xffff/ + $# perf stat -e hisi_pcie0_core0/rx_mwr_cnt,port=3D0xffff/ + +The related events usually used to calculate the bandwidth, latency or oth= ers. +They need to start and end counting at the same time, therefore related ev= ents +are best used in the same event group to get the expected value. There are= two +ways to know if they are related events: +a) By event name, such as the latency events "xxx_latency, xxx_cnt" or + bandwidth events "xxx_flux, xxx_time". +b) By event type, such as "event=3D0xXXXX, event=3D0x1XXXX". + +Example usage of perf group:: + + $# perf stat -e "{hisi_pcie0_core0/rx_mwr_latency,port=3D0xffff/,hisi_pc= ie0_core0/rx_mwr_cnt,port=3D0xffff/}" =20 The current driver does not support sampling. So "perf record" is unsuppor= ted. Also attach to a task is unsupported for PCIe PMU. @@ -51,8 +62,12 @@ Filter options =20 PMU could only monitor the performance of traffic downstream target Root Ports or downstream target Endpoint. PCIe PMU driver support "port" and - "bdf" interfaces for users, and these two interfaces aren't supported a= t the - same time. + "bdf" interfaces for users. + Please notice that, one of these two interfaces must be set, and can not + be supported at the same time. If they are both set, only "port" filter= is + valid. + If "port" filter not being set or is set explicitly to zero (default), = the + "bdf" filter will be in effect, because "bdf=3D0" meaning 0000:000:00.0. =20 - port =20 @@ -95,7 +110,7 @@ Filter options =20 Example usage of perf:: =20 - $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,trig_len=3D0x4,trig_mode= =3D1/ sleep 5 + $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,port=3D0xffff,trig_len= =3D0x4,trig_mode=3D1/ sleep 5 =20 3. Threshold filter =20 @@ -109,7 +124,7 @@ Filter options =20 Example usage of perf:: =20 - $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,thr_len=3D0x4,thr_mode= =3D1/ sleep 5 + $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,port=3D0xffff,thr_len=3D= 0x4,thr_mode=3D1/ sleep 5 =20 4. TLP Length filter =20 @@ -127,4 +142,4 @@ Filter options =20 Example usage of perf:: =20 - $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,len_mode=3D0x1/ sleep 5 + $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,port=3D0xffff,len_mode= =3D0x1/ sleep 5 --=20 2.24.0