ANDROID: vendor_hooks: add hook to record slab free

Add a hook in slab_free to trace memory leaks and ensure that all
single-object free operations are properly monitored.

Bug: 428807705
Change-Id: I971f82be24822422b6a6723e8cbb01c98cd2f6b4
Signed-off-by: wei li <sirius.liwei@honor.corp-partner.google.com>
This commit is contained in:
wei li
2025-07-01 12:25:42 +08:00
committed by Suren Baghdasaryan
parent d2e452e197
commit c181c478b0

View File

@@ -4661,6 +4661,8 @@ void slab_free(struct kmem_cache *s, struct slab *slab, void *object,
if (likely(slab_free_hook(s, object, slab_want_init_on_free(s), false)))
do_slab_free(s, slab, object, object, 1, addr);
trace_android_vh_slab_free(addr, s);
}
#ifdef CONFIG_MEMCG