diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-03-25 18:58:57 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-26 03:52:58 -0400 |
commit | b177f63f5226e75280855bbcd106e677250778bd (patch) | |
tree | 6d53e57b95b2115de458172aa3a3ee6fab6e9cd3 /tools/perf/util/map.c | |
parent | d5679ae4d2d4369477dc3b60027cca222aef33e9 (diff) |
perf symbols: Pass the mmap parameters instead of using mmap_event
To reduce the coupling of the symbol system with the rest of
perf.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1269557941-15617-2-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r-- | tools/perf/util/map.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index e509cd59c67..a9b42273675 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -1,4 +1,3 @@ | |||
1 | #include "event.h" | ||
2 | #include "symbol.h" | 1 | #include "symbol.h" |
3 | #include <stdlib.h> | 2 | #include <stdlib.h> |
4 | #include <string.h> | 3 | #include <string.h> |
@@ -38,13 +37,12 @@ void map__init(struct map *self, enum map_type type, | |||
38 | RB_CLEAR_NODE(&self->rb_node); | 37 | RB_CLEAR_NODE(&self->rb_node); |
39 | } | 38 | } |
40 | 39 | ||
41 | struct map *map__new(struct mmap_event *event, enum map_type type, | 40 | struct map *map__new(u64 start, u64 len, u64 pgoff, u32 pid, char *filename, |
42 | char *cwd, int cwdlen) | 41 | enum map_type type, char *cwd, int cwdlen) |
43 | { | 42 | { |
44 | struct map *self = malloc(sizeof(*self)); | 43 | struct map *self = malloc(sizeof(*self)); |
45 | 44 | ||
46 | if (self != NULL) { | 45 | if (self != NULL) { |
47 | const char *filename = event->filename; | ||
48 | char newfilename[PATH_MAX]; | 46 | char newfilename[PATH_MAX]; |
49 | struct dso *dso; | 47 | struct dso *dso; |
50 | int anon; | 48 | int anon; |
@@ -62,7 +60,7 @@ struct map *map__new(struct mmap_event *event, enum map_type type, | |||
62 | anon = is_anon_memory(filename); | 60 | anon = is_anon_memory(filename); |
63 | 61 | ||
64 | if (anon) { | 62 | if (anon) { |
65 | snprintf(newfilename, sizeof(newfilename), "/tmp/perf-%d.map", event->pid); | 63 | snprintf(newfilename, sizeof(newfilename), "/tmp/perf-%d.map", pid); |
66 | filename = newfilename; | 64 | filename = newfilename; |
67 | } | 65 | } |
68 | 66 | ||
@@ -70,8 +68,7 @@ struct map *map__new(struct mmap_event *event, enum map_type type, | |||
70 | if (dso == NULL) | 68 | if (dso == NULL) |
71 | goto out_delete; | 69 | goto out_delete; |
72 | 70 | ||
73 | map__init(self, type, event->start, event->start + event->len, | 71 | map__init(self, type, start, start + len, pgoff, dso); |
74 | event->pgoff, dso); | ||
75 | 72 | ||
76 | if (anon) { | 73 | if (anon) { |
77 | set_identity: | 74 | set_identity: |