Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269025
b: refs/heads/master
c: 87ffef7
h: refs/heads/master
i:
  269023: 7b286e7
v: v3
  • Loading branch information
Jiri Olsa authored and Arnaldo Carvalho de Melo committed Sep 29, 2011
1 parent f07c588 commit d06b1a1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e78cb3628b343b7b69d8f3632aabef74669ffa25
refs/heads/master: 87ffef79ab7562ca4a1f6f22ed7ddef1c434bc24
24 changes: 18 additions & 6 deletions trunk/tools/perf/util/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ static inline int is_anon_memory(const char *filename)
return strcmp(filename, "//anon") == 0;
}

static inline int is_no_dso_memory(const char *filename)
{
return !strcmp(filename, "[stack]") ||
!strcmp(filename, "[vdso]") ||
!strcmp(filename, "[heap]");
}

void map__init(struct map *self, enum map_type type,
u64 start, u64 end, u64 pgoff, struct dso *dso)
{
Expand All @@ -42,9 +49,10 @@ struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
if (self != NULL) {
char newfilename[PATH_MAX];
struct dso *dso;
int anon;
int anon, no_dso;

anon = is_anon_memory(filename);
no_dso = is_no_dso_memory(filename);

if (anon) {
snprintf(newfilename, sizeof(newfilename), "/tmp/perf-%d.map", pid);
Expand All @@ -57,12 +65,16 @@ struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,

map__init(self, type, start, start + len, pgoff, dso);

if (anon) {
set_identity:
if (anon || no_dso) {
self->map_ip = self->unmap_ip = identity__map_ip;
} else if (strcmp(filename, "[vdso]") == 0) {
dso__set_loaded(dso, self->type);
goto set_identity;

/*
* Set memory without DSO as loaded. All map__find_*
* functions still return NULL, and we avoid the
* unnecessary map__load warning.
*/
if (no_dso)
dso__set_loaded(dso, self->type);
}
}
return self;
Expand Down

0 comments on commit d06b1a1

Please sign in to comment.