Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182442
b: refs/heads/master
c: 8d92c02
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Feb 4, 2010
1 parent 30f4689 commit 187307b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 25 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: 6275ce2d5f44ae4f8575c24724525cbb2a3a141b
refs/heads/master: 8d92c02ab07602786eaa6d4e5b519395730b3fd3
7 changes: 6 additions & 1 deletion trunk/tools/perf/util/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ struct map *map__new(struct mmap_event *event, enum map_type type,
map__init(self, type, event->start, event->start + event->len,
event->pgoff, dso);

if (self->dso == vdso || anon)
if (anon) {
set_identity:
self->map_ip = self->unmap_ip = identity__map_ip;
} else if (strcmp(filename, "[vdso]") == 0) {
dso__set_loaded(dso, self->type);
goto set_identity;
}
}
return self;
out_delete:
Expand Down
26 changes: 4 additions & 22 deletions trunk/tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ bool dso__sorted_by_name(const struct dso *self, enum map_type type)
return self->sorted_by_name & (1 << type);
}

static void dso__set_loaded(struct dso *self, enum map_type type)
{
self->loaded |= (1 << type);
}

static void dso__set_sorted_by_name(struct dso *self, enum map_type type)
{
self->sorted_by_name |= (1 << type);
Expand Down Expand Up @@ -1697,7 +1692,6 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,

LIST_HEAD(dsos__user);
LIST_HEAD(dsos__kernel);
struct dso *vdso;

static void dsos__add(struct list_head *head, struct dso *dso)
{
Expand Down Expand Up @@ -1790,24 +1784,12 @@ static struct dso *dsos__create_kernel(const char *vmlinux)
{
struct dso *kernel = dso__new_kernel(vmlinux);

if (kernel == NULL)
return NULL;

vdso = dso__new("[vdso]");
if (vdso == NULL)
goto out_delete_kernel_dso;
dso__set_loaded(vdso, MAP__FUNCTION);

dso__read_running_kernel_build_id(kernel);

dsos__add(&dsos__kernel, kernel);
dsos__add(&dsos__user, vdso);
if (kernel != NULL) {
dso__read_running_kernel_build_id(kernel);
dsos__add(&dsos__kernel, kernel);
}

return kernel;

out_delete_kernel_dso:
dso__delete(kernel);
return NULL;
}

int __map_groups__create_kernel_maps(struct map_groups *self,
Expand Down
6 changes: 5 additions & 1 deletion trunk/tools/perf/util/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ void dso__delete(struct dso *self);
bool dso__loaded(const struct dso *self, enum map_type type);
bool dso__sorted_by_name(const struct dso *self, enum map_type type);

static inline void dso__set_loaded(struct dso *self, enum map_type type)
{
self->loaded |= (1 << type);
}

void dso__sort_by_name(struct dso *self, enum map_type type);

extern struct list_head dsos__user, dsos__kernel;
Expand Down Expand Up @@ -161,5 +166,4 @@ int kallsyms__parse(const char *filename, void *arg,
int symbol__init(void);
bool symbol_type__is_a(char symbol_type, enum map_type map_type);

extern struct dso *vdso;
#endif /* __PERF_SYMBOL */

0 comments on commit 187307b

Please sign in to comment.