Skip to contentSkip to conversation

perf kmem: Do not ignore mmap events

PATCH Applied Namhyung Kim 3 participants 3 messages Aug 1, 2014 – Aug 13, 2014 perf events

lore
Share & tools
lore

Namhyung Kim

author maintainer
#0 lore raw

PATCH 1/1 perf kmem: Do not ignore mmap events

The perf kmem command didn't process mmap events for some unknown reason and it instead gets symbol info from a running kernel. This is problematic if perf kmem record was run on a different kernel.

This patch adds the mmap event handlers and reverts the commit e727ca73f85d ("perf kmem: Resolve kernel symbols again").

---
 tools/perf/builtin-kmem.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
tools/perf/builtin-kmem.c +2 -3
index bef3376bfaf3..baaaab52f94b 100644
@@ -256,6 +256,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
 static struct perf_tool perf_kmem = {
 	.sample		 = process_sample_event,
 	.comm		 = perf_event__process_comm,
+	.mmap		 = perf_event__process_mmap,
+	.mmap2		 = perf_event__process_mmap2,
 	.ordered_samples = true,
 };
 
@@ -424,9 +426,6 @@ static int __cmd_kmem(void)
 	if (session == NULL)
 		return -ENOMEM;
 
-	if (perf_session__create_kernel_maps(session) < 0)
-		goto out_delete;
-
 	if (!perf_session__has_traces(session, "kmem record"))
 		goto out_delete;
 
Signature · 1 line
2.0.0
maintainer Applied
#1 lore raw

Em Fri, Aug 01, 2014 at 02:59:31PM +0900, Namhyung Kim escreveu:

Quoted 8 lines

The perf kmem command didn't process mmap events for some unknown reason and it instead gets symbol info from a running kernel. This is problematic if perf kmem record was run on a different kernel.

This patch adds the mmap event handlers and reverts the commit e727ca73f85d ("perf kmem: Resolve kernel symbols again").

Thanks, applied.

- Arnaldo

#2 lore raw
In reply to Namhyung Kim
perf kmem: Do not ignore mmap events
Commit-ID:  64c40908938953d7afa90e9363327875286349e5
Gitweb:     http://git.kernel.org/tip/64c40908938953d7afa90e9363327875286349e5
Author:     Namhyung Kim <[email protected]>
AuthorDate: Fri, 1 Aug 2014 14:59:31 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 12 Aug 2014 12:03:03 -0300

perf kmem: Do not ignore mmap events

The perf kmem command didn't process mmap events for some unknown reason and it instead gets symbol info from a running kernel. This is problematic if perf kmem record was run on a different kernel.

This patch adds the mmap event handlers and reverts the commit e727ca73f85d ("perf kmem: Resolve kernel symbols again").

Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
[ Fixed up merge conflict with Jiri's ordered_events rename patch set ]
---
 tools/perf/builtin-kmem.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
tools/perf/builtin-kmem.c +2 -3
index b572111..84b8239 100644
@@ -256,6 +256,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
 static struct perf_tool perf_kmem = {
 	.sample		 = process_sample_event,
 	.comm		 = perf_event__process_comm,
+	.mmap		 = perf_event__process_mmap,
+	.mmap2		 = perf_event__process_mmap2,
 	.ordered_events	 = true,
 };
 
@@ -424,9 +426,6 @@ static int __cmd_kmem(void)
 	if (session == NULL)
 		return -ENOMEM;
 
-	if (perf_session__create_kernel_maps(session) < 0)
-		goto out_delete;
-
 	if (!perf_session__has_traces(session, "kmem record"))
 		goto out_delete;