All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tools: Synthesize anon MMAP records on the heap
@ 2014-01-12  4:32 Gaurav Jain
  2014-01-13  8:59 ` Namhyung Kim
  2014-01-13 16:54 ` Don Zickus
  0 siblings, 2 replies; 10+ messages in thread
From: Gaurav Jain @ 2014-01-12  4:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Gaurav Jain, Ingo Molnar, Jiri Olsa, Paul Mackerras,
	Peter Zijlstra, Don Zickus, Arun Sharma

Anon records usually do not have the 'execname' entry. However if they are on
the heap, the execname shows up as '[heap]'. The fix considers any executable
entries in the map that do not have a name or are on the heap as anon records
and sets the name to '//anon'.

This fixes JIT profiling for records on the heap.

Signed-off-by: Gaurav Jain <gjain@fb.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Arun Sharma <asharma@fb.com>
---
 tools/perf/util/event.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index bb788c1..ae9c55b 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -224,10 +224,9 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
 				continue;
 
 			event->header.misc |= PERF_RECORD_MISC_MMAP_DATA;
-		}
-
-		if (!strcmp(execname, ""))
+		} if (!strcmp(execname, "") || !strcmp(execname, "[heap]")) {
 			strcpy(execname, anonstr);
+		}
 
 		size = strlen(execname) + 1;
 		memcpy(event->mmap.filename, execname, size);
-- 
1.8.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-01-16  2:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-12  4:32 [PATCH] perf tools: Synthesize anon MMAP records on the heap Gaurav Jain
2014-01-13  8:59 ` Namhyung Kim
2014-01-13 16:54 ` Don Zickus
2014-01-14 20:48   ` Gaurav Jain
2014-01-15  5:46     ` Namhyung Kim
2014-01-15  6:44       ` Gaurav Jain
2014-01-16  1:01         ` Namhyung Kim
2014-01-16  2:40           ` Gaurav Jain
2014-01-15 14:27     ` Don Zickus
2014-01-16  1:03       ` Namhyung Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.