diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index f34fa39c84e6..71a349221f3f 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -362,3 +362,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_early_resume_begin); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_filemap_get_folio); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmc_blk_mq_rw_recovery); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sd_update_bus_speed_mode); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_slab_folio_alloced); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 00f50548a20f..6b9353695660 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -196,6 +196,9 @@ DECLARE_HOOK(android_vh_mm_alloc_pages_may_oom_exit, DECLARE_HOOK(android_vh_adjust_kvmalloc_flags, TP_PROTO(unsigned int order, gfp_t *alloc_flags), TP_ARGS(order, alloc_flags)); +DECLARE_HOOK(android_vh_slab_folio_alloced, + TP_PROTO(unsigned int order, gfp_t flags), + TP_ARGS(order, flags)); #endif /* _TRACE_HOOK_MM_H */ /* This part must be outside protection */ diff --git a/mm/slub.c b/mm/slub.c index 3c9d4e333963..32c73002a5c5 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -43,6 +43,7 @@ #include #include +#include #include "internal.h" @@ -1823,6 +1824,8 @@ static inline struct slab *alloc_slab_page(gfp_t flags, int node, if (page_is_pfmemalloc(folio_page(folio, 0))) slab_set_pfmemalloc(slab); + trace_android_vh_slab_folio_alloced(order, flags); + return slab; }