diff options
author | Ian Rogers <[email protected]> | 2024-05-03 16:28:49 -0700 |
---|---|---|
committer | Namhyung Kim <[email protected]> | 2024-06-10 16:45:10 -0700 |
commit | 6828d6929b763499b7a8768c623891f5d4fca258 (patch) | |
tree | 4d230dd5574bc3babc22117f0476f9d33f7003ad /tools/perf/scripts/python/parallel-perf.py | |
parent | 658a8805cb604260ae9f35ae5e50012e3d1ed5e3 (diff) |
perf evsel: Refactor tool events
Tool events unnecessarily open a dummy perf event which is useless
even with `perf record` which will still open a dummy event. Change
the behavior of tool events so:
- duration_time - call `rdclock` on open and then report the count as
a delta since the start in evsel__read_counter. This moves code out
of builtin-stat making it more general purpose.
- user_time/system_time - open the fd as either `/proc/pid/stat` or
`/proc/stat` for cases like system wide. evsel__read_counter will
read the appropriate field out of the procfs file. These values
were previously supplied by wait4, if the procfs read fails then
the wait4 values are used, assuming the process/thread terminated.
By reading user_time and system_time this way, interval mode, per
PID and per CPU can be supported although there are restrictions
given what the files provide (e.g. per PID can't be combined with
per CPU).
Opening any of the tool events for `perf record` is changed to return
invalid.
Signed-off-by: Ian Rogers <[email protected]>
Tested-by: Weilin Wang <[email protected]>
Cc: Ravi Bangoria <[email protected]>
Cc: James Clark <[email protected]>
Cc: Dmitrii Dolgov <[email protected]>
Cc: Ze Gao <[email protected]>
Cc: Song Liu <[email protected]>
Cc: Leo Yan <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/parallel-perf.py')
0 files changed, 0 insertions, 0 deletions