ANDROID: mm: add a hook to amend /proc/pagetypeinfo output

print the Customized page info when /proc/pagetypeinfo is read

Bug: 391128435

Change-Id: I6f64c3eaef5d9aad0a73dffd8914937bc57eb5af
Signed-off-by: yipeng xiang <yipengxiang@honor.corp-partner.google.com>
This commit is contained in:
yipeng xiang
2025-02-05 19:22:07 +08:00
committed by Treehugger Robot
parent d24f931f61
commit da614c9705
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -163,6 +163,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_is_fpsimd_save);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_process_madvise_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_process_madvise_iter);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_show_task);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pagetypeinfo_show);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_uninterruptible_tasks);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_uninterruptible_tasks_dn);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ftrace_oops_enter);
+3
View File
@@ -50,6 +50,9 @@ DECLARE_HOOK(android_vh_io_statistics,
TP_PROTO(struct address_space *mapping, unsigned int index,
unsigned int nr_page, bool read, bool direct),
TP_ARGS(mapping, index, nr_page, read, direct));
DECLARE_HOOK(android_vh_pagetypeinfo_show,
TP_PROTO(struct seq_file *m),
TP_ARGS(m));
struct cma;
DECLARE_HOOK(android_vh_cma_alloc_bypass,
+2
View File
@@ -29,6 +29,7 @@
#include <linux/page_owner.h>
#include <linux/sched/isolation.h>
#include <trace/hooks/mm.h>
#include "internal.h"
#ifdef CONFIG_NUMA
@@ -1690,6 +1691,7 @@ static int pagetypeinfo_show(struct seq_file *m, void *arg)
pagetypeinfo_showfree(m, pgdat);
pagetypeinfo_showblockcount(m, pgdat);
pagetypeinfo_showmixedcount(m, pgdat);
trace_android_vh_pagetypeinfo_show(m);
return 0;
}