diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index ab0cad1ce365..956e8594bf3d 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -408,6 +408,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_node_memcgs); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ra_tuning_max_page); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_memcg_scan_type); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cow_user_page); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_swapin_add_anon_rmap); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_isolated_for_reclaim); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_inactive_is_low); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snapshot_refaults); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 68999767a530..6b4d778ad2de 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -152,6 +152,9 @@ DECLARE_HOOK(android_vh_ra_tuning_max_page, DECLARE_HOOK(android_vh_cow_user_page, TP_PROTO(struct vm_fault *vmf, struct page *page), TP_ARGS(vmf, page)); +DECLARE_HOOK(android_vh_swapin_add_anon_rmap, + TP_PROTO(struct vm_fault *vmf, struct page *page), + TP_ARGS(vmf, page)); DECLARE_HOOK(android_vh_page_isolated_for_reclaim, TP_PROTO(struct mm_struct *mm, struct page *page), TP_ARGS(mm, page)); diff --git a/mm/memory.c b/mm/memory.c index df32008d7c16..6ba58a781626 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3784,6 +3784,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf) do_page_add_anon_rmap(page, vma, vmf->address, exclusive); } + trace_android_vh_swapin_add_anon_rmap(vmf, page); swap_free(entry); if (mem_cgroup_swap_full(page) || (vmf->vma_flags & VM_LOCKED) || PageMlocked(page))