From nobody Fri Dec 19 16:12:21 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 148831A2C0E; Mon, 24 Jun 2024 22:20:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719267653; cv=none; b=RdeWouovBKcTmDWzq0gQyRV7dokF5cD9XyY42J2U5UnyRWhHIGT1lTGGo8fCsSm8Qel/GVklzFn0yJJdqOuZCnpxpFpz5X5Q8oaEAbX5RrAN2K1h/5xsDctKs5cqz3PxRb6Uvh8dJpfvDcpz9C9m072wCZ2rTMl2685jB7ocOAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719267653; c=relaxed/simple; bh=JFZfvPynPzZ2TE0Vt2lqzId/TgulfeakQxZrwtr+l44=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RZT90DKzX2sEGMEwUSgZBxHAelVroJAZzwY8IWTCEV/WnUcbAYu5uRvJDYwwpNO8YInC6rqEPebI9IINSaq4Fz5S7ik2PkhX3DZaOPfLSbvfLRO2czqpiq+g2CaNccmKrR1eIVRKemrjEISLCZnobMkEAMltOJ+QXaaDimfrZF8= 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=I26157Gu; arc=none smtp.client-ip=192.198.163.7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="I26157Gu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719267652; x=1750803652; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JFZfvPynPzZ2TE0Vt2lqzId/TgulfeakQxZrwtr+l44=; b=I26157Gu+UlG/DAF8jK58DKJhJ2VWvWFDjhhU3JZ0fM+QuHXpkyDzsJu rrZCh6HfofW5aRiqZgTVSCMxsmQDE3YwT3e7CkbLk4jeoMwiaYUlwmcGh 96WmDmvuAlL2uMQ6fv6m2EkKIoQiYM4ofysnGGrtToMtyWUYi4CbQz8pV qc1u3LfKfSFlPGmXz2J2pidcqzISTyRFvsBm/6lG8mbX9HBUMW1MUCGXg Hdwi0UjI7mimkzjFPQjjud4yIlRBLNpmnRo3N+CIsxlCmgTF4DmcCyioe Wnb0NWILTpAp3Iia64Iuqjux1YXaBy9vEAJkjxoB4kAsA27QY3ziWxsX3 w==; X-CSE-ConnectionGUID: 50MYMzaET9OtweGXnxVOlQ== X-CSE-MsgGUID: 81vFxUFxQOaSK1d5YTuUTA== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="41681634" X-IronPort-AV: E=Sophos;i="6.08,262,1712646000"; d="scan'208";a="41681634" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2024 15:20:46 -0700 X-CSE-ConnectionGUID: M2XptfFWT1KgEFEkS/y5CA== X-CSE-MsgGUID: zngh0iadQQ6PDnZjSpBn4g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,262,1712646000"; d="scan'208";a="48608236" Received: from fl31ca102ks0602.deacluster.intel.com (HELO gnr-bkc.deacluster.intel.com) ([10.75.133.163]) by orviesa004.jf.intel.com with ESMTP; 24 Jun 2024 15:20:46 -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 v14 7/8] perf Document: Add TPEBS to Documents Date: Mon, 24 Jun 2024 18:20:23 -0400 Message-ID: <20240624222026.229401-8-weilin.wang@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240624222026.229401-1-weilin.wang@intel.com> References: <20240624222026.229401-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: quoted-printable 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/Documentat= ion/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 =20 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/Documentatio= n/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 correspondin= g metrics as below. Fetch_Bandwidth =3D Frontend_Bound - Fetch_Latency Core_Bound =3D Backend_Bound - Memory_Bound =20 +TPEBS in TopDown +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +TPEBS (Timed PEBS) is one of the new Intel PMU features provided since Gra= nite +Rapids microarchitecture. The TPEBS feature adds a 16 bit retire_latency f= ield +in the Basic Info group of the PEBS record. It records the Core cycles sin= ce the +retirement of the previous instruction to the retirement of current instru= ction. +Please refer to Section 8.4.1 of "Intel=C2=AE Architecture Instruction Set= Extensions +Programming Reference" for more details about this feature. Because this f= eature +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_l= atency +values in some of the metrics=E2=80=99 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 div= ersity +of workloads in execution environments, retire_latency values measured at = real +time are more accurate. Therefore, new TMA metrics that use TPEBS will pro= vide +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 fo= rmula) +with perf record. The retire_latency value would be used in metric calcula= tion. +Currently, this feature is supported through perf stat + + perf stat -M metric_name --enable-tpebs-recording ... + + =20 [1] https://software.intel.com/en-us/top-down-microarchitecture-analysis-m= ethod-win [2] https://sites.google.com/site/analysismethods/yasin-pubs --=20 2.43.0