diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mmap.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mempolicy.h> | 28 | #include <linux/mempolicy.h> |
29 | #include <linux/rmap.h> | 29 | #include <linux/rmap.h> |
30 | #include <linux/mmu_notifier.h> | 30 | #include <linux/mmu_notifier.h> |
31 | #include <linux/perf_counter.h> | ||
31 | 32 | ||
32 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
33 | #include <asm/cacheflush.h> | 34 | #include <asm/cacheflush.h> |
@@ -1219,6 +1220,9 @@ munmap_back: | |||
1219 | if (correct_wcount) | 1220 | if (correct_wcount) |
1220 | atomic_inc(&inode->i_writecount); | 1221 | atomic_inc(&inode->i_writecount); |
1221 | out: | 1222 | out: |
1223 | if (vm_flags & VM_EXEC) | ||
1224 | perf_counter_mmap(addr, len, pgoff, file); | ||
1225 | |||
1222 | mm->total_vm += len >> PAGE_SHIFT; | 1226 | mm->total_vm += len >> PAGE_SHIFT; |
1223 | vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT); | 1227 | vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT); |
1224 | if (vm_flags & VM_LOCKED) { | 1228 | if (vm_flags & VM_LOCKED) { |
@@ -1752,6 +1756,12 @@ static void remove_vma_list(struct mm_struct *mm, struct vm_area_struct *vma) | |||
1752 | do { | 1756 | do { |
1753 | long nrpages = vma_pages(vma); | 1757 | long nrpages = vma_pages(vma); |
1754 | 1758 | ||
1759 | if (vma->vm_flags & VM_EXEC) { | ||
1760 | perf_counter_munmap(vma->vm_start, | ||
1761 | nrpages << PAGE_SHIFT, | ||
1762 | vma->vm_pgoff, vma->vm_file); | ||
1763 | } | ||
1764 | |||
1755 | mm->total_vm -= nrpages; | 1765 | mm->total_vm -= nrpages; |
1756 | vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages); | 1766 | vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages); |
1757 | vma = remove_vma(vma); | 1767 | vma = remove_vma(vma); |