2009-07-16 10:54:46

by Anton Blanchard

[permalink] [raw]
Subject: [patch 2/5] perf_counter: Synthesize VDSO mmap event

perf record synthesizes mmap events for the running process. Right now
it just catches file mappings, but we can check for the vdso symbol
and add that too.

Signed-off-by: Anton Blanchard <[email protected]>
---

Only tested on PowerPC, but I assume x86 has the same issue.

Index: linux.trees.git/tools/perf/builtin-record.c
===================================================================
--- linux.trees.git.orig/tools/perf/builtin-record.c 2009-07-13 12:33:49.000000000 +1000
+++ linux.trees.git/tools/perf/builtin-record.c 2009-07-13 13:25:00.000000000 +1000
@@ -313,6 +313,10 @@
if (*pbf == 'x') { /* vm_exec */
char *execname = strchr(bf, '/');

+ /* Catch VDSO */
+ if (execname == NULL)
+ execname = strstr(bf, "[vdso]");
+
if (execname == NULL)
continue;


--


2009-07-18 09:50:53

by Anton Blanchard

[permalink] [raw]
Subject: [tip:perfcounters/urgent] perf_counter: Synthesize VDSO mmap event

Commit-ID: 11b5f81e1b0ea0bc84fe32f0a27054e052b2bf84
Gitweb: http://git.kernel.org/tip/11b5f81e1b0ea0bc84fe32f0a27054e052b2bf84
Author: Anton Blanchard <[email protected]>
AuthorDate: Thu, 16 Jul 2009 15:44:29 +0200
Committer: Ingo Molnar <[email protected]>
CommitDate: Sat, 18 Jul 2009 11:21:30 +0200

perf_counter: Synthesize VDSO mmap event

perf record synthesizes mmap events for the running process.
Right now it just catches file mappings, but we can check for
the vdso symbol and add that too.

Signed-off-by: Anton Blanchard <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>


---
tools/perf/builtin-record.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 4ef78a5..072aaf0 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -313,6 +313,10 @@ static void pid_synthesize_mmap_samples(pid_t pid)
if (*pbf == 'x') { /* vm_exec */
char *execname = strchr(bf, '/');

+ /* Catch VDSO */
+ if (execname == NULL)
+ execname = strstr(bf, "[vdso]");
+
if (execname == NULL)
continue;