Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp81156lqr; Tue, 4 Jun 2024 22:22:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlQkEuT4aaY4/jMy8xPBh4qmFZtXlFwmuTe/oU2X6bIDm+0r6+3GuebS1bjomVsAk8Dfu9J1ISGlYrDU+uwisR9/FIjoH/DTO5nyN2jg== X-Google-Smtp-Source: AGHT+IGEg/b79URV/xxnvN57/BrVP3W9ySeMSZmJwMvwr0vn9k0+Ce08TTRSWgHVtBjIIITRnWIy X-Received: by 2002:a05:690c:82d:b0:62a:530:3710 with SMTP id 00721157ae682-62cbb5a2f15mr15114497b3.32.1717564947179; Tue, 04 Jun 2024 22:22:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717564947; cv=pass; d=google.com; s=arc-20160816; b=ppYntUEzVnVd0QMKjg6097xtccVI5+CqsUC/Wn3RRGRn/usJepJ4xVQUUpushBL75h uBRVSbXerOzMATkuoT31gkHSIxQsTH+jLYYmCaM+mNruPE6xzK/6OOOThQ01U+WM0fQZ Qs0tVixlYss1sIJiQ/q9ScDpq2LZmd7YxVLOTtQhsRqUf7bwUIXRQArVke3nZvzeAVZL LL0ZWZj6bk1nqzIVV+9zEUui24ZDYjBlidaKaWrNPeaT+QcaFe2PvguI9bBatX728NRb IJqmGLhSzXKDvHGZfCvhXvfwI9lYrxXO8r9dnQiOVrdxm65OisMKHyEWc/d+2ofQGAhj c2Nw== 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=n+P7Z7JrSCNLXYAMHJJvp/YzS6+9RpxEs6YIwgiq0boGjh3K1xP03CYfdqvq+urIkN sdox6BSWXuRURBt++ZRqnaEh0FDR1RlBpPr92Jr0YPRRswdn1h1AOBxR0nPgTgF1TzPj cS8bIBF7lSZDrZSAELhXnWzZ/xY1speLs50mCb8qWQEJHCZt/Vobao/RFky4BcKSsDDo LyK/7NF4nyCviUjODX1pHlwy2bct6zrg6ap+xUX48zN/Wr3I3Pk84gQIRsFmkWO5IOGu B+yFVOH6j6zIwu3wG+bOOlA+t4qYxvC8kp36TdXj+jQyqZpxQAUhxcQB3DV6L4vh9bax l80w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SMPmBMUa; 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-201765-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201765-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 af79cd13be357-79523af16dasi121829685a.410.2024.06.04.22.22.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 22:22:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201765-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=SMPmBMUa; 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-201765-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201765-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 E291B1C23E1A for ; Wed, 5 Jun 2024 05:22:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BF4713AD31; Wed, 5 Jun 2024 05:22:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SMPmBMUa" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 95C007346C; Wed, 5 Jun 2024 05:22:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717564934; cv=none; b=c8rHey7WjZiM/mwtgCqZdwxSpXsex5PelxsuB18MbB/LapOIKdj580JmigsIQWAzXmEiKuGJIs9xmPOGvQXO/+F0C2XA3pwhKBLt/tdKxL5zPyWwTegdyT4PVBzKC1xHK/zVn5gaXDEJVE267Unf97stlYRCcMFCznmpdgzd9sw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717564934; c=relaxed/simple; bh=ucqn9sYToQKkk1kUpIwBFwGZIP556Ihj0mSv9ZnCP+A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bHVjbNF6smcc6fF23Q8RkqOUuoJGfXmCsWRR3s3Hl5JrTXJg7eges41nUtGTlz4mDRrndT2OT/JnII9xsgzac/0kfzOz1t4/EN09TJ46KnfAqvSoTrKdvdiGe9/BkQfYy1BfJbd4hDxqcWfb5lpzmjEDU4wjVsUTN7Vi5mQwRqE= 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=SMPmBMUa; arc=none smtp.client-ip=198.175.65.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=1717564933; x=1749100933; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ucqn9sYToQKkk1kUpIwBFwGZIP556Ihj0mSv9ZnCP+A=; b=SMPmBMUarKMtv80hv1f/eUfg1O9oireRsV3Za8RjuqxIi0aOJXb43Yoz 0PPmXZNB7+RyoEbJodL7UNXQqxDvaLuGR4lLCrOtmTC6xg6CZ1CRr9UC+ YZ4nAD7yBgREnQqeAqjAfIV2qZEpnKBB5SJ5KB9Afc59STy1Os9ZHRsPR PCpbw46Poa1CuI2snUeYHkCxy62H3f1v6ooc8P3OoJCzsf3Xjyij0iPpk ArOZpPFq6NziLsOeBpnfWSCwcebOFQquYjf6dWUYmgxcWIUHx0Br8896y 0zvnKvAP2YVYJVrx/MfuO7Ajqnc/QrJVPuQmzYl326eZHmvnV9UDkMVi8 w==; X-CSE-ConnectionGUID: 0y9qcNQmQGKJPmmM7XtkTQ== X-CSE-MsgGUID: 74HTOqGLSluyrU6itHJ26w== X-IronPort-AV: E=McAfee;i="6600,9927,11093"; a="25258789" X-IronPort-AV: E=Sophos;i="6.08,215,1712646000"; d="scan'208";a="25258789" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2024 22:22:11 -0700 X-CSE-ConnectionGUID: 5OAQ8qJnSLuHObOeDwMt9A== X-CSE-MsgGUID: N+4FOU6fQxaPPmFhvjFT8A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,215,1712646000"; d="scan'208";a="37525727" Received: from fl31ca102ks0602.deacluster.intel.com (HELO gnr-bkc.deacluster.intel.com) ([10.75.133.163]) by orviesa009.jf.intel.com with ESMTP; 04 Jun 2024 22:22:11 -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 v11 1/8] perf parse-events: Add a retirement latency modifier Date: Wed, 5 Jun 2024 01:21:42 -0400 Message-ID: <20240605052200.4143205-2-weilin.wang@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605052200.4143205-1-weilin.wang@intel.com> References: <20240605052200.4143205-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