ANDROID: vendor_hooks: add hooks for slab memory leak debugging

Add hooks and additional fields in vm_struct and track structs
to store and report additional information for slab memory leak
debugging.

Bug: 184928480

Change-Id: I6897a6a98d4eaaea492673cefd4111a7ba741940
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
This commit is contained in:
Liujie Xie
2021-05-11 19:05:32 +08:00
committed by Todd Kjos
parent 70094f39c7
commit 8bc6337823
6 changed files with 23 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ struct kmem_cache {
#include <linux/kmemleak.h>
#include <linux/random.h>
#include <linux/sched/mm.h>
#include <linux/android_vendor.h>
/*
* State of the slab allocator.
@@ -104,6 +105,9 @@ struct track {
int cpu; /* Was running on cpu */
int pid; /* Pid context */
unsigned long when; /* When did the operation occur */
#ifdef CONFIG_STACKTRACE
ANDROID_OEM_DATA(1);
#endif
};
enum track_item { TRACK_ALLOC, TRACK_FREE };