Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1432194lqd; Thu, 25 Apr 2024 15:56:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW4uznnZSxDeksXxgIkELqc6cLCPvQOdjYrb5fAPD+7zpF2hfMGYk7SQ9K9Fb5Xqlrhe7VQFfRfCCIk8sPkkpqhzcTKlHB/I5xrImSigQ== X-Google-Smtp-Source: AGHT+IGQF6hbC5BrmtBAWwwwzg0YdtpRCFsrNUOxYE+QnP/t/0KxEpl3Zl54u+UAKSctPZt2aExC X-Received: by 2002:a17:90a:c795:b0:2ac:a7fd:8737 with SMTP id gn21-20020a17090ac79500b002aca7fd8737mr936641pjb.41.1714085815328; Thu, 25 Apr 2024 15:56:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714085815; cv=pass; d=google.com; s=arc-20160816; b=NFZ/mPoi3DG/yt3bpPeu4Kss4oHFaU82ctruxhsk87x83aDZtGV3xVeDEhCHnphumE aJuZmwmAZKP3n7C9nk/5W1V4m9PVLUvJa7VNcBy9FAoSHuTOD8o9ejJ37XqZhv83pHRP MNx83POmLS48pIQ07MyU7y3E12lcWejYAHt2yPAu+h4aQVz4zPYfRdbI6uJTZVfa23Mv 5vG5ZtUBXOmDp9Er0FsFEC4QkxOxa3pEsIsqcFiUJBTxvasDbXLk2cxgqZEjcxUQDMQw VN1Z0YbQU828dCeE8ZF/TEggwmbloFZ7+yQRZJVJw87BCFGHP9Nlx84q4r3zWyVXbBpj e4rQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:date:dkim-signature; bh=ZJJk73p5r9jx3t8Jke0lmFYDY3+/7qA+0Gxv92CMnvA=; fh=oztpuV50WXX+mhtA7NeAdyP2Ala/D2nyBnXpXh0hffM=; b=k4TvforkkEFSYKaDCTyIAOAE1GBWK4gL4uxtTrbXtOrxxSPFAH/nd1ssUoQgpfQaGx JeeV7K2h5f21H++mr93G0Ko2wOsMLiS0IlHIhgegTgm/eiVTh/8jBOIrVVVhTQMq/kEU 5TBkfBwBcJnnNuL55J3C4My2/rm3r0puLWMTSE/+k7NkpJLsc4s24xrmSQmMRbwmmX5v iSyTvIobAgyRplYVqG1ydLEN9c11K14ZDq18bt5W/VgrHjUeTgiPHuutwLqFDswQDKwQ OWmTOn9Wo8skibDuqFGNxSF3esg6/x5urd0T21eRoYi0iIOTaqdAJl30IKS17F9OroEc vNWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Qoa4adkT; 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-159323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 j4-20020a17090ac48400b002a2755c2f65si7876182pjt.151.2024.04.25.15.56.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 15:56:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159323-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=@google.com header.s=20230601 header.b=Qoa4adkT; 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-159323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159323-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B12D6B2178E for ; Thu, 25 Apr 2024 22:34:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70FC486274; Thu, 25 Apr 2024 22:34:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Qoa4adkT" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 F0FB12599 for ; Thu, 25 Apr 2024 22:34:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714084458; cv=none; b=YDBi8iKAEkjxOL6Gje2M0d0ESv5d3NSr12lVcsn2/IRTTx7er5ChODxxe3gUtHSEVFQao7UjGymvA8xMx7GC+dJMOhEIU1EAoBuSVs3jw8+VKc4lj0faYkM9kTrI4Ckhb8uIjFlgOJ2HrED3LNA+/ab/3b+oh8v+TRsM0mMsYKY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714084458; c=relaxed/simple; bh=u3et4SImCb3YPPJX9fDXXvlB2s1vG4/taao+OPDBknE=; h=Date:Message-Id:Mime-Version:Subject:From:To:Content-Type; b=pbJQyCuh5JrM2pKRAXXKH9rZ+4Le+NWS3kW4DVkqpLq2M2lk2ST6CwKVBhv7/LYb1p+2NBFKxxQFz4AdHHDQcyPeOAy5VlDcJBFHZkIf8KRRhiXvi5eHFjLuDHoS9oZMSqt7hKmf5RdV826gXHIE9gNJogqZNExvZj46qMZW8X4= 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=Qoa4adkT; arc=none smtp.client-ip=209.85.128.201 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-yw1-f201.google.com with SMTP id 00721157ae682-61ae546adf3so24898647b3.2 for ; Thu, 25 Apr 2024 15:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714084455; x=1714689255; darn=vger.kernel.org; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=ZJJk73p5r9jx3t8Jke0lmFYDY3+/7qA+0Gxv92CMnvA=; b=Qoa4adkTKdEGzt79TRvuIifoI5taET5PjO5tgtqQ8tkUkEie9XIfBP2py+LNPRvw1A LhlITKWD84084uOyYlXsw9kBtCxTfDQNtlRKoHv/wmMI8w7wIM2CoTYzwN10m44BArew zqCsoJbunhCI+QeRWUb61tYy6Xcf74QqaRCF/fQ7s73zsMVIhyqzSOjPNl5pDNs8ygKR slFhYTzdu53j16WOn0BVIkzvNt1oSmEMOzcePNP0Le5Va49Y1jJCCH++pisy5G6nFjSA H+NVN9TpO/e2XU8pZxggmgKpqDcwN9KBIx8Gw3d3MYJjcdFlrDKh7mETLX5+nw+9Lwlx DWrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714084455; x=1714689255; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZJJk73p5r9jx3t8Jke0lmFYDY3+/7qA+0Gxv92CMnvA=; b=VfVBVQcPkYT080ZGDMaA0l7sfMV77YaH0Mbja8SJ2+JWP+LVJ89IQ4aNYSU/fY72kj 9YNpsztFTDAogeSaTI22unYjnJCcQ13b74HGyvHUIO8ffu1yBQOFiBiZSBOgpherNn0E txAVYJ+3nHBdycqhdekcAfcNljVQxEFDbkIB+0GyFtMrDASf9Ey7WB+aJFdyoGAjIDbX UAo+3iUwg+43Wn5d/NQQbu4XBjxDlVDQwkUQ7Knufn+NjlzJIPVNPlFAQBp7DWMs2m/V VcINS4Hso+Wy/gs4kQZoKlR3ZtBDLhAfhIUsS80El7PyxKQ3y17Ch8o9HDW7c/kt4ixO GaBw== X-Forwarded-Encrypted: i=1; AJvYcCXDGEs5YaSwjaK8hNzcbwv3PcgUpcIZegI99i/F12ZLeyn9c6LJWF7J5WrQn0PdfGPg09l2Dm6D8CkxDgLy60w56dSvJmA4H2UScKEK X-Gm-Message-State: AOJu0Yy1ywEJW5eyUedpETIGES28tFTJJWzdrf7HieOKdm33h93d2ZyY JSTQaqeW4GwRqQvezZqp/TLrfORBHvSinE0WTK7h9bMyHLj9BCSY4mM2OG9OcLYH9PR8rDO7e3l bbze+PA== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:8708:517d:aade:8c87]) (user=irogers job=sendgmr) by 2002:a05:6902:1028:b0:de5:3003:4b64 with SMTP id x8-20020a056902102800b00de530034b64mr120115ybt.1.1714084454877; Thu, 25 Apr 2024 15:34:14 -0700 (PDT) Date: Thu, 25 Apr 2024 15:34:03 -0700 Message-Id: <20240425223406.471120-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.44.0.769.g3c40516874-goog Subject: [RFC PATCH v1 0/3] Retirement latency perf stat support 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" Support 'R' as a retirement latency modifier on events. When present the evsel will fork perf record and perf report commands, parsing the perf report output as the count value. The intent is to do something similar to Weilin's series: https://lore.kernel.org/lkml/20240402214436.1409476-1-weilin.wang@intel.com/ While the 'R' and the retirement latency are Intel specific, in the future I can imagine more evsel like commands that require child processes. We can make the logic more generic at that point. The code is untested on hardware that supports retirement latency, and with metrics with retirement latency in them. The record is also of sleep and various things need tweaking but I think v1 is good enough for people to give input. The first patch stops opening a dummy event for tool events. I came across this while looking into the issue and we can likely just pick it first. I kept it in the series for cleanliness sake. The code has benefitted greatly from Weilin's work and Namhyung's great review input. Ian Rogers (3): perf evsel: Don't open tool events perf parse-events: Add a retirement latency modifier perf evsel: Add retirement latency event support tools/perf/util/evsel.c | 186 ++++++++++++++++++++++++++++++++- tools/perf/util/evsel.h | 4 + tools/perf/util/parse-events.c | 2 + tools/perf/util/parse-events.h | 1 + tools/perf/util/parse-events.l | 3 +- 5 files changed, 192 insertions(+), 4 deletions(-) -- 2.44.0.769.g3c40516874-goog