diff options
| author | Joel Fernandes (Google) <[email protected]> | 2019-11-30 17:50:30 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2019-12-01 06:29:18 -0800 |
| commit | b3d1411b6726ea6930222f8f12587d89762477c6 (patch) | |
| tree | ab58889099bcb27858c6ca4e39c61b4e5047bf1a /tools/perf/scripts/python/event_analyzing_sample.py | |
| parent | 8897c1b1a1795cab23d5ac13e4e23bf0b5f4e0c6 (diff) | |
mm: emit tracepoint when RSS changes
Useful to track how RSS is changing per TGID to detect spikes in RSS and
memory hogs. Several Android teams have been using this patch in
various kernel trees for half a year now. Many reported to me it is
really useful so I'm posting it upstream.
Initial patch developed by Tim Murray. Changes I made from original
patch: o Prevent any additional space consumed by mm_struct.
Regarding the fact that the RSS may change too often thus flooding the
traces - note that, there is some "hysterisis" with this already. That
is - We update the counter only if we receive 64 page faults due to
SPLIT_RSS_ACCOUNTING. However, during zapping or copying of pte range,
the RSS is updated immediately which can become noisy/flooding. In a
previous discussion, we agreed that BPF or ftrace can be used to rate
limit the signal if this becomes an issue.
Also note that I added wrappers to trace_rss_stat to prevent compiler
errors where linux/mm.h is included from tracing code, causing errors
such as:
CC kernel/trace/power-traces.o
In file included from ./include/trace/define_trace.h:102,
from ./include/trace/events/kmem.h:342,
from ./include/linux/mm.h:31,
from ./include/linux/ring_buffer.h:5,
from ./include/linux/trace_events.h:6,
from ./include/trace/events/power.h:12,
from kernel/trace/power-traces.c:15:
./include/trace/trace_events.h:113:22: error: field `ent' has incomplete type
struct trace_entry ent; \
Link: http://lore.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Co-developed-by: Tim Murray <[email protected]>
Signed-off-by: Tim Murray <[email protected]>
Signed-off-by: Joel Fernandes (Google) <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Carmen Jackson <[email protected]>
Cc: Mayank Gupta <[email protected]>
Cc: Daniel Colascione <[email protected]>
Cc: Steven Rostedt (VMware) <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: "Aneesh Kumar K.V" <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Jerome Glisse <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Ralph Campbell <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions