ANDROID: vendor_hooks: add hooks for remove_vm_area.

Provide a vendor hook to remove additional fields when remove_vm_area
for slab/vmalloc memory leak debugging.

Bug: 240869642
Signed-off-by: Peifeng Li <lipeifeng@oppo.com>
Change-Id: Iafecd7c6e75cdc2df0e77ae105283590d8852f74
This commit is contained in:
Peifeng Li
2022-08-01 11:02:51 +08:00
committed by Treehugger Robot
parent c9a70dd592
commit 6532784c78
3 changed files with 5 additions and 0 deletions

View File

@@ -338,6 +338,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmc_attach_sd);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sdhci_get_cd);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmc_gpio_cd_irqt);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_vmalloc_stack);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_remove_vmalloc_stack);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_stack_hash);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_track_hash);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_vmpressure);

View File

@@ -233,6 +233,9 @@ DECLARE_HOOK(android_vh_free_pages,
DECLARE_HOOK(android_vh_set_shmem_page_flag,
TP_PROTO(struct page *page),
TP_ARGS(page));
DECLARE_HOOK(android_vh_remove_vmalloc_stack,
TP_PROTO(struct vm_struct *vm),
TP_ARGS(vm));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_MM_H */

View File

@@ -2170,6 +2170,7 @@ struct vm_struct *remove_vm_area(const void *addr)
if (va && va->vm) {
struct vm_struct *vm = va->vm;
trace_android_vh_remove_vmalloc_stack(vm);
va->vm = NULL;
spin_unlock(&vmap_area_lock);