diff options
| author | Namhyung Kim <[email protected]> | 2021-02-02 18:01:16 +0900 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2021-02-03 13:10:44 -0300 |
| commit | 30626e0844757b7b371353eb693354c4ccc5eb0e (patch) | |
| tree | 8ab441606fce4dda526f2a9a1bcaa49822aec0f1 /tools/perf/scripts/python | |
| parent | c3a9cdef61e6dcb0b757a7309072c1742d764d79 (diff) | |
perf tools: Use /proc/<PID>/task/<TID>/status for PERF_RECORD_ event synthesis
To save memory usage, it needs to reduce the number of entries in the
proc filesystem. It's using /proc/<PID>/task directory to traverse
threads in the process and then kernel creates /proc/<PID>/task/<TID>
entries.
After that it checks the thread info using the /proc/<TID>/status file
rather than /proc/<PID>/task/<TID>/status. As far as I can see, they
are the same and contain all the info we need.
Using the latter eliminates the unnecessary /proc/<TID> entry. This can
be useful especially a large number of threads are used in the system.
In my experiment around 1KB of memory on average was saved for each
thread (which is not a thread group leader).
To do this, pass both pid and tid to perf_event_prepare_comm() if it
knows them. In case it doesn't know, passing 0 as pid will do the old
way.
Signed-off-by: Namhyung Kim <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions