perf stat: Introduce stats for the user and system rusage times
authorFlorian Fischer <florian.fischer@muhq.space>
Wed, 20 Apr 2022 10:23:52 +0000 (12:23 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 20 Apr 2022 16:38:41 +0000 (13:38 -0300)
commitc735b0a5217620192a001323e1c2a4b4af5d3dea
tree57e38e6ba931015bf1ad125b0d112ea37d4fd9ef
parentc60664dea70a76cdffb4c4c21b2a09153b41a950
perf stat: Introduce stats for the user and system rusage times

This is preparation for exporting rusage values as tool events.

Add new global stats tracking the values obtained via rusage.

For now only ru_utime and ru_stime are part of the tracked stats.

Both are stored as nanoseconds to be consistent with 'duration_time',
although the finest resolution the struct timeval data in rusage
provides are microseconds.

Signed-off-by: Florian Fischer <florian.fischer@muhq.space>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Link: https://lore.kernel.org/r/20220420102354.468173-2-florian.fischer@muhq.space
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-stat.c
tools/perf/util/stat-shadow.c
tools/perf/util/stat.h