Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3243261lqo; Tue, 21 May 2024 10:42:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVFGx965iZNajX9pOFLhjqKqW/Rg4coZQmGZ46JdYqmPIYHEW9kJ6LZ41w6FGcomFiipywTekXQ1T/Q0HWC376ezcNtp05oUdUWSsVjGw== X-Google-Smtp-Source: AGHT+IEInLtgXqcAqMscScR+2j4eyOu9AQIbmAgNCrxoPepWYXsw82UJnyq2XTZZ4ClCnMk6n6qp X-Received: by 2002:a05:6a00:9a2:b0:6f0:b53c:dfb4 with SMTP id d2e1a72fcca58-6f4e02f5f8amr38710629b3a.22.1716313330040; Tue, 21 May 2024 10:42:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716313330; cv=pass; d=google.com; s=arc-20160816; b=KXB5dAnsTv4j2h/4SPTZ3S6WN/Nf0H67Tf0iLFOrRDk+ZCLNbhtsuEXQTo9nZ+cJdf Txoojec0ej4Z2NIlczAepJoBbn7/o4WwIDLNOK7XV0aj6VO0VPnvCXlMynJ6b6y+l4SA 5bvAPSVTNdpL/0LS9+DoI6EDpRPjJzaTCho5eIloQFffccJP4WDjUgfpXXVqhQeDMDF7 QJCIutkRYqamfeS1dGxX3DRLiZNfjtEj62wTXboroJ7jx5SxzZUZgEQArJz/6B4bncz5 +AzsS7wYWdsdxV2KHPZIn065Ad80OxuXqok1q9tTvlKk8AzK1LAkth80hYqmgh/oAXu/ bq5Q== 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=PXq4H3Ff8S9YTSM6y/0N0ve5LMnB8NOd08kQKXvQn8f2Gj86sT8cFxY2BgWMsFjTWQ dZzlMn9vaDWtqOEzBgHQhenmtg1TdXUq44ZeEAbRxBs3thlll2XkxKibjuhizNC45vJ0 fuH97Tbq8CTfW9cnpHykl3WHUG8tsKVeDqbuIFUhvAuLvo+/xWfkvSy3S/cVVpj6z3D9 B285pw0WT6qj4o7S55FTHTgWoh0DUEOwYldp1yY5Fxmu/HsBbcc3sWQYXVX06W0syGaH DKoAhFlY6Gup+Pm5DheCJUo5BNze1eAWQeKb11C1dubKhly55te7FQQtjQHO/5goKPKk rovQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cGzzCN+s; 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-185285-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185285-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b1db56si2357468b3a.269.2024.05.21.10.42.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 10:42:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185285-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cGzzCN+s; 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-185285-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185285-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 55B6FB220B6 for ; Tue, 21 May 2024 17:41:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFB291494D8; Tue, 21 May 2024 17:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="cGzzCN+s" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 19BA4148FFC; Tue, 21 May 2024 17:40:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716313203; cv=none; b=Dv7BW7Na/I98mnfH5NYpkofBa/cbNi0gRHAUOYxqs6l9l0AWXeW7QkWtc6+vkt5JFdRGh6ODTF5vSYPQVihB0wf33t7KWfy4x9M3oHAV94h8B1oZoqHUeNgD5t6xmuqDyndkSYh/rL7CgSuxp39Xzz3qLPBJnJ3t+x1tdwmVkJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716313203; c=relaxed/simple; bh=JFZfvPynPzZ2TE0Vt2lqzId/TgulfeakQxZrwtr+l44=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=piNm4p8Z0qQuCgv2IxD8lCJ9rJsz9UmCNu2EXe8GzmjzP3k+XmRpuY/AXUPbuKpZri2r9JqFCNXVHcYMrem6OXiTF4iqEhaOk8mkx1X7vNih1Or2LuVMYj4noEy7LGawdsCYhux7uIJ4JUO4YdgVcRAjJ93nL0+GuecxHG17oF0= 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=cGzzCN+s; arc=none smtp.client-ip=192.198.163.18 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=1716313202; x=1747849202; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JFZfvPynPzZ2TE0Vt2lqzId/TgulfeakQxZrwtr+l44=; b=cGzzCN+s9t1KzasUMKH7FmmN+NcQ5EGUdFrFRNfEKZZ4cPQzZcwWkHus TqC1J5GcgwfLQEe+mQj2jfCf7BeOTZmbgic2GbRuMfjojPkENgmrkJgIM iMTR8iN8rCF3Ua5hgiLTUEg1H6n8UAuchXteSJT9SngCuGnLz5G1fVVhl GDHk98nvVXMp6OGhMQGlxK4oKbk2eWP3yN4z6fywWsmriwlt34iTZseag KnWe5Jp24vQK9rdlhalUgcpkFYiIaTB3U+WHIRLpyHThc8c5PqCA0GF7g JmvgPtPuhZwxbsQgUEIblijiUB7AYq0/drPBk1wDAqfzcmRZoTxdCbA49 Q==; X-CSE-ConnectionGUID: ZWUs1rgBTE+/Oxlo4pveig== X-CSE-MsgGUID: WpZSK/PQT/O6ij5X6bEYNQ== X-IronPort-AV: E=McAfee;i="6600,9927,11079"; a="12317685" X-IronPort-AV: E=Sophos;i="6.08,178,1712646000"; d="scan'208";a="12317685" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2024 10:39:59 -0700 X-CSE-ConnectionGUID: O5os54H3R8upe/ItjnjJ0w== X-CSE-MsgGUID: RlJ3f5guTn6iFhvmhgGZuw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,178,1712646000"; d="scan'208";a="32924977" Received: from fl31ca102ks0602.deacluster.intel.com (HELO gnr-bkc.deacluster.intel.com) ([10.75.133.163]) by fmviesa007.fm.intel.com with ESMTP; 21 May 2024 10:39:59 -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 v9 6/7] perf Document: Add TPEBS to Documents Date: Tue, 21 May 2024 13:39:34 -0400 Message-ID: <20240521173952.3397644-7-weilin.wang@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240521173952.3397644-1-weilin.wang@intel.com> References: <20240521173952.3397644-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