Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1764113rdb; Sat, 3 Feb 2024 23:50:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHKoAteYPUCEIeXKXS+I9Nk8LDtrtnf4tRN1yUhGHNFPwrExBzHB/F+1eoq7Js+OpFfQpQV X-Received: by 2002:a17:90a:df8d:b0:296:1e9:2c91 with SMTP id p13-20020a17090adf8d00b0029601e92c91mr10212858pjv.31.1707033008138; Sat, 03 Feb 2024 23:50:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707033008; cv=pass; d=google.com; s=arc-20160816; b=gYjMttDYu7p23IEu1JrhsaV4lvVsdVTlhwdsTKPT0p1eX9FdQSu7sxOgywLqOdo2ju gBK61IX4QVeMMwbu8YlClmAgHy9RbQUdZTaGqNIaE5WJ0nJ0+d9/mRGeSvA38fRmBjcM S2vZlUOJ5XUg+jJB0skk80zxxMVRZmDE3IHx1bNr2mRfkFS68pDroIpIfPXZ7T8hkBUx m6jv6qU2EI3RYBZIcbPmkcDSDNLMeo0dsvXHmCOg5JE2NtOw2fDys3nregnOpg7Jx15p 0sM4aNmN1Lwi1GXDKvJFS4bBB8HvbVM+uv0PCAxcob6iCw7ckDwLiaZ88emAfv1YTcNw wOmw== 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=YZpysGZbdnw7HVIqwrp3fF+M9AanVk0674Ft/9ryw+U=; b=IY2anQ08MP24MTnvBHRg4HS7g+Bd8u0uK8IIOQ/U7icAiZAoBUba2PVJM/sm5tVNHk n4JdiuFX/fIyeTNjPbgrx92NK0Hczl4igS5fFa/KAj31LB/tqj25nPQgKWFoWZdyksr8 OHXA8IByYdjwRwuuYREzJbtIiIwSfb7THT0aaJBjJ6F5ENFmUJ3fZR+OqmrhOsac5/90 U7rgxEs2mR40eqdh5vya87LNZKgiUhl/tio5ED+N2XXI+N0GsTXCZl/O4WFcC14tv9ZW zQztphkEvl9IB30+zsZGgrGMFTa8fuZ0HAm493EqXLuTIT/h+Ds6NJM2sWbzXPZDqW2Z BaFA==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51503-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com X-Forwarded-Encrypted: i=1; AJvYcCXRnfFTz3acxZ9qMqAmCOP8FdpHT/s4qRpL65pwqWRtoEPC3luHgSCI81Ogua5/tbVLwLj1kKKMZuQ6PDcLRq+uaNn0Gc1VQljmxISrVg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id pc9-20020a17090b3b8900b0029679474eaasi1202465pjb.12.2024.02.03.23.50.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 23:50:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51503-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C18F128495F for ; Sun, 4 Feb 2024 07:50:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42ABB11714; Sun, 4 Feb 2024 07:49:41 +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 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500009.china.huawei.com (7.192.105.203) 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 -- 2.24.0