From patchwork Sun Feb 4 07:45:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 196447 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp240925dyb; Sat, 3 Feb 2024 23:50:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQn3ZpRX4xyiJsl6FzkWEIa6ScuPq8cI9rDqi73F6xQ7krG5iB8KjAbrx3m91eubGlMY0l X-Received: by 2002:a17:906:c7d4:b0:a37:3831:67d5 with SMTP id dc20-20020a170906c7d400b00a37383167d5mr3369863ejb.22.1707033046885; Sat, 03 Feb 2024 23:50:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707033046; cv=pass; d=google.com; s=arc-20160816; b=RahS/T6RM3dUijnV0m1YHx5oZzk96bsi5dhsDN92Pwe77cUMja/h5VM9Sy9rFCw/zP NiQi2do7cAVqxmxTBExyL4Xkt3SV3MODawXtWniNrVcX4H3ADeY6MalKfNksuo1R32tn fwMVWB/+35UrTMBtsvd7KqNHVeqO3JSrI0T73fwWBaLO8XAJDDok/0CEQBAM9rKus+vF AN97dZfGOOedV1Sja592av5meXxpBD0UO9CfpYblusKtf7YDyUh5IaeRpUWrU3CFjoTF jtcK7N/cWcbzMU2FGtl2bOCZdACvLlZCFUU4ZFNw3iUxaO5smwlUsosebU1wHaYz/WB3 2aAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Dp8iXeiJP9T/3BqKwCxANWbH0ajI2GEEO4PD80roO4I=; fh=SkyvzWTbOY2LLDYwUzmo/g80dFf4aqC2Io4/0+u/CDQ=; b=bchPscIDJbvuPbJXWGKehJf2T+VgvEG2KfYweU8W3nqI65hamAUzJhbOFeAsISEpyM L0PvGLa0zG5Pr47BPZjXfUrWiiuyT8UYPt3udzd0Pb6X5pVCJOoeh6d9TP4dUnkBaAbv mjDGMnFplfa8f308KwvGW2jtLolJpUlMPDFdHifD43iTDIAK14478MYgd28A4cXOVpMp Cf0VpcuBICnNi9DWdOvggu22tRbQzN4gVNth9/Un1Z2LgbX5l8XSVAZrXoaURf7qoLCg uYX8LVUHWJhVnB+KXrk5ZoVtTcLYP1XPXnrnpGynpV3qqgmLeXm9BXY9siFziYrgfFb7 I3UQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-51503-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51503-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com X-Forwarded-Encrypted: i=1; AJvYcCWrKWaw2h9yw1qQp96YtunFrVkDXozE68+cysXiDMoARtN1tHD8sltIxHEdNDBCw7dVdiNwyLdT1y8GXbEAuCv4rv9IAg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e24-20020a1709062c1800b00a37972dd1a1si296203ejh.121.2024.02.03.23.50.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 23:50:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51503-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-51503-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51503-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7D2771F22588 for ; Sun, 4 Feb 2024 07:50:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85400134BD; Sun, 4 Feb 2024 07:49:42 +0000 (UTC) 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 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500009.china.huawei.com (7.192.105.203) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789953883871459166 X-GMAIL-MSGID: 1789953883871459166 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/Documentation/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] ------------------------------------------ - $# 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=0xffff/ + $# perf stat -e hisi_pcie0_core0/rx_mwr_cnt,port=0xffff/ + +The related events usually used to calculate the bandwidth, latency or others. +They need to start and end counting at the same time, therefore related events +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=0xXXXX, event=0x1XXXX". + +Example usage of perf group:: + + $# perf stat -e "{hisi_pcie0_core0/rx_mwr_latency,port=0xffff/,hisi_pcie0_core0/rx_mwr_cnt,port=0xffff/}" The current driver does not support sampling. So "perf record" is unsupported. Also attach to a task is unsupported for PCIe PMU. @@ -51,8 +62,12 @@ Filter options 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 at 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=0" meaning 0000:000:00.0. - port @@ -95,7 +110,7 @@ Filter options Example usage of perf:: - $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,trig_len=0x4,trig_mode=1/ sleep 5 + $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,port=0xffff,trig_len=0x4,trig_mode=1/ sleep 5 3. Threshold filter @@ -109,7 +124,7 @@ Filter options Example usage of perf:: - $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,thr_len=0x4,thr_mode=1/ sleep 5 + $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,port=0xffff,thr_len=0x4,thr_mode=1/ sleep 5 4. TLP Length filter @@ -127,4 +142,4 @@ Filter options Example usage of perf:: - $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,len_mode=0x1/ sleep 5 + $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,port=0xffff,len_mode=0x1/ sleep 5