Skip to content

Commit 578c03c

Browse files
namhyungacmel
authored andcommitted
perf symbols: Fix JIT symbol resolution on heap
Gaurav reported that perf cannot profile JIT program if it executes the code on heap. This was because current map__new() only handle JIT on anon mappings - extends it to handle no_dso (heap, stack) case too. This patch assumes JIT profiling only provides dynamic function symbols so check the mapping type to distinguish the case. It'd provide no symbols for data mapping - if we need to support symbols on data mappings later it should be changed. Reported-by: Gaurav Jain <[email protected]> Signed-off-by: Namhyung Kim <[email protected]> Tested-by: Gaurav Jain <[email protected]> Cc: Andi Kleen <[email protected]> Cc: David Ahern <[email protected]> Cc: Gaurav Jain <[email protected]> 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]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 8ad9219 commit 578c03c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/perf/util/map.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
6969
map->ino = ino;
7070
map->ino_generation = ino_gen;
7171

72-
if (anon) {
72+
if ((anon || no_dso) && type == MAP__FUNCTION) {
7373
snprintf(newfilename, sizeof(newfilename), "/tmp/perf-%d.map", pid);
7474
filename = newfilename;
7575
}
@@ -93,7 +93,7 @@ struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
9393
* functions still return NULL, and we avoid the
9494
* unnecessary map__load warning.
9595
*/
96-
if (no_dso)
96+
if (type != MAP__FUNCTION)
9797
dso__set_loaded(dso, map->type);
9898
}
9999
}

0 commit comments

Comments
 (0)