Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp171354lqz; Fri, 29 Mar 2024 12:13:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVV4Jx49y02MRkC0+/uOCM80qTcyZNrJc0YBil15vYCE4eUK8KGV7wbGQ4JWRdGJ7d0kqRd5kYH2u+O8B1wJXn77NjF2HG1QOjaK/aqSw== X-Google-Smtp-Source: AGHT+IGcTUMgAnT4VUIu6XDq9GrzYcb8M3psq2NYm1V+wHfCuZFQr9FCBqlQLYPInhGUHj+W4deb X-Received: by 2002:a17:903:244b:b0:1e0:b3bb:c920 with SMTP id l11-20020a170903244b00b001e0b3bbc920mr3754207pls.17.1711739590573; Fri, 29 Mar 2024 12:13:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711739590; cv=pass; d=google.com; s=arc-20160816; b=VRuNnvQVJy3xRahIQGYywkdHrg1bgCEKyjeIHaK7EpgzrTWQD79Ta5DdLgDsHrI2W7 g7Hfkd/K11+2tURzM6YatqyTll8hPiCluCzNcn6D3/k6SN1r6mG5fBl6Y5eBF9HPEh7V shdS3AbANasuVMKSnpiG95kMJqQYmSpMmWw6rZhEADvmylE3+ZEupcQ/xysuJocbNJ69 61gzxwXaLYTm9F2DLCzDDVNQSwZGyVq4EpM/ZsyZVNDcfh99ZV7PlKPLu8cX4zh7TMQm KsF6fbr5oWIapUgJon2mD/TUawtYGmM4p5d8irTeYdzQ8nlhgWkDk3hALsmaT1WisT/J lnWQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=BkJ6G9y+ZKfgbdqCCxXL5MYAbEqVf2ZPf1WyTM66dLE=; fh=7D8bWqELNqJM6KF7zbibUOya8038rGAdDMFXsJMRu8c=; b=idz9eFSkomDjwHWkERRJqEm/NImhIxhe4LTgJFC8LbuIe8MpJtW7DYoj8txvnyu97Y 8hklV1B4Tq/MjBomIN9ZhqICDGRpZyWEYI1M50Oy/CehBa/iVl/UCnFmyxlEJ047W4aZ nLygLohiQvEOls01kdGRGuQdR9FnkyD9+jmjOPLokUI0PjJiTnrW9tmOeGSdMyny2ugd 43ybs8wWvImLK0d3Wtowx2YKp6erK1g/GZCAvNhuYvpreoHA/7KkwzllElrttPMyYvfR +mR7+54jFBRYw7eMq8TzbWx7+fF79AFN/kAeiunwy3JkP54LIULk6JaoCtjeMz7yPlxC jV4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DiPfjqN1; 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-125313-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125313-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. [147.75.48.161]) by mx.google.com with ESMTPS id k4-20020a170902d58400b001dcc84cec4esi4298307plh.577.2024.03.29.12.13.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 12:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125313-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DiPfjqN1; 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-125313-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125313-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 9BAEAB21B64 for ; Fri, 29 Mar 2024 19:12:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26C8313440D; Fri, 29 Mar 2024 19:12:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="DiPfjqN1" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 74393134BC; Fri, 29 Mar 2024 19:12:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711739569; cv=none; b=esk6k1VQRoQhZ26OTxF7Cs8VdzFwhk4zrcZDCSMS3sCGDv7wrjwzxpEj9Ma1bEClvV8cmWMlik6GfGHBtdwlI0S5R3vFctwl8AfpHnrGqfrouxAh3PSaaaa8oCn5cY+z3SXD2MJvY9e4RitE0dYNrEPV2UgUsrc+FN+C6i7CUBM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711739569; c=relaxed/simple; bh=PhJsaVSIH+3Xn404O+UuU0ng9/qhbjK6g4uHW3AZtUc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PJfa18EkrNobGmjoMxy98DPS9EYc0su0vbiwd2urxhBTzMBAKTVhdf4RJsSZNyoJ95kGf0nIEzXZy/aqqbKG0qHKIjSeRuDVuMBWf+HJ1BDvqk+QWZw87aX2ShRHSHlPBX9rQmMhCFag58SsqwTdDN6aMznqd2+gWZjNDDX45Jo= 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=DiPfjqN1; arc=none smtp.client-ip=192.198.163.16 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=1711739567; x=1743275567; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=PhJsaVSIH+3Xn404O+UuU0ng9/qhbjK6g4uHW3AZtUc=; b=DiPfjqN1pmZy4/ha8/O+jtZ+sHHbT+0+KrlHwP3977rjuVg2fayY7tiZ Pg7h6rpnXk19A5loyb5zl9Wk0VM8gGqYqyo6BZZZl02Cxqggl54pIaMgu AuT6ShceG6gRXmXdiaEglX8DLf/M0APL4IMSZtFqhazKzQwXw5ZvX4gYa sOzhCV6bxMoXk0kaYUXmlDXeYALVO8Tm4MBc49sZb9d/zX5V4vRqXptiJ cGk7F2gZdoh7omomZaupbWnahBO6OP2xKu5NXJuE1G/O6y1O9490WQ9am FpZRtcP7Qo+aMjTRYPoXUm4YJp93i3CTLFrSxGuICo8KLDRDOuHs28sc2 A==; X-CSE-ConnectionGUID: i98yuQrjTCSWMCYw/DrTCA== X-CSE-MsgGUID: AKTKWhvPTTWg7Db1pcNdsg== X-IronPort-AV: E=McAfee;i="6600,9927,11028"; a="7531713" X-IronPort-AV: E=Sophos;i="6.07,165,1708416000"; d="scan'208";a="7531713" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2024 12:12:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,165,1708416000"; d="scan'208";a="54506849" Received: from fl31ca102ks0602.deacluster.intel.com (HELO gnr-bkc.deacluster.intel.com) ([10.75.133.163]) by orviesa001.jf.intel.com with ESMTP; 29 Mar 2024 12:12: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 v6 0/5] TPEBS counting mode support Date: Fri, 29 Mar 2024 15:12:19 -0400 Message-ID: <20240329191224.1046866-1-weilin.wang@intel.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Weilin Wang Changes in v5: - Update code and add comments for better code quality [Namhyung] - Remove the added fd var and directly pass the opened fd to data.file.fd [Namhyung] - Add kill() to stop perf record when perf stat exists early [Namhyung] - Add command opt check to ensure only start perf record when -a/-C given [Namhyung] - Squash commits [Namhyung] v5: https://lore.kernel.org/lkml/CO6PR11MB56353F87C19F5D1DD913F94FEE3A2@CO6PR11MB5635.namprd11.prod.outlook.com/ Weilin Wang (5): perf stat: Parse and find tpebs events when parsing metrics to prepare for perf record sampling perf stat: Fork and launch perf record when perf stat needs to get retire latency value for a metric. perf stat: Add retire latency values into the expr_parse_ctx to prepare for final metric calculation perf stat: Add retire latency print functions to print out at the very end of print out perf vendor events intel: Add MTL metric json files tools/perf/builtin-stat.c | 225 +- .../arch/x86/meteorlake/metricgroups.json | 127 + .../arch/x86/meteorlake/mtl-metrics.json | 2551 +++++++++++++++++ tools/perf/util/data.c | 6 +- tools/perf/util/metricgroup.c | 88 +- tools/perf/util/metricgroup.h | 22 +- tools/perf/util/stat-display.c | 65 + tools/perf/util/stat-shadow.c | 19 + tools/perf/util/stat.h | 4 + 9 files changed, 3087 insertions(+), 20 deletions(-) create mode 100644 tools/perf/pmu-events/arch/x86/meteorlake/metricgroups.json create mode 100644 tools/perf/pmu-events/arch/x86/meteorlake/mtl-metrics.json -- 2.43.0