summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-25 11:12:23 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-25 11:12:23 -0800
commit82c477669a4665eb4e52030792051e0559ee2a36 (patch)
tree02542b4e7d33f157aac83f0dadc988c5d4511544 /tools/perf/util/map.c
parentf6d13daaddeb6e63b15a93bf36a80173bafd29bf (diff)
parent993e5ee67a90c7b6a5dbb61b9c31df2955afff46 (diff)
downloadlinux-82c477669a4665eb4e52030792051e0559ee2a36.tar.bz2
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar: "A handful of tooling fixes" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf symbols: Load map before using map->map_ip() perf tools: Fix traceevent plugin path definitions perf symbols: Fix JIT symbol resolution on heap perf stat: Fix memory corruption of xyarray when cpumask is used perf evsel: Remove duplicate member zeroing after free perf tools: Ensure sscanf does not overrun the "mem" field perf stat: fix NULL pointer reference bug with event unit perf tools: Add support for the xtensa architecture perf session: Free cpu_map in perf_session__cpu_bitmap perf timechart: Fix wrong SVG height
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r--tools/perf/util/map.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 9b9bd719aa19..3b97513f0e77 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -69,7 +69,7 @@ struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
map->ino = ino;
map->ino_generation = ino_gen;
- if (anon) {
+ if ((anon || no_dso) && type == MAP__FUNCTION) {
snprintf(newfilename, sizeof(newfilename), "/tmp/perf-%d.map", pid);
filename = newfilename;
}
@@ -93,7 +93,7 @@ struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
* functions still return NULL, and we avoid the
* unnecessary map__load warning.
*/
- if (no_dso)
+ if (type != MAP__FUNCTION)
dso__set_loaded(dso, map->type);
}
}
@@ -386,7 +386,8 @@ struct symbol *map_groups__find_symbol(struct map_groups *mg,
{
struct map *map = map_groups__find(mg, type, addr);
- if (map != NULL) {
+ /* Ensure map is loaded before using map->map_ip */
+ if (map != NULL && map__load(map, filter) >= 0) {
if (mapp != NULL)
*mapp = map;
return map__find_symbol(map, map->map_ip(map, addr), filter);