ANDROID: vendor_hooks: Add hook in try_to_unmap_one()

Add hook in try_to_unmap_one() to trace this function for debug memory
swap bugs.

Bug: 198385827
Change-Id: I1fdbe60e09bb491b949e06a07133710453ecca03
Signed-off-by: Jiewen Wang <jiewen.wang@vivo.com>
This commit is contained in:
Jiewen Wang
2021-09-06 16:55:03 +08:00
parent 878e0caa77
commit 955f917251
3 changed files with 7 additions and 0 deletions

View File

@@ -382,3 +382,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_tcp_recvmsg_stat);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pci_d3_sleep);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_kmalloc_slab);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmap_region);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_try_to_unmap_one);

View File

@@ -123,6 +123,9 @@ DECLARE_HOOK(android_vh_kmalloc_slab,
DECLARE_HOOK(android_vh_mmap_region,
TP_PROTO(struct vm_area_struct *vma, unsigned long addr),
TP_ARGS(vma, addr));
DECLARE_HOOK(android_vh_try_to_unmap_one,
TP_PROTO(struct vm_area_struct *vma, struct page *page, unsigned long addr, bool ret),
TP_ARGS(vma, page, addr, ret));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_MM_H */

View File

@@ -77,6 +77,8 @@
#include <trace/events/tlb.h>
#include <trace/hooks/mm.h>
#include "internal.h"
static struct kmem_cache *anon_vma_cachep;
@@ -1706,6 +1708,7 @@ discard:
}
mmu_notifier_invalidate_range_end(&range);
trace_android_vh_try_to_unmap_one(vma, page, address, ret);
return ret;
}