aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2014-07-22 09:18:00 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-07-23 16:37:26 -0400
commit5835eddab6f162b38e9a6a5447a2c3a128637956 (patch)
tree14c0f8417c2bcb1beb04dd7a98f6e097216aa43d
parent2b5b8bb27b9ec899cfba686dabec113ea0d4cbda (diff)
perf tools: Add thread parameter to vdso__dso_findnew()
The thread will be needed to determine the VDSO type. Reviewed-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1406035081-14301-52-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/machine.c4
-rw-r--r--tools/perf/util/map.c4
-rw-r--r--tools/perf/util/map.h3
-rw-r--r--tools/perf/util/vdso.c3
-rw-r--r--tools/perf/util/vdso.h3
5 files changed, 10 insertions, 7 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 65269b8ac186..16bba9fff2c8 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1106,7 +1106,7 @@ int machine__process_mmap2_event(struct machine *machine,
1106 event->mmap2.ino_generation, 1106 event->mmap2.ino_generation,
1107 event->mmap2.prot, 1107 event->mmap2.prot,
1108 event->mmap2.flags, 1108 event->mmap2.flags,
1109 event->mmap2.filename, type); 1109 event->mmap2.filename, type, thread);
1110 1110
1111 if (map == NULL) 1111 if (map == NULL)
1112 goto out_problem; 1112 goto out_problem;
@@ -1153,7 +1153,7 @@ int machine__process_mmap_event(struct machine *machine, union perf_event *event
1153 event->mmap.len, event->mmap.pgoff, 1153 event->mmap.len, event->mmap.pgoff,
1154 event->mmap.pid, 0, 0, 0, 0, 0, 0, 1154 event->mmap.pid, 0, 0, 0, 0, 0, 0,
1155 event->mmap.filename, 1155 event->mmap.filename,
1156 type); 1156 type, thread);
1157 1157
1158 if (map == NULL) 1158 if (map == NULL)
1159 goto out_problem; 1159 goto out_problem;
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index dffc8dce6046..31b8905dd863 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -141,7 +141,7 @@ void map__init(struct map *map, enum map_type type,
141struct map *map__new(struct machine *machine, u64 start, u64 len, 141struct map *map__new(struct machine *machine, u64 start, u64 len,
142 u64 pgoff, u32 pid, u32 d_maj, u32 d_min, u64 ino, 142 u64 pgoff, u32 pid, u32 d_maj, u32 d_min, u64 ino,
143 u64 ino_gen, u32 prot, u32 flags, char *filename, 143 u64 ino_gen, u32 prot, u32 flags, char *filename,
144 enum map_type type) 144 enum map_type type, struct thread *thread)
145{ 145{
146 struct map *map = malloc(sizeof(*map)); 146 struct map *map = malloc(sizeof(*map));
147 147
@@ -174,7 +174,7 @@ struct map *map__new(struct machine *machine, u64 start, u64 len,
174 174
175 if (vdso) { 175 if (vdso) {
176 pgoff = 0; 176 pgoff = 0;
177 dso = vdso__dso_findnew(machine); 177 dso = vdso__dso_findnew(machine, thread);
178 } else 178 } else
179 dso = __dsos__findnew(&machine->user_dsos, filename); 179 dso = __dsos__findnew(&machine->user_dsos, filename);
180 180
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index a95e677f16e9..2f83954af050 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -104,6 +104,7 @@ u64 map__rip_2objdump(struct map *map, u64 rip);
104u64 map__objdump_2mem(struct map *map, u64 ip); 104u64 map__objdump_2mem(struct map *map, u64 ip);
105 105
106struct symbol; 106struct symbol;
107struct thread;
107 108
108/* map__for_each_symbol - iterate over the symbols in the given map 109/* map__for_each_symbol - iterate over the symbols in the given map
109 * 110 *
@@ -122,7 +123,7 @@ void map__init(struct map *map, enum map_type type,
122struct map *map__new(struct machine *machine, u64 start, u64 len, 123struct map *map__new(struct machine *machine, u64 start, u64 len,
123 u64 pgoff, u32 pid, u32 d_maj, u32 d_min, u64 ino, 124 u64 pgoff, u32 pid, u32 d_maj, u32 d_min, u64 ino,
124 u64 ino_gen, u32 prot, u32 flags, 125 u64 ino_gen, u32 prot, u32 flags,
125 char *filename, enum map_type type); 126 char *filename, enum map_type type, struct thread *thread);
126struct map *map__new2(u64 start, struct dso *dso, enum map_type type); 127struct map *map__new2(u64 start, struct dso *dso, enum map_type type);
127void map__delete(struct map *map); 128void map__delete(struct map *map);
128struct map *map__clone(struct map *map); 129struct map *map__clone(struct map *map);
diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c
index a9300f83654b..adca69384fcc 100644
--- a/tools/perf/util/vdso.c
+++ b/tools/perf/util/vdso.c
@@ -135,7 +135,8 @@ static struct dso *vdso__new(struct machine *machine, const char *short_name,
135 return dso; 135 return dso;
136} 136}
137 137
138struct dso *vdso__dso_findnew(struct machine *machine) 138struct dso *vdso__dso_findnew(struct machine *machine,
139 struct thread *thread __maybe_unused)
139{ 140{
140 struct vdso_info *vdso_info; 141 struct vdso_info *vdso_info;
141 struct dso *dso; 142 struct dso *dso;
diff --git a/tools/perf/util/vdso.h b/tools/perf/util/vdso.h
index be3eb4324c1e..af9d6929a215 100644
--- a/tools/perf/util/vdso.h
+++ b/tools/perf/util/vdso.h
@@ -19,8 +19,9 @@ struct dso;
19bool dso__is_vdso(struct dso *dso); 19bool dso__is_vdso(struct dso *dso);
20 20
21struct machine; 21struct machine;
22struct thread;
22 23
23struct dso *vdso__dso_findnew(struct machine *machine); 24struct dso *vdso__dso_findnew(struct machine *machine, struct thread *thread);
24void vdso__exit(struct machine *machine); 25void vdso__exit(struct machine *machine);
25 26
26#endif /* __PERF_VDSO__ */ 27#endif /* __PERF_VDSO__ */