ANDROID: Fix lost track action type in save_track_hash

Transmit the track action type to save_track_hash, otherwise we do not know it is allocation stack or free stack.

Fixes: 8bc6337823 ("ANDROID: vendor_hooks: add hooks for slab memory leak debugging")
Bug: 184928480
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I74c50c02cfb4ebbf3e9fecdf125e76946ff4e7d1
This commit is contained in:
Liujie Xie 2021-06-24 10:10:14 +08:00 committed by Suren Baghdasaryan
parent 06d75deb06
commit 7d216e2512
2 changed files with 4 additions and 3 deletions

View File

@ -95,8 +95,8 @@ DECLARE_HOOK(android_vh_show_stack_hash,
TP_PROTO(struct seq_file *m, struct vm_struct *v),
TP_ARGS(m, v));
DECLARE_HOOK(android_vh_save_track_hash,
TP_PROTO(unsigned long p),
TP_ARGS(p));
TP_PROTO(bool alloc, unsigned long p),
TP_ARGS(alloc, p));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_MM_H */

View File

@ -618,7 +618,8 @@ static void set_track(struct kmem_cache *s, void *object,
if (nr_entries < TRACK_ADDRS_COUNT)
p->addrs[nr_entries] = 0;
trace_android_vh_save_track_hash((unsigned long)p);
trace_android_vh_save_track_hash(alloc == TRACK_ALLOC,
(unsigned long)p);
#endif
p->addr = addr;
p->cpu = smp_processor_id();