aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-03-25 19:58:57 -0300
committerIngo Molnar <mingo@elte.hu>2010-03-26 08:52:58 +0100
commitb177f63f5226e75280855bbcd106e677250778bd (patch)
tree6d53e57b95b2115de458172aa3a3ee6fab6e9cd3 /tools/perf/util/map.c
parentperf report: Pass the DSO to 'perf annotate' (diff)
downloadlinux-dev-b177f63f5226e75280855bbcd106e677250778bd.tar.xz
linux-dev-b177f63f5226e75280855bbcd106e677250778bd.zip
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.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index e509cd59c67d..a9b42273675d 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -1,4 +1,3 @@
-#include "event.h"
#include "symbol.h"
#include <stdlib.h>
#include <string.h>
@@ -38,13 +37,12 @@ void map__init(struct map *self, enum map_type type,
RB_CLEAR_NODE(&self->rb_node);
}
-struct map *map__new(struct mmap_event *event, enum map_type type,
- char *cwd, int cwdlen)
+struct map *map__new(u64 start, u64 len, u64 pgoff, u32 pid, char *filename,
+ enum map_type type, char *cwd, int cwdlen)
{
struct map *self = malloc(sizeof(*self));
if (self != NULL) {
- const char *filename = event->filename;
char newfilename[PATH_MAX];
struct dso *dso;
int anon;
@@ -62,7 +60,7 @@ struct map *map__new(struct mmap_event *event, enum map_type type,
anon = is_anon_memory(filename);
if (anon) {
- snprintf(newfilename, sizeof(newfilename), "/tmp/perf-%d.map", event->pid);
+ snprintf(newfilename, sizeof(newfilename), "/tmp/perf-%d.map", pid);
filename = newfilename;
}
@@ -70,8 +68,7 @@ struct map *map__new(struct mmap_event *event, enum map_type type,
if (dso == NULL)
goto out_delete;
- map__init(self, type, event->start, event->start + event->len,
- event->pgoff, dso);
+ map__init(self, type, start, start + len, pgoff, dso);
if (anon) {
set_identity: