.. | .. |
---|
10 | 10 | #include <linux/kernel.h> |
---|
11 | 11 | |
---|
12 | 12 | #include "vdso.h" |
---|
13 | | -#include "util.h" |
---|
| 13 | +#include "dso.h" |
---|
| 14 | +#include <internal/lib.h> |
---|
| 15 | +#include "map.h" |
---|
14 | 16 | #include "symbol.h" |
---|
15 | 17 | #include "machine.h" |
---|
16 | 18 | #include "thread.h" |
---|
17 | 19 | #include "linux/string.h" |
---|
| 20 | +#include <linux/zalloc.h> |
---|
18 | 21 | #include "debug.h" |
---|
19 | 22 | |
---|
20 | 23 | /* |
---|
21 | | - * Include definition of find_vdso_map() also used in perf-read-vdso.c for |
---|
| 24 | + * Include definition of find_map() also used in perf-read-vdso.c for |
---|
22 | 25 | * building perf-read-vdso32 and perf-read-vdsox32. |
---|
23 | 26 | */ |
---|
24 | | -#include "find-vdso-map.c" |
---|
| 27 | +#include "find-map.c" |
---|
25 | 28 | |
---|
26 | 29 | #define VDSO__TEMP_FILE_NAME "/tmp/perf-vdso.so-XXXXXX" |
---|
27 | 30 | |
---|
.. | .. |
---|
76 | 79 | if (vdso_file->found) |
---|
77 | 80 | return vdso_file->temp_file_name; |
---|
78 | 81 | |
---|
79 | | - if (vdso_file->error || find_vdso_map(&start, &end)) |
---|
| 82 | + if (vdso_file->error || find_map(&start, &end, VDSO__MAP_NAME)) |
---|
80 | 83 | return NULL; |
---|
81 | 84 | |
---|
82 | 85 | size = end - start; |
---|
.. | .. |
---|
130 | 133 | if (dso != NULL) { |
---|
131 | 134 | __dsos__add(&machine->dsos, dso); |
---|
132 | 135 | dso__set_long_name(dso, long_name, false); |
---|
| 136 | + /* Put dso here because __dsos_add already got it */ |
---|
| 137 | + dso__put(dso); |
---|
133 | 138 | } |
---|
134 | 139 | |
---|
135 | 140 | return dso; |
---|
.. | .. |
---|
139 | 144 | struct thread *thread) |
---|
140 | 145 | { |
---|
141 | 146 | enum dso_type dso_type = DSO__TYPE_UNKNOWN; |
---|
142 | | - struct map *map = map_groups__first(thread->mg); |
---|
| 147 | + struct map *map; |
---|
143 | 148 | |
---|
144 | | - for (; map ; map = map_groups__next(map)) { |
---|
| 149 | + maps__for_each_entry(thread->maps, map) { |
---|
145 | 150 | struct dso *dso = map->dso; |
---|
146 | 151 | if (!dso || dso->long_name[0] != '/') |
---|
147 | 152 | continue; |
---|