Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp143728lqp; Mon, 10 Jun 2024 22:56:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWcSZhfD4MEahkZ+rtYyF6R9Vs9B9wkU0smIyuguVKAAMfxPibntN5XRPTaD0cEsCL6jt05r3rEBWOEdiFZEiZhgg1ADBoCGKg48pTTLQ== X-Google-Smtp-Source: AGHT+IFH45S/w8oZTFQ+dfF8y0Pd51h22OozJkJ0SNKyl1SKHv+XtfVuq3zAAdyFTGXFFNxFdaVL X-Received: by 2002:a05:6358:60ca:b0:19f:4f94:8176 with SMTP id e5c5f4694b2df-19f4f9495a2mr688170055d.15.1718085360380; Mon, 10 Jun 2024 22:56:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718085360; cv=pass; d=google.com; s=arc-20160816; b=uZpLprB6gIJfJvywVLFHS10FZBBdp1ZVcY6vuKPTk0LEKcnn0pa1upVJFxdeZ+DEIH NFaAmX/O65YYEMeen7aQa8jepWuMvIsflg3/kVVfadU+daAZMsEDDs43NcH/n8oBThfV JP5QgiL5ZLmMxnQw1gG8LLp0/EGYNcdkER+0Z1Kswl5Gzw8MS2Y6q6yRDEQaQiL680Kk edAg4tnO9P266X/ha2+nyETwIvY2BfGkZIaswtTig83hb0sOoDZJcSfPXdG3KLJjOgIc d5/HmukSxc9M+Am9P7v064ScnYYInIFJ7R/IahO19G8PQeVIxEn9ksOSUWSbGjiRmHyE WJHA== 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=U/3rVbWvMca3aKeBoOUDIsd0Mnm0QLFfVhGy0j73Bfg=; fh=7D8bWqELNqJM6KF7zbibUOya8038rGAdDMFXsJMRu8c=; b=CZMUU+Y0hwg9+++VLqONN6Set/qdTrYT5WGeTW0Ywkj11DGZqhhg0Jee+dcaMSeXDs ZhtO5isn+eyKhhwmdj78grATe63Ijq9IEnkkz98WBS9tWPelf0O2hNXyptNxBOdn/bdJ PW+XJjJpLOI1OLtu61nSQQm7mjV+UPmhIyiGhTrWisDWrGLMcYpLisDPZpJh3XyV9m7K W+DcH+IJ8eODijt7EaMp+qVFKseBBFxXbjLHiWjz/E5FFrvXko6U63HlhS/rZmJfQTqn vZg6rYaLQvt1HWctmKdAYO/7uW2WYcjWQpj/i9eNnC1lYtx1ZTd99QfXMfHJ1LZjv44R oQlQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=n0Yfdqwo; 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-209272-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209272-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 41be03b00d2f7-6e48fef3981si6351767a12.124.2024.06.10.22.55.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 22:56:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209272-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=n0Yfdqwo; 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-209272-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209272-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 DE57DB2623D for ; Tue, 11 Jun 2024 05:31:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3EE6172BB9; Tue, 11 Jun 2024 05:24:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="n0Yfdqwo" 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 8B292171078; Tue, 11 Jun 2024 05:24:05 +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=1718083447; cv=none; b=kjsMWt7I8twSjXoOThHLpqSqIGqVAi2QrXi59uALIdyQPWJQyGSaBqbCFsi24UPyRElQ2RPoZ8Ud35th0LkpYGlNP5Bmq3ubX6oz/nBCb1wLNw3loULNTvmze0W68TgrOBzM1mVilYAPLE5TknGrILUH9J8Hftvp76LnwYaOhbY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718083447; c=relaxed/simple; bh=ucqn9sYToQKkk1kUpIwBFwGZIP556Ihj0mSv9ZnCP+A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c3hEdyVrXNStnqXpjHseB7l2R9MAox5f5XprhfOhJ09Ocu9BG7Oq+9BJ3aQhDTbBRiqRG7VZijrl24cKRGsEsufI2pKqJtJ/ivXT9iXlWu6mMCeuzy6lwK087qzD60UjnBZmVww0I5YZMCYd8RWr8bK5IMhSG3nd1tm5yK8374c= 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=n0Yfdqwo; 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=1718083445; x=1749619445; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ucqn9sYToQKkk1kUpIwBFwGZIP556Ihj0mSv9ZnCP+A=; b=n0Yfdqwo9Lll25sd5yk466MXcCjWJh5Q7WgpGlK6uFJE9iiIcZKHU2FK ZO24GoWp5+SUVc/uQNsAbLlwSxqJtmHWHQ3u2YD4KIujczmetZb6SZ5Dv WI59cQMLU/7fG7gPFKCTljPXAI74y9uOY2yl/trTSu5U9dwKKQB9U1zmS fSEoid4dD3xMS1j4nVsLmi+Ky3XvTd2e6eoyUoDuZKNEKG9wgAhWiZA/C zgpQxLQuvp7WL0rdWnCRMEgKEGmtUEvJp5zGr5Wmw4amEq4CAkRqo25aL fqBfs8CeTrMQ6W8tuDUazDOFvWs3SpFvXqPovnoA5l8OUO7QBhOEzVP0b w==; X-CSE-ConnectionGUID: hAfm4RsPRYyKKu5UhQB0ig== X-CSE-MsgGUID: zgEHwNAZSmONxxx1A+VKfQ== X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="14651122" X-IronPort-AV: E=Sophos;i="6.08,229,1712646000"; d="scan'208";a="14651122" 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:03 -0700 X-CSE-ConnectionGUID: h0MjMqwMSxum6+/V3MZFHQ== X-CSE-MsgGUID: rfKPe3ZRQB6Ni+ruDxvMOw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,229,1712646000"; d="scan'208";a="44441189" 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:03 -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 1/8] perf parse-events: Add a retirement latency modifier Date: Tue, 11 Jun 2024 01:23:20 -0400 Message-ID: <20240611052331.85715-2-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-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 43f6fd1dcb4d..bd8e84954e34 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 0f308b4db2b9..9c2a76ec8c99 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -1818,6 +1818,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 5695308efab9..eb94d1247dae 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h @@ -201,6 +201,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 08ea2d845dc3..85015f080240 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