diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 71a349221f3f..8425e8709b41 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -363,3 +363,4 @@ 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); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_kmalloc_large_alloced); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 6b9353695660..0bd0c34e17b9 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -199,6 +199,9 @@ DECLARE_HOOK(android_vh_adjust_kvmalloc_flags, DECLARE_HOOK(android_vh_slab_folio_alloced, TP_PROTO(unsigned int order, gfp_t flags), TP_ARGS(order, flags)); +DECLARE_HOOK(android_vh_kmalloc_large_alloced, + TP_PROTO(struct page *page, unsigned int order, gfp_t flags), + TP_ARGS(page, order, flags)); #endif /* _TRACE_HOOK_MM_H */ /* This part must be outside protection */ diff --git a/mm/slab_common.c b/mm/slab_common.c index cfbfb2c580ea..f64ebceb848c 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -1102,6 +1102,8 @@ static void *__kmalloc_large_node(size_t size, gfp_t flags, int node) PAGE_SIZE << order); } + trace_android_vh_kmalloc_large_alloced(page, order, flags); + ptr = kasan_kmalloc_large(ptr, size, flags); /* As ptr might get tagged, call kmemleak hook after KASAN. */ kmemleak_alloc(ptr, size, 1, flags);