Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323657
b: refs/heads/master
c: e5a1845
h: refs/heads/master
i:
  323655: eb24ee3
v: v3
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Aug 9, 2012
1 parent 9fa8973 commit a6fade3
Show file tree
Hide file tree
Showing 7 changed files with 818 additions and 798 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: 166ccc9c244828da9214a0e7ba4d5dde6a26dcc1
refs/heads/master: e5a1845fc0aeca85c98115980c3531129f87e18d
1 change: 1 addition & 0 deletions trunk/tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ LIB_OBJS += $(OUTPUT)util/usage.o
LIB_OBJS += $(OUTPUT)util/wrapper.o
LIB_OBJS += $(OUTPUT)util/sigchain.o
LIB_OBJS += $(OUTPUT)util/symbol.o
LIB_OBJS += $(OUTPUT)util/symbol-elf.o
LIB_OBJS += $(OUTPUT)util/dso-test-data.o
LIB_OBJS += $(OUTPUT)util/color.o
LIB_OBJS += $(OUTPUT)util/pager.o
Expand Down
19 changes: 19 additions & 0 deletions trunk/tools/perf/util/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,25 @@ struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
return NULL;
}

/*
* Constructor variant for modules (where we know from /proc/modules where
* they are loaded) and for vmlinux, where only after we load all the
* symbols we'll know where it starts and ends.
*/
struct map *map__new2(u64 start, struct dso *dso, enum map_type type)
{
struct map *map = calloc(1, (sizeof(*map) +
(dso->kernel ? sizeof(struct kmap) : 0)));
if (map != NULL) {
/*
* ->end will be filled after we load all the symbols
*/
map__init(map, type, start, 0, 0, dso);
}

return map;
}

void map__delete(struct map *self)
{
free(self);
Expand Down
1 change: 1 addition & 0 deletions trunk/tools/perf/util/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ void map__init(struct map *self, enum map_type type,
struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
u64 pgoff, u32 pid, char *filename,
enum map_type type);
struct map *map__new2(u64 start, struct dso *dso, enum map_type type);
void map__delete(struct map *self);
struct map *map__clone(struct map *self);
int map__overlap(struct map *l, struct map *r);
Expand Down
Loading

0 comments on commit a6fade3

Please sign in to comment.