Linux-perf-users Archive mirror
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: weilin.wang@intel.com, Peter Zijlstra <peterz@infradead.org>,
	 Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	 Mark Rutland <mark.rutland@arm.com>,
	 Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,  Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	 Kan Liang <kan.liang@linux.intel.com>,
	Ze Gao <zegao2021@gmail.com>,  Leo Yan <leo.yan@linux.dev>,
	Ravi Bangoria <ravi.bangoria@amd.com>,
	 Dmitrii Dolgov <9erthalion6@gmail.com>,
	Song Liu <song@kernel.org>,  James Clark <james.clark@arm.com>,
	linux-perf-users@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: [RFC PATCH v2 0/3] Retirement latency perf stat support
Date: Sat, 27 Apr 2024 22:36:12 -0700	[thread overview]
Message-ID: <20240428053616.1125891-1-irogers@google.com> (raw)

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 refactors tool events. I came across various issues
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.

v2. Better refactor tool events to support interval mode and more.
    Switch "weight1" to "retire_lat" in perf report command.
    Ensure max precision 'P' is enabled on the perf record command.
    Kill the perf record at read but keep sleep 0.1.
    Fix issues around perf record of tool and retirement latency events.

Ian Rogers (3):
  perf evsel: Refactor tool events
  perf parse-events: Add a retirement latency modifier
  perf evsel: Add retirement latency event support

 tools/perf/builtin-stat.c      |  74 +++---
 tools/perf/util/evsel.c        | 409 ++++++++++++++++++++++++++++++++-
 tools/perf/util/evsel.h        |  10 +
 tools/perf/util/parse-events.c |   2 +
 tools/perf/util/parse-events.h |   1 +
 tools/perf/util/parse-events.l |   3 +-
 6 files changed, 453 insertions(+), 46 deletions(-)

-- 
2.44.0.769.g3c40516874-goog


             reply	other threads:[~2024-04-28  5:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-28  5:36 Ian Rogers [this message]
2024-04-28  5:36 ` [RFC PATCH v2 1/3] perf evsel: Refactor tool events Ian Rogers
2024-04-29 21:00   ` Namhyung Kim
2024-04-30  2:47     ` Ian Rogers
2024-04-30 19:00       ` Namhyung Kim
2024-04-28  5:36 ` [RFC PATCH v2 2/3] perf parse-events: Add a retirement latency modifier Ian Rogers
2024-04-29 21:07   ` Namhyung Kim
2024-04-30  2:52     ` Ian Rogers
2024-04-28  5:36 ` [RFC PATCH v2 3/3] perf evsel: Add retirement latency event support Ian Rogers
2024-04-29 21:31   ` Namhyung Kim
2024-04-30  3:27     ` Ian Rogers
2024-04-30 21:00       ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240428053616.1125891-1-irogers@google.com \
    --to=irogers@google.com \
    --cc=9erthalion6@gmail.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@amd.com \
    --cc=song@kernel.org \
    --cc=weilin.wang@intel.com \
    --cc=zegao2021@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).