Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp869289rdb; Fri, 23 Feb 2024 02:39:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVF8Y6Fjli19yI9jdi0L2zfo0XlVrmkYnu8j7qcp3czmp7LAyxHrYLOOG6iMXQUA604TkmedYgYxEg9rMmoGozS23raAvEpIsSf4qC0eQ== X-Google-Smtp-Source: AGHT+IFr4c44+drchTo8JPMO3FFXAqisZUPVby64i4yM5JnbK2mpvRvMIdvqsnhDyCqJWLBdb/0n X-Received: by 2002:a17:906:ad4:b0:a3e:9ddf:9f68 with SMTP id z20-20020a1709060ad400b00a3e9ddf9f68mr971593ejf.43.1708684776069; Fri, 23 Feb 2024 02:39:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708684776; cv=pass; d=google.com; s=arc-20160816; b=YDER4vX4SKqkoYMXib/gZMPjijLmL3r0/6EgqYy1yPGLxAWSIqIAwzH4z3k39tl0Yl uODNq1TQSBOAtc+JRRQ8Nd8remsn9HOfI7/gHAt1p4p408lypl2SGQqkkf/GdxZmqkeP QlQpPXlWqJEaLNEda8/MKIYmQHR7+N4j0P2/ShNQtP545B3stoodu9eyfRpwgDpkpDc6 FYuwwheGs9o5kPTwCXagImVFL2eUDNk7C66QbEl27VuBiox8l+RpjX0a8H2abnNXMmmy iDtg1dAbD9yGCd7SXtNRysGI0S694hPpFCebY+y0KhOky5uvFG+QsNuLvrCbEbfvoEcb 5eGQ== 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=gazfHijpmPJaS2Cw8ww7BgGAnIJIgWOnDwtOuyNPFUc=; fh=jersQh8TE0KFZCA3V8poDAKHKQ+owT+1iuzuvpXietI=; b=B/Er+yqOgi4Zx68RYODd9hNgAZbX9VUf4WY1dDS67/rjEOPlehmAwWd3eyZbn+VtNB sKak77szgvyYp6uyHT2I69E6Z3s8FIPnUVEqJ4i6GuHgQDXo3OSq+Z2Fo1I7t5mwwZFA CAFB5hKe2cD9FfkeuHtotyOh3Uwx1eX6x0SxKvUfPj+XDsHnSqWGsdWN7vxb4JrPxQSG Z/L0jgKXxnhxAUirO92/bTe9Gx2GKF5zIci+mQyHf8hyz3iUxCIJbl8KsbP9QpNN/CTJ I5RFo/y2MNvA5L7ZapD5Hh32aHHPbEz/Bd/C4yZgwgtylw9Jhi26McFlH6svr9NQzqRT W/Zw==; 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-78149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78149-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 25-20020a170906329900b00a3e51170726si5246844ejw.656.2024.02.23.02.39.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 02:39:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-78149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78149-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 am.mirrors.kernel.org (Postfix) with ESMTPS id CC8601F24B88 for ; Fri, 23 Feb 2024 10:39:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 326177BAE3; Fri, 23 Feb 2024 10:38:26 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (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 94AD16311D for ; Fri, 23 Feb 2024 10:38:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708684705; cv=none; b=TZ/lWECXAfF9PXMAQx/XaN9nhd9EvqnAR/SqADdg5wgO8hpR9cAdfKYqM6k2GMCm29pz2IFH9+3bT8nzfNmrEXjLiD7/i9ySOTwTURlZy3pIklfjZ9oswDtIVMU+a4HwYw1r5aWSuLg4yQbf9mVSmLZxBDMjv8qm86ovuLnJe/4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708684705; c=relaxed/simple; bh=UmKeEZN5gz+R0yIx9LvjW24GAChVNwT+bTIKirbn/3w=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZxWD5qwzdzH3zG5WSj1GOmeE+wBf7YEUISGGKIeM9XRSY3KfNkUzSH0Y2sPhw9VP23yoh+BmxfvlNXnIqLQ88JJNMCav1pwopEVjpqwsuTuhyBflY3p5eYIjuThyZRStHhXlx8gWcmG3k/IX0VxQQlhqEgg1vff+E9sc9L9pG8M= 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.188 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.88.194]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Th60R28VLzLncB; Fri, 23 Feb 2024 18:37:43 +0800 (CST) Received: from canpemm500009.china.huawei.com (unknown [7.192.105.203]) by mail.maildlp.com (Postfix) with ESMTPS id 409E01400D5; Fri, 23 Feb 2024 18:38:20 +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_256_GCM_SHA384) id 15.1.2507.35; Fri, 23 Feb 2024 18:38:19 +0800 From: Yicong Yang To: , , , , , CC: , , , Subject: [PATCH v2 8/8] docs: perf: Update usage for target filter of hisi-pcie-pmu Date: Fri, 23 Feb 2024 18:33:59 +0800 Message-ID: <20240223103359.18669-9-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20240223103359.18669-1-yangyicong@huawei.com> References: <20240223103359.18669-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: dggems705-chm.china.huawei.com (10.3.19.182) 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..678d3865560c 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 these two + interfaces aren't 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