Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp141250lqq; Wed, 12 Jun 2024 20:38:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUbRMXX7aCb3C4rDFYoYaDlD2JXXDfnpMdE7aCOWUpwkB8qk7/sOtc8rZDXPVIDx3bRQq/IpQiIRQbkGHkJ9M38WwMl81A761FdTCnWPA== X-Google-Smtp-Source: AGHT+IF3Us8RVtUd9jjbmI2e/aOiq6feEVlBRH5AdkdYYCffFwM4txJShXCjRkt9QsnQXUNvRafM X-Received: by 2002:a05:6871:5d2:b0:24c:b4da:725d with SMTP id 586e51a60fabf-25514d05f71mr3326686fac.33.1718249899845; Wed, 12 Jun 2024 20:38:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718249899; cv=pass; d=google.com; s=arc-20160816; b=kNlWSsai23W15Xbd3CxlJbbykok+KY8S47yQqpDd+oQhVtXP+Nf732xR2pUSFQpqwt pQcNd2+rvDFyF0J9tA/K4gvxJGgGAEqySfFjwz0vCzL8+Eicd/uHoUN1d6ksVZXpszhi YLYf9+AX6lTR+CTScE3XJe9ulRIYyd6zn6dQIwnyfzSm+mW9DaYWpbZl48BOp78y9f4+ IqQ7HWTByzLiVYC07oxdI5AmZPkFV72TTrbhrt/fH/Ns42yMzzlSgQvdM4SL27WaE1y8 EyrSVV4sDUyvp5vXezPIcAz2A+WgDMlEesb/Aph/Q7DgULfBTHvheVW+6WTO44aqmFun CFWw== 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=VJD4q915vXIcldnxPHH5DDknn3QfeqrW7LJIDu31DTE=; fh=7D8bWqELNqJM6KF7zbibUOya8038rGAdDMFXsJMRu8c=; b=vBmlRRIbVg/ANwa3TYPtSbFAJQMmQbu8DfM2ywaTq5nb3U1DnunETLnjJlnGGAtRgK EE5oMNFOTpituj5BlZQFlgsNTSJuXT7m0LGnyjzDhuOF6jnwaPFSRYHhdixRTdsqJmaB t9XPchizC3T7nUNycK5m59zcHweFl+uS0lm/mGtGIsLrJoigFvC0VW9LSBwkXA4bA9aL 4NqV0v9slPBLTcDnVyhp+GgdiiCNLqovyikZd22ocN17n5WLP0LX/LaehnNbBkSZCGh/ fewhwfJQwBONp13rN9C9PuIPWzrJf7wjSmD3dFaIZk+fTmyTAPF3vJK7DoKuyOSdXZrI L7bg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VoqKlq6J; 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-212526-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212526-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-705ccb72a9bsi516633b3a.287.2024.06.12.20.38.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 20:38:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212526-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=VoqKlq6J; 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-212526-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212526-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 180F1B20EBF for ; Thu, 13 Jun 2024 03:36:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 449AA132105; Thu, 13 Jun 2024 03:36:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VoqKlq6J" 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 E537F1304BD; Thu, 13 Jun 2024 03:36:37 +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=1718249799; cv=none; b=Vv/k/E8NIHDazZAToiR84LhKu19Ey7yjnTEAJT+6CJlxiNC/DYKK/sTAy43j0pQcnxM4dBVcBZ/fMbXrfNDbY6hJFoEPq8+HxpvrcL04EOfc5kO7+6Bp7dZdKGYY0bNqhspfL85izHHqoCDKu+0PR2jtO3BqqKN0fbRuaxggAsI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718249799; c=relaxed/simple; bh=JpAWoEywdKvXlcM9uZ9uglnWMHdk9yJ7slIsntjFc5o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fTTSRtdvTottshx5acHnY68APFg8BlsGoz168TwFReFnZ38yaUkhZiuTDEyltGpYFPxoqscRgY95Wt8Xdg9pYxpBvCMyyPhTPFSz9G91q38O2q5pl+/zUA7y4cMUBGhtQ9gPVOCVSFo2VSUKEWInFRPoawJ9mi8Entg+IT0UmNI= 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=VoqKlq6J; 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=1718249798; x=1749785798; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JpAWoEywdKvXlcM9uZ9uglnWMHdk9yJ7slIsntjFc5o=; b=VoqKlq6JuaIl/Svf3vL8Hk3MhC3jbU9plMgEtEgm/QZwnVLccGp6dcgu bNYUZpkK22Nw0d4X5dcTiQMYasz3EuQ3pT27TeNvdT4ZzGmkvgA4nLVCc 0wnHNeSw9RgTZqHx0WJJLI6vaa2D1PHFn68v1bL95muoJQ8rfGgWFvy3+ I2SmlfZdv6yYwS8hGvwCW3GdcM75rbbf5U51LXhaT/jbwt6AhGaBCiQ1x cSN2hjfkGl1Clr8i+RQZyuzl+7Om9My4xoe6h/oAU6NjVL86ZFy6fQKDr LQ3KVibpuu07ZB3PpVmjcFSmAN0j9hrwjtSIEU3ggqpUkPOyc0Zagfz5U Q==; X-CSE-ConnectionGUID: 1vPo1gjxRPCmn+8EV1aaWQ== X-CSE-MsgGUID: Ffhgw2sBTk2m4QxRx+wKew== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="12046707" X-IronPort-AV: E=Sophos;i="6.08,234,1712646000"; d="scan'208";a="12046707" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 20:36:36 -0700 X-CSE-ConnectionGUID: D8o/SXuWRXKJu/+ogddmOA== X-CSE-MsgGUID: QaU5vxqYSVKOb4onLerypA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,234,1712646000"; d="scan'208";a="40100347" Received: from fl31ca102ks0602.deacluster.intel.com (HELO gnr-bkc.deacluster.intel.com) ([10.75.133.163]) by fmviesa009.fm.intel.com with ESMTP; 12 Jun 2024 20:36:36 -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 v13 2/9] perf parse-events: Add a retirement latency modifier Date: Wed, 12 Jun 2024 23:36:22 -0400 Message-ID: <20240613033631.199800-3-weilin.wang@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240613033631.199800-1-weilin.wang@intel.com> References: <20240613033631.199800-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-Transfer-Encoding: 8bit From: Ian Rogers Retirement latency is a separate sampled count used on newer Intel CPUs. Signed-off-by: Ian Rogers Signed-off-by: Weilin Wang --- tools/perf/util/evsel.h | 1 + tools/perf/util/parse-events.c | 2 ++ tools/perf/util/parse-events.h | 1 + tools/perf/util/parse-events.l | 3 ++- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 80b5f6dd868e..14f777b9e03e 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -98,6 +98,7 @@ struct evsel { bool bpf_counter; bool use_config_name; bool skippable; + bool retire_lat; int bpf_fd; struct bpf_object *bpf_obj; struct list_head config_terms; diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 321586fb5556..fab01ba54e34 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -1811,6 +1811,8 @@ static int parse_events__modifier_list(struct parse_events_state *parse_state, evsel->weak_group = true; if (mod.bpf) evsel->bpf_counter = true; + if (mod.retire_lat) + evsel->retire_lat = true; } return 0; } diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index e13de2c8b706..b735cd9e0acf 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h @@ -203,6 +203,7 @@ struct parse_events_modifier { bool hypervisor : 1; /* 'h' */ bool guest : 1; /* 'G' */ bool host : 1; /* 'H' */ + bool retire_lat : 1; /* 'R' */ }; int parse_events__modifier_event(struct parse_events_state *parse_state, void *loc, diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index 16045c383ada..5a0bcd7f166a 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l @@ -209,6 +209,7 @@ static int modifiers(struct parse_events_state *parse_state, yyscan_t scanner) CASE('W', weak); CASE('e', exclusive); CASE('b', bpf); + CASE('R', retire_lat); default: return PE_ERROR; } @@ -250,7 +251,7 @@ drv_cfg_term [a-zA-Z0-9_\.]+(=[a-zA-Z0-9_*?\.:]+)? * If you add a modifier you need to update check_modifier(). * Also, the letters in modifier_event must not be in modifier_bp. */ -modifier_event [ukhpPGHSDIWeb]{1,15} +modifier_event [ukhpPGHSDIWebR]{1,16} modifier_bp [rwx]{1,3} lc_type (L1-dcache|l1-d|l1d|L1-data|L1-icache|l1-i|l1i|L1-instruction|LLC|L2|dTLB|d-tlb|Data-TLB|iTLB|i-tlb|Instruction-TLB|branch|branches|bpu|btb|bpc|node) lc_op_result (load|loads|read|store|stores|write|prefetch|prefetches|speculative-read|speculative-load|refs|Reference|ops|access|misses|miss) -- 2.43.0