* [PATCH 1/2] perf_counter: Add mmap event hooks to mprotect()
@ 2009-06-08 18:11 Pekka J Enberg
2009-06-08 21:33 ` [tip:perfcounters/core] " tip-bot for Peter Zijlstra
0 siblings, 1 reply; 2+ messages in thread
From: Pekka J Enberg @ 2009-06-08 18:11 UTC (permalink / raw)
To: mingo; +Cc: linux-kernel, a.p.zijlstra, acme
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
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 <acme@redhat.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
mm/mprotect.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
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 <linux/swapops.h>
#include <linux/mmu_notifier.h>
#include <linux/migrate.h>
+#include <linux/perf_counter.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/cacheflush.h>
@@ -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)
--
1.5.6.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tip:perfcounters/core] perf_counter: Add mmap event hooks to mprotect()
2009-06-08 18:11 [PATCH 1/2] perf_counter: Add mmap event hooks to mprotect() Pekka J Enberg
@ 2009-06-08 21:33 ` tip-bot for Peter Zijlstra
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Peter Zijlstra @ 2009-06-08 21:33 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, acme, hpa, mingo, penberg, a.p.zijlstra, tglx, mingo
Commit-ID: dab5855b12411334355ba21349a06700e4ae7a3b
Gitweb: http://git.kernel.org/tip/dab5855b12411334355ba21349a06700e4ae7a3b
Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Mon, 8 Jun 2009 21:11:57 +0300
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 8 Jun 2009 23:10:43 +0200
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 <acme@redhat.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
LKML-Reference: <Pine.LNX.4.64.0906082111030.12407@melkki.cs.Helsinki.FI>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
mm/mprotect.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
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 <linux/swapops.h>
#include <linux/mmu_notifier.h>
#include <linux/migrate.h>
+#include <linux/perf_counter.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/cacheflush.h>
@@ -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)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-08 21:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-08 18:11 [PATCH 1/2] perf_counter: Add mmap event hooks to mprotect() Pekka J Enberg
2009-06-08 21:33 ` [tip:perfcounters/core] " tip-bot for Peter Zijlstra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®