Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp686340lqa; Sat, 27 Apr 2024 22:36:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQ59mcRBj6UkR9JfsDtdl0cfqSkxJ2aXaaVDqntfmF9Wxug6dcCi0smUJo2NqB+0P1oZ/M+TYdr8VanoJ76wbjShgy9ocKpASSYURxJg== X-Google-Smtp-Source: AGHT+IH6pAo8nFK90dAwFbGNpP5Z7TTB5B3G/2O7zH8D/Va5UUToW/uSxVJ6bRRbEmDDv9hh08zD X-Received: by 2002:a05:620a:b82:b0:790:b6e0:e1ac with SMTP id k2-20020a05620a0b8200b00790b6e0e1acmr5159982qkh.6.1714282609002; Sat, 27 Apr 2024 22:36:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714282608; cv=pass; d=google.com; s=arc-20160816; b=cIjBk6n7JsNxyoTk1UroSLldnUA7SMLWXjSDFLmnGNWBUYsfVY4/jnIckXD+xNr834 mTj5j6ELnRGwdqJmQ7UVpQtGkDd0yXCPK/pf0n9KWyCGa88mEzpBOcUxmm7ZGTSUQ2zp 5n/g9d16DBQuZrTOSxkUDsZRmoe/AhHLOR9gqhf/VOtEvYOuG08b20DwmomNAQ8HRWSm wK1uf3SW2bY/XgIpZwgs/LGuxIO/Dzyul+85r9oR7QvvFDztg1qngLmSBwiwkd8Vdx26 Zij7qQrBT2Uekx+JL/WvtEE8kZFrAyaeIVsWHgspR2TlbE9DZsSUUDfRYa7dISf0XC+0 Rs9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:in-reply-to:date :dkim-signature; bh=krs4YntHEU9iOHeaFDkbJHHtOvC7kECGCvfxGbSfmkQ=; fh=OeLwz1Idlw5eYPWkyde3UZKosr7kclz/MmmSEZ+D76c=; b=dUhjl4geZGKkJ+jQ8nmHmtPuNW6OknOBd40nkBZ5RyxmVbT13HeuQi63PNLHor/iHl GahuuXrDLGZ3OuBhjdWciZoluSj9dPE9T/7WiaJ8+p/+5Ke4GcyRnr9Jy4gC+RP8ywUw dber7rO8zugUIIpZfGMoSx2DZPKNkse53fHtEBHG0q8Xw76ZwvCiBQZSBSOtAWfvdHlu 7zuFECkMQMkivWO7NvfVoWTmlGeLx3e9F/9tzsnLDiNEODpfdZCEHBl72Mc7x88JyCEb GpEXykxA9LqJ1FAtwbfBdeoSZA0UA2CrmxpSv9RpwHePrsh34FTKmI8dq53pqS24hGzx AysA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="pRc/TvfU"; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-161264-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 f6-20020a05620a12e600b0078d63e4240fsi22627611qkl.630.2024.04.27.22.36.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Apr 2024 22:36:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161264-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=@google.com header.s=20230601 header.b="pRc/TvfU"; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-161264-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 B6B801C20D97 for ; Sun, 28 Apr 2024 05:36:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCE1ABA2B; Sun, 28 Apr 2024 05:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pRc/TvfU" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76575AD5F for ; Sun, 28 Apr 2024 05:36:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714282587; cv=none; b=nuhmqifE72Tbmt3rtAcHG3yaV2+x4FEezZIXUy38b6UgZmV05x48IxaxaIFDfhbA2Q/sivRpMhRQFFdXFTSmpD9adpF0fmfvb55WFJHcSdwvqfgX2vv1KBn2DSMYUUNVlASa0d+UhmLCFFoaos/UnwwVRtevAaHQ4VKkq2qNdkw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714282587; c=relaxed/simple; bh=XYz7PiZeKaJrW6wdr56WN27ZHPHIxfeYIzS3CYO6Ldo=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=GzaZQ2Lg/PpWGehtuCQwpV+C0WnjUYUzXAaYElLnVkvvH8jpRN/bbe6SZG2jysG2iExGhDWuxcGHgkc0/KmilHrhvFkhDUaxe2MW3cp+emWoOlarOxun6U93oyg6TquVea7BKcWacfYofWErcYslhv/kYM7W8BKthlXcuUR0GsA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=pRc/TvfU; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-de54be7066bso6407723276.0 for ; Sat, 27 Apr 2024 22:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714282585; x=1714887385; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=krs4YntHEU9iOHeaFDkbJHHtOvC7kECGCvfxGbSfmkQ=; b=pRc/TvfUX5nUHQRhbtdMv8DyWtfQYzTFrb3VgrtJkmsnbZUb8QFzBImeYDTPY5K1Y8 S8+FtQsLPBROi/t/LdMbRBSQAxS0m5eK28kRqDAKeXJuhpbZJQXh9aCyPXogv9xDbMXx 2KnM5rZSl6Emzy/1btrOAm4M6I1eHdiMjfQo6xB/MMBTtiaDseqdMVD5cKqFBgDnFVHt bqQPzktKo8umaiZ+RKz2MrhyzkBJgFyopaFeJ5+AFPaozv1n91mJJebWN19H+1m8eyRd dtCW8rC1Rn3e0FH7C2rgbXIc4q0y2DSvOCl0QBgWPkhUZUmxeINIMQ+8pdEYVvs6UnsD TEkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714282585; x=1714887385; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=krs4YntHEU9iOHeaFDkbJHHtOvC7kECGCvfxGbSfmkQ=; b=wZLCqMbnaaAFb5eGvrIC3UhoH2hc2+VsL7gzzjzRzPFUOcH+jE5/rXq5BVVbFzUi8q fxNSoMAu8RfQ+blO2kWU9QYnIsXuxoz/zlfPFhLPu+78g/64v6cB8TtJPNv6vMFGDTda KtVYyETGCCkdNYP7ovv+7Kx4fzNJLmuOLkN7HKAA+th/4ZPaqYxzR/AvjbsI3wIjpui9 1Z54iPxv6nYXM+M+xp3PXVZsyJfOJZ/je5AGVtVTtQuZMmAgnujg7PVdciNQ/Sw3oJ6X LiRtLy2Kqph+U0cE5ixqkxNue1QFQosQkjflZb/XNtptY2vxmiYc6bS2qYGCKrep3x+C 2WXQ== X-Forwarded-Encrypted: i=1; AJvYcCVuFV2ifc8V1+dDtLwrXFbYX/0wuMmBrcWM+LOIKV48LmEip0i4A5FRmxfoa+L0f5tkmcpjwg9vIPmkWmNKNcoh105ko3bOR3o+cITt X-Gm-Message-State: AOJu0YwVAEROjTxqEJk4JMNBJRcyueZQ+3IbT+OK1a90GIdyEK3BSa7E gLOoSkUQ5Mm7H6ErxjN5KS0YdgnCIUmPsFKzbGwAQlPSPiTHIZAigpJ63JYfxulvOyVgRCzwAg3 5dxYO2g== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:eaaa:2f79:c83c:9def]) (user=irogers job=sendgmr) by 2002:a25:4ac1:0:b0:ddd:7581:1380 with SMTP id x184-20020a254ac1000000b00ddd75811380mr2092963yba.11.1714282585305; Sat, 27 Apr 2024 22:36:25 -0700 (PDT) Date: Sat, 27 Apr 2024 22:36:14 -0700 In-Reply-To: <20240428053616.1125891-1-irogers@google.com> Message-Id: <20240428053616.1125891-3-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240428053616.1125891-1-irogers@google.com> X-Mailer: git-send-email 2.44.0.769.g3c40516874-goog Subject: [RFC PATCH v2 2/3] perf parse-events: Add a retirement latency modifier From: Ian Rogers To: weilin.wang@intel.com, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , Ze Gao , Leo Yan , Ravi Bangoria , Dmitrii Dolgov <9erthalion6@gmail.com>, Song Liu , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Retirement latency is a separate sampled count used on newer Intel CPUs. Signed-off-by: Ian Rogers --- 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.44.0.769.g3c40516874-goog