Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp449198lqb; Tue, 28 May 2024 23:43:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWraIv6rQDF2Fl9zcwQ9xOBgAfLKeqWftXW4O3beoi6WrlLRAjbgA819GAVu4adjugINiUHgJCRXUE2WtJIyBXPxxd1XGo3TQPf1Lg9VA== X-Google-Smtp-Source: AGHT+IEKSBmZK7ok7ub3WfSp073fH2FEYbCRY+j94pkcgjIN93zRqO0z68iiqMMfOB1K29uViCNo X-Received: by 2002:ac8:58d0:0:b0:43d:f531:8b4e with SMTP id d75a77b69052e-43fb0e04a48mr166319571cf.34.1716965034037; Tue, 28 May 2024 23:43:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716965034; cv=pass; d=google.com; s=arc-20160816; b=cjwRkbBDEl4P6NadLTodfx5DspJ6RM/grV4mGig4EyOClVaEPAsGKcWyOB0udPhp7E 300YAQ6HCrreNdcxQnWFVDCVvx54ku8r3Qwr8r/V5fKuw8ON1fUH+T+UM+Jqdqw1nPpO qQ/ADEk1Lx2mnULOWg1Tr3SdbxN+ZjMEvJ+Frq3OHzfbQwbAE31pSLfp9/gjMYhO7VBH pNAi+k+RvwLmFU45ooSIDtyPyT1Nv0RAUlQvRgVJzZBHXl3ovGOZ8o7CB3yRXGkB8CRM zY7Q+ve7k60ZUZxccy4qrZU6/NXoXoWACGk30FvvYIug0PtHU6HBLFxBQrjfc/+ZuTYQ yUmw== 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=xN4+7Kkvqp+z9puPJ/S91fD5kgwtUlc/2mpakvzXWTeDoB93ZHg1oRPUtrvNWxnjUh VBCt1Nt3AkilFGp/A8AdA5L4e7CV4j+n1h58CpSBf5XoH6voIA+RKFCLRnHHQMHtJIoA U8v/SiVzv/SQhudkdjcwydTA5y6Tpq84hDJlCcuQ8mXaMIIj2hlC9344ORQWm2Pq1VnB SqzN3ehhMzSadrAG9gcSokMCv3uOfJ43L41Der4LL4AGNG/ypogC3dx9qk5olmkpADxn B3HwPZdMKed0645cA5j+U0rUSwN80NBWPrx0lnyrME3+QMV9E0wzMLBfmBnA5AqfUuHF ljyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EeZvFqrI; 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-193531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193531-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18b1acfsi137917511cf.418.2024.05.28.23.43.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 23:43:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EeZvFqrI; 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-193531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193531-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BCF631C23778 for ; Wed, 29 May 2024 06:43:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB930161B43; Wed, 29 May 2024 06:43:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="EeZvFqrI" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 614A715B0F6; Wed, 29 May 2024 06:43:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716965017; cv=none; b=UMNFv14J+20fjPqRXjQFwlPtJIRvVdusltMTOVn1EQ1N6OF+GLuqOwFzjcO31cgMzT4QH1092YLq5PA2ykASfzYr6HpOGuYpDKI5ElNsHn8jBJCZtXG0PKrJxsFNMb9baRSpD57PwbuoKUin2Aftk5IBSeU05wyLGM9KpT4uMZQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716965017; c=relaxed/simple; bh=ucqn9sYToQKkk1kUpIwBFwGZIP556Ihj0mSv9ZnCP+A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rRq3fA4roT1ZlMfVOUinsRrGdQ2qcB+1dG4IR7WJjq5ykJ42/GWG1gYiUq3DBv0XE6wHZfQd2//kc+EYE5jyBBWevMOVBorOOpSji/HUJa70u2wM7gql4h04w3P9Qf+7STQ166SLbsHy9bLvp1cYHxp7GVzcqXJZtNyCZqlKaS4= 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=EeZvFqrI; arc=none smtp.client-ip=192.198.163.13 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=1716965017; x=1748501017; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ucqn9sYToQKkk1kUpIwBFwGZIP556Ihj0mSv9ZnCP+A=; b=EeZvFqrIvtb6/yrjyV6hoyil7sMoS7/8Gj9umI79Hpg2Coyxy+rPv1xr j3zxtBa6wC3UNNehLzEQeBxba2WqInCvjroZ5OVlUWUcQB0xgbSHclZP5 ETuKzYxeLPPZ1M8HaiGd201Qy5NVF8vw7YpuMEWENPPnw0LRNADVDt1Lg mFoslgf8JCfQSek0QFOdYCpmdDc0FnXO8EBM6w39mPkw7SDSZBXD9DPk2 wJ37t2nyg2oLOLdAzLhACw96Ehn1yBt9ro+wyoqShA5FJpTrhW4/UlETi PQt+J4aZtdouhCm+Eb537fEyc5Ee9vdAfsq7vaIewQCj0t8O10+Onx1ZT A==; X-CSE-ConnectionGUID: +w17sV9gTnO1i/LQYMKv/Q== X-CSE-MsgGUID: V4DenS0BTnyGrK+ZFD6qzA== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="16297981" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="16297981" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 23:43:34 -0700 X-CSE-ConnectionGUID: Dk4n285rRFi0HT7xBWnfCw== X-CSE-MsgGUID: cboPyYQRQhaVsEzWahGoiw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="39759255" Received: from fl31ca102ks0602.deacluster.intel.com (HELO gnr-bkc.deacluster.intel.com) ([10.75.133.163]) by fmviesa005.fm.intel.com with ESMTP; 28 May 2024 23:43:33 -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 v10 1/8] perf parse-events: Add a retirement latency modifier Date: Wed, 29 May 2024 02:43:17 -0400 Message-ID: <20240529064327.4080674-2-weilin.wang@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240529064327.4080674-1-weilin.wang@intel.com> References: <20240529064327.4080674-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