diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index b35327eeb020..c31de25c5771 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -210,3 +210,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_flush_wq_wait_finish); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_flush_work_wait_start); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_flush_work_wait_finish); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_enable_thermal_genl_check); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_entry); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 7899ea20b20a..a0ce1350fb7b 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -78,6 +78,11 @@ DECLARE_HOOK(android_vh_kmalloc_large_alloced, DECLARE_RESTRICTED_HOOK(android_rvh_ctl_dirty_rate, TP_PROTO(struct inode *inode), TP_ARGS(inode), 1); + +DECLARE_HOOK(android_vh_alloc_pages_entry, + TP_PROTO(gfp_t *gfp, unsigned int order, int preferred_nid, + nodemask_t *nodemask), + TP_ARGS(gfp, order, preferred_nid, nodemask)); #endif /* _TRACE_HOOK_MM_H */ /* This part must be outside protection */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b13c7f486b44..a821316fa5c7 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4735,6 +4735,7 @@ struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order, gfp_t alloc_gfp; /* The gfp_t that was actually used for allocation */ struct alloc_context ac = { }; + trace_android_vh_alloc_pages_entry(&gfp, order, preferred_nid, nodemask); /* * There are several places where we assume that the order value is sane * so bail out early if the request is out of bound.