[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220405174028.1675025-1-florian.fischer@muhq.space>
Date: Tue, 5 Apr 2022 19:40:27 +0200
From: Florian Fischer <florian.fischer@...q.space>
To: linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Florian Schmaus <flow@...fau.de>
Subject: [RFC] perf stat: add rusage utime and stime events
Hallo everyone,
this is my first time sending out patches to the linux kernel repo so I am not
really confident in doing the correct thing.
This patch adds new internal events to perf stat exposing the ru_utime and
ru_stime reported by rusage.
During some benchmarking using perf it bothered me that I could not easily
retrieve the times spent in user or kernel mode from perf stat when using the
machine readable output.
But perf definitely knows about those values because in the human readable output
they are present.
Therefore I exposed the times reported by rusage via the new tool events:
rusage_user_time and rusage_system_time.
tools/perf/builtin-stat.c | 41 ++++++++++++++++++++++++++++++++---------
tools/perf/util/evsel.c | 19 ++++++++++++-------
tools/perf/util/evsel.h | 4 ++++
tools/perf/util/parse-events.c | 44 ++++++++++++++++++++++++++++++++++++++------
tools/perf/util/parse-events.l | 2 ++
tools/perf/util/stat-shadow.c | 2 ++
tools/perf/util/stat.h | 19 +++++++++++++++++++
7 files changed, 109 insertions(+), 22 deletions(-)
The changes are mostly inspired by the code for the only other available tool
event 'duration_time'.
For now rusage_* events are not usable with metrics (as far as I understand).
The patch applies cleanly on linux-next/next-20220405.
And I send this emails to anyone mentioned in the MAINTAINERS file.
Sorry for the possible unnecessary email spam :)
Florian Fischer
Powered by blists - more mailing lists