diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index c8fff702774..a5f3ffe9f71 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -57,6 +57,8 @@ #include <linux/swapops.h> #include <linux/elf.h> #include <linux/gfp.h> +#include <trace/swap.h> +#include <trace/fault.h> #include <asm/io.h> #include <asm/pgalloc.h> @@ -67,6 +69,10 @@ #include "internal.h" +DEFINE_TRACE(swap_in); +DEFINE_TRACE(page_fault_get_user_entry); +DEFINE_TRACE(page_fault_get_user_exit); + #ifndef CONFIG_NEED_MULTIPLE_NODES /* use the per-pgdat data instead for discontigmem - mbligh */ unsigned long max_mapnr; @@ -1517,6 +1523,9 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, int ret; unsigned int fault_flags = 0; + trace_page_fault_get_user_entry(mm, + vma, start, foll_flags & FOLL_WRITE); + /* For mlock, just skip the stack guard page. */ if (foll_flags & FOLL_MLOCK) { if (stack_guard_page(vma, start)) @@ -1529,6 +1538,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, ret = handle_mm_fault(mm, vma, start, fault_flags); + trace_page_fault_get_user_exit(ret); if (ret & VM_FAULT_ERROR) { if (ret & VM_FAULT_OOM) @@ -2754,6 +2764,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, /* Had to read the page from swap area: Major fault */ ret = VM_FAULT_MAJOR; count_vm_event(PGMAJFAULT); + trace_swap_in(page, entry); } else if (PageHWPoison(page)) { /* * hwpoisoned dirty swapcache pages are kept for killing |