[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220407085721.3289414-1-florian.fischer@muhq.space>
Date: Thu, 7 Apr 2022 10:57:18 +0200
From: Florian Fischer <florian.fischer@...q.space>
To: Xing Zhengjun <zhengjun.xing@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Florian Schmaus <flow@...fau.de>
Subject: [RFC v3] perf stat: add rusage utime and stime events
This patch series adds new internal events to perf stat exposing the utime and
stime in nanoseconds 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, rusage_system_time and their aliases ru_utime and ru_stime.
This allows to retrieved them in machine-readable output:
$ ./perf stat -x, -e duration_time,ru_utime,ru_stime,cache-misses -- grep -q -r duration_time tools/perf
72134524,ns,duration_time:u,72134524,100.00,,
65225000,ns,ru_utime:u,65225000,100.00,,
6865000,ns,ru_stime:u,6865000,100.00,,
38705,,cache-misses:u,71189328,100.00,,
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.
[PATCH v3 1/3] perf stat: introduce stats for the user and system
[PATCH v3 2/3] perf stat: add rusage utime and stime events
[PATCH v3 3/3] perf list: print all available tool events
[v2]: Split up the changes into separate commits.
[v3]: * Use nanoseconds as suggested by Xing Zhengjun.
* Squash [PATCH v2 2/4] and [PATCH v2 4/4], because it only adds the unit string
Florian Fischer
Powered by blists - more mailing lists