From: Peter Zijlstra Date: Mon, 8 Jun 2009 18:11:57 +0000 (+0300) Subject: perf_counter: Add mmap event hooks to mprotect() X-Git-Tag: accepted/tizen/common/20141203.182822~15808^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dab5855b12411334355ba21349a06700e4ae7a3b;p=platform%2Fkernel%2Flinux-arm64.git perf_counter: Add mmap event hooks to mprotect() Some JIT compilers allocate memory for generated code with posix_memalign() + mprotect() so we need to hook into mprotect() to make sure 'perf' is aware that we're executing code in anonymous memory. [ penberg@cs.helsinki.fi: move the hook to sys_mprotect() ] Cc: Arnaldo Carvalho de Melo Signed-off-by: Pekka Enberg LKML-Reference: Signed-off-by: Ingo Molnar --- diff --git a/mm/mprotect.c b/mm/mprotect.c index 258197b..d80311b 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -299,6 +300,7 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, error = mprotect_fixup(vma, &prev, nstart, tmp, newflags); if (error) goto out; + perf_counter_mmap(vma); nstart = tmp; if (nstart < prev->vm_end)