Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp136636lqp; Mon, 10 Jun 2024 22:32:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1o6QPDjCRK1/n9DS9RlfqNE9ZHQUXlqUIIRv71XDD2msgb7iNDI0aEAyMr9XegZLizdf6xmvPtXLbiJY/h6B40YhA0tSDWuOi0ybLYw== X-Google-Smtp-Source: AGHT+IGM8s9MOWdksr21HZ6GJDTIE/l/xJnL53P7aWD28r6qBrnoJl6MT/vUo6OK70OxgIsMINiG X-Received: by 2002:a05:620a:2492:b0:795:570a:b9e3 with SMTP id af79cd13be357-795570abc62mr737411385a.34.1718083947716; Mon, 10 Jun 2024 22:32:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718083947; cv=pass; d=google.com; s=arc-20160816; b=g+b8mfo+CKXoH8OoqNJI1uwnQhlFl3zCQH0XDy/QcKCzNVnkDf2ThhmP/uxihjhStR DziGscflwac4anOql8wAcG3E8tzHx23F2MTOXmMlUHsZoRzkY26/NpiAp8xpyQph6xo3 F+DxMmEhwBEd/kJyUdl8esKvOtYK/IJ9FnqHiX/0qfanw9uruJtFG58cg+tkyfPtuvFr uSH8CtdAI3enxUSuLk8P7E3wa3kP7o/qVF6VlC5IWD6/ZvkqnB8JYwFcPi0TKh1Erme/ 9kEUIY47YlRakVYkM72hlsFgeXT7kqVi2ZodX9GAXgcKgaMRQfEN5dY/LumEGHEY1Uff IY5w== 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:dkim-signature; bh=lIACNVr1MxuxSUXhZqD7Su2kcVtkIladBJFg6uZwAJo=; fh=7D8bWqELNqJM6KF7zbibUOya8038rGAdDMFXsJMRu8c=; b=08APNs8K8P+zjAbbXaP8sWXzzC4R/XZmJjqq59igxY9/0WtNIuJNuTV2p/JAUI5yxc 8WmPr0KP0vkg72yGL6QAXZipvCi6i+125IOaF1zIChJKe+9r9eK/4rltUGkLFJEquWSH 94ByE48XQG5G5/JhojfjjAsL5b+o/TxxIakNlhbMUbnCksm0fW8zXvm6uU2mV+ZDZ2BB R9UOO98ZPeDA84VND46IGy+T+ygif86RFRVkPV6aX+Ep2dciXSIiMS5LJQnfzhOK8aVB OKd2TMrR3qeP32WLyucuywhpCw2R8QtgGb/pCarBskUgCe9AbVa4WOeSJmnJznpxuuiF YsGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DI7uj1zB; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-209277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209277-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-795e62c9c70si478216885a.705.2024.06.10.22.32.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 22:32:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DI7uj1zB; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-209277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209277-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5E9501C20C34 for ; Tue, 11 Jun 2024 05:32:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8AAEB175540; Tue, 11 Jun 2024 05:24:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="DI7uj1zB" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 04B65173321; Tue, 11 Jun 2024 05:24:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718083450; cv=none; b=lKcghTnfCYkGXLZOsFmJsPo8evUfLB2GV0p+wGIjTIRax3mL+XNVH2ulH3hMJoi1aekxoTD/tVUhlJcVeAiQT2bviJDocBLczYOl2vwIqrAmuPEWb6xCJnnoJE0mpe7WjOR5yrIQjs7cgIV4Qm6buhb94NxtI0m7RxNh/DV5JN0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718083450; c=relaxed/simple; bh=JFZfvPynPzZ2TE0Vt2lqzId/TgulfeakQxZrwtr+l44=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kSD1pbjsGCZukS5NFS5u/8zJsU2/hIZbrNskpPbBqwv8nXNdTmlKlUIjxkVUeEN8RBSjWwzci2/UOkmjHPvk4NH3RkI0vfMHGnwaD34XsQ7OEqS0iKMv4Qhd81VK3/7tqhZobx6zhXAetGroGFeCezFWcfDHsG/fhuMPp9JZ6+I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=DI7uj1zB; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718083449; x=1749619449; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JFZfvPynPzZ2TE0Vt2lqzId/TgulfeakQxZrwtr+l44=; b=DI7uj1zB7XpyJ8+FSduDLQdK/p/5ER0CEJlY9vfN9h7nyRCGATboBR2p CuLDRRv3L53G0rGGwNcIyhsehRbuVQSi/NekeN2/3o/AtsUfR66HB8vZ/ UveXrNGjZ0X1R8HrxmlhguH8Eh5AHrzCVVUlhUd/rXJgJ4NTjswCmz02C vvQP9Fjw/RDLd+EoqqlFF1ZE+T5dr2g1M11/ut2DRAodxnaW8cv+sau1r t+x+aLsQ0XuqR9HOxb+f2UKD16lX7Aem5G9gB86nB5TCXvLeNPHIDZ93l kIvCQYxptpgs/fELu8x6PO8/bojAj0Dhh5VGGfSrPAAGKlhRX6Hkx7IN1 g==; X-CSE-ConnectionGUID: kU9lbl2ERuOhOx1HOqe0vg== X-CSE-MsgGUID: Yc/Uit25Rz+n2Y4yWX1d5A== X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="14651153" X-IronPort-AV: E=Sophos;i="6.08,229,1712646000"; d="scan'208";a="14651153" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 22:24:04 -0700 X-CSE-ConnectionGUID: BXgjolYGSi+KXUivol0kIQ== X-CSE-MsgGUID: ZsbGrWpHSdmSN9g6HIKV1w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,229,1712646000"; d="scan'208";a="44441210" Received: from fl31ca102ks0602.deacluster.intel.com (HELO gnr-bkc.deacluster.intel.com) ([10.75.133.163]) by orviesa004.jf.intel.com with ESMTP; 10 Jun 2024 22:24:04 -0700 From: weilin.wang@intel.com To: weilin.wang@intel.com, Namhyung Kim , Ian Rogers , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Perry Taylor , Samantha Alt , Caleb Biggers Subject: [RFC PATCH v12 7/8] perf Document: Add TPEBS to Documents Date: Tue, 11 Jun 2024 01:23:26 -0400 Message-ID: <20240611052331.85715-8-weilin.wang@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240611052331.85715-1-weilin.wang@intel.com> References: <20240611052331.85715-1-weilin.wang@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Weilin Wang TPEBS is a new feature Intel PMU from Granite Rapids microarchitecture. It will be used in new TMA releases. Adding related introduction to documents while adding new code to support it in perf stat. Signed-off-by: Weilin Wang --- tools/perf/Documentation/perf-list.txt | 1 + tools/perf/Documentation/topdown.txt | 30 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt index 6bf2468f59d3..dea005410ec0 100644 --- a/tools/perf/Documentation/perf-list.txt +++ b/tools/perf/Documentation/perf-list.txt @@ -72,6 +72,7 @@ counted. The following modifiers exist: W - group is weak and will fallback to non-group if not schedulable, e - group or event are exclusive and do not share the PMU b - use BPF aggregration (see perf stat --bpf-counters) + R - retire latency value of the event The 'p' modifier can be used for specifying how precise the instruction address should be. The 'p' modifier can be specified multiple times: diff --git a/tools/perf/Documentation/topdown.txt b/tools/perf/Documentation/topdown.txt index ae0aee86844f..98e5503552f5 100644 --- a/tools/perf/Documentation/topdown.txt +++ b/tools/perf/Documentation/topdown.txt @@ -325,6 +325,36 @@ other four level 2 metrics by subtracting corresponding metrics as below. Fetch_Bandwidth = Frontend_Bound - Fetch_Latency Core_Bound = Backend_Bound - Memory_Bound +TPEBS in TopDown +================ + +TPEBS (Timed PEBS) is one of the new Intel PMU features provided since Granite +Rapids microarchitecture. The TPEBS feature adds a 16 bit retire_latency field +in the Basic Info group of the PEBS record. It records the Core cycles since the +retirement of the previous instruction to the retirement of current instruction. +Please refer to Section 8.4.1 of "Intel® Architecture Instruction Set Extensions +Programming Reference" for more details about this feature. Because this feature +extends PEBS record, sampling with weight option is required to get the +retire_latency value. + + perf record -e event_name -W ... + +In the most recent release of TMA, the metrics begin to use event retire_latency +values in some of the metrics’ formulas on processors that support TPEBS feature. +For previous generations that do not support TPEBS, the values are static and +predefined per processor family by the hardware architects. Due to the diversity +of workloads in execution environments, retire_latency values measured at real +time are more accurate. Therefore, new TMA metrics that use TPEBS will provide +more accurate performance analysis results. + +To support TPEBS in TMA metrics, a new modifier :R on event is added. Perf would +capture retire_latency value of required events(event with :R in metric formula) +with perf record. The retire_latency value would be used in metric calculation. +Currently, this feature is supported through perf stat + + perf stat -M metric_name --enable-tpebs-recording ... + + [1] https://software.intel.com/en-us/top-down-microarchitecture-analysis-method-win [2] https://sites.google.com/site/analysismethods/yasin-pubs -- 2.43.0