ANDROID: vendor_hooks: add restricted vendor hook for meminfo

To report vendor-specific memory statistics, add restricted
vendor hook since normal vendor hook work with only atomic
context.

Bug: 333482947
Change-Id: I5c32961b30f082a8a4aa78906d2fce1cdf4b0d2b
Signed-off-by: Minchan Kim <minchan@google.com>
This commit is contained in:
Minchan Kim 2024-04-10 05:35:06 +00:00 committed by Treehugger Robot
parent be55946e20
commit 59ef545736
3 changed files with 5 additions and 0 deletions

View file

@ -237,6 +237,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gic_v3_affinity_init);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_uninterrupt_tasks);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_uninterrupt_tasks_done);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_meminfo_proc_show);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_meminfo_proc_show);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_mm);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_slowpath);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_mem);

View file

@ -158,6 +158,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
global_zone_page_state(NR_FREE_CMA_PAGES));
#endif
trace_android_vh_meminfo_proc_show(m);
trace_android_rvh_meminfo_proc_show(m);
hugetlb_report_meminfo(m);

View file

@ -60,6 +60,9 @@ DECLARE_HOOK(android_vh_filemap_get_folio,
DECLARE_HOOK(android_vh_meminfo_proc_show,
TP_PROTO(struct seq_file *m),
TP_ARGS(m));
DECLARE_RESTRICTED_HOOK(android_rvh_meminfo_proc_show,
TP_PROTO(struct seq_file *m),
TP_ARGS(m), 1);
DECLARE_HOOK(android_vh_exit_mm,
TP_PROTO(struct mm_struct *mm),
TP_ARGS(mm));