All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] perf stat: add rusage utime and stime events
@ 2022-04-05 17:40 Florian Fischer
  2022-04-05 17:40 ` [PATCH] " Florian Fischer
  0 siblings, 1 reply; 17+ messages in thread
From: Florian Fischer @ 2022-04-05 17:40 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo, Florian Schmaus


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


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-04-12 23:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05 17:40 [RFC] perf stat: add rusage utime and stime events Florian Fischer
2022-04-05 17:40 ` [PATCH] " Florian Fischer
2022-04-05 19:42   ` Arnaldo Carvalho de Melo
2022-04-06  7:28     ` [RFC v2] " Florian Fischer
2022-04-06  7:28       ` [PATCH v2 1/4] perf stat: introduce stats for the user and system rusage times Florian Fischer
2022-04-06  7:28       ` [PATCH v2 2/4] perf stat: add rusage utime and stime events Florian Fischer
2022-04-07  1:39         ` Xing Zhengjun
2022-04-07  8:57           ` [RFC v3] " Florian Fischer
2022-04-07  8:57             ` [PATCH v3 1/3] perf stat: introduce stats for the user and system rusage times Florian Fischer
2022-04-07  8:57             ` [PATCH v3 2/3] perf stat: add rusage utime and stime events Florian Fischer
2022-04-08 15:58               ` Ian Rogers
2022-04-10 16:41                 ` Florian Fischer
2022-04-11 15:29                   ` Ian Rogers
2022-04-12 22:31                     ` Namhyung Kim
2022-04-07  8:57             ` [PATCH v3 3/3] perf list: print all available tool events Florian Fischer
2022-04-06  7:28       ` [PATCH v2 3/4] " Florian Fischer
2022-04-06  7:28       ` [PATCH v2 4/4] perf util: add 'us' unit to the rusage time events Florian Fischer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.