瀏覽代碼

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>
Adrian Hunter 11 年之前
父節點
當前提交
5835eddab6
共有 5 個文件被更改,包括 10 次插入7 次删除
  1. 2 2
      tools/perf/util/machine.c
  2. 2 2
      tools/perf/util/map.c
  3. 2 1
      tools/perf/util/map.h
  4. 2 1
      tools/perf/util/vdso.c
  5. 2 1
      tools/perf/util/vdso.h

+ 2 - 2
tools/perf/util/machine.c

@@ -1106,7 +1106,7 @@ int machine__process_mmap2_event(struct machine *machine,
 			event->mmap2.ino_generation,
 			event->mmap2.ino_generation,
 			event->mmap2.prot,
 			event->mmap2.prot,
 			event->mmap2.flags,
 			event->mmap2.flags,
-			event->mmap2.filename, type);
+			event->mmap2.filename, type, thread);
 
 
 	if (map == NULL)
 	if (map == NULL)
 		goto out_problem;
 		goto out_problem;
@@ -1153,7 +1153,7 @@ int machine__process_mmap_event(struct machine *machine, union perf_event *event
 			event->mmap.len, event->mmap.pgoff,
 			event->mmap.len, event->mmap.pgoff,
 			event->mmap.pid, 0, 0, 0, 0, 0, 0,
 			event->mmap.pid, 0, 0, 0, 0, 0, 0,
 			event->mmap.filename,
 			event->mmap.filename,
-			type);
+			type, thread);
 
 
 	if (map == NULL)
 	if (map == NULL)
 		goto out_problem;
 		goto out_problem;

+ 2 - 2
tools/perf/util/map.c

@@ -141,7 +141,7 @@ void map__init(struct map *map, enum map_type type,
 struct map *map__new(struct machine *machine, u64 start, u64 len,
 struct map *map__new(struct machine *machine, u64 start, u64 len,
 		     u64 pgoff, u32 pid, u32 d_maj, u32 d_min, u64 ino,
 		     u64 pgoff, u32 pid, u32 d_maj, u32 d_min, u64 ino,
 		     u64 ino_gen, u32 prot, u32 flags, char *filename,
 		     u64 ino_gen, u32 prot, u32 flags, char *filename,
-		     enum map_type type)
+		     enum map_type type, struct thread *thread)
 {
 {
 	struct map *map = malloc(sizeof(*map));
 	struct map *map = malloc(sizeof(*map));
 
 
@@ -174,7 +174,7 @@ struct map *map__new(struct machine *machine, u64 start, u64 len,
 
 
 		if (vdso) {
 		if (vdso) {
 			pgoff = 0;
 			pgoff = 0;
-			dso = vdso__dso_findnew(machine);
+			dso = vdso__dso_findnew(machine, thread);
 		} else
 		} else
 			dso = __dsos__findnew(&machine->user_dsos, filename);
 			dso = __dsos__findnew(&machine->user_dsos, filename);
 
 

+ 2 - 1
tools/perf/util/map.h

@@ -104,6 +104,7 @@ u64 map__rip_2objdump(struct map *map, u64 rip);
 u64 map__objdump_2mem(struct map *map, u64 ip);
 u64 map__objdump_2mem(struct map *map, u64 ip);
 
 
 struct symbol;
 struct symbol;
+struct thread;
 
 
 /* map__for_each_symbol - iterate over the symbols in the given map
 /* map__for_each_symbol - iterate over the symbols in the given map
  *
  *
@@ -122,7 +123,7 @@ void map__init(struct map *map, enum map_type type,
 struct map *map__new(struct machine *machine, u64 start, u64 len,
 struct map *map__new(struct machine *machine, u64 start, u64 len,
 		     u64 pgoff, u32 pid, u32 d_maj, u32 d_min, u64 ino,
 		     u64 pgoff, u32 pid, u32 d_maj, u32 d_min, u64 ino,
 		     u64 ino_gen, u32 prot, u32 flags,
 		     u64 ino_gen, u32 prot, u32 flags,
-		     char *filename, enum map_type type);
+		     char *filename, enum map_type type, struct thread *thread);
 struct map *map__new2(u64 start, struct dso *dso, enum map_type type);
 struct map *map__new2(u64 start, struct dso *dso, enum map_type type);
 void map__delete(struct map *map);
 void map__delete(struct map *map);
 struct map *map__clone(struct map *map);
 struct map *map__clone(struct map *map);

+ 2 - 1
tools/perf/util/vdso.c

@@ -135,7 +135,8 @@ static struct dso *vdso__new(struct machine *machine, const char *short_name,
 	return dso;
 	return dso;
 }
 }
 
 
-struct dso *vdso__dso_findnew(struct machine *machine)
+struct dso *vdso__dso_findnew(struct machine *machine,
+			      struct thread *thread __maybe_unused)
 {
 {
 	struct vdso_info *vdso_info;
 	struct vdso_info *vdso_info;
 	struct dso *dso;
 	struct dso *dso;

+ 2 - 1
tools/perf/util/vdso.h

@@ -19,8 +19,9 @@ struct dso;
 bool dso__is_vdso(struct dso *dso);
 bool dso__is_vdso(struct dso *dso);
 
 
 struct machine;
 struct machine;
+struct thread;
 
 
-struct dso *vdso__dso_findnew(struct machine *machine);
+struct dso *vdso__dso_findnew(struct machine *machine, struct thread *thread);
 void vdso__exit(struct machine *machine);
 void vdso__exit(struct machine *machine);
 
 
 #endif /* __PERF_VDSO__ */
 #endif /* __PERF_VDSO__ */