hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/tools/perf/util/vdso.c
....@@ -10,18 +10,21 @@
1010 #include <linux/kernel.h>
1111
1212 #include "vdso.h"
13
-#include "util.h"
13
+#include "dso.h"
14
+#include <internal/lib.h>
15
+#include "map.h"
1416 #include "symbol.h"
1517 #include "machine.h"
1618 #include "thread.h"
1719 #include "linux/string.h"
20
+#include <linux/zalloc.h>
1821 #include "debug.h"
1922
2023 /*
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
2225 * building perf-read-vdso32 and perf-read-vdsox32.
2326 */
24
-#include "find-vdso-map.c"
27
+#include "find-map.c"
2528
2629 #define VDSO__TEMP_FILE_NAME "/tmp/perf-vdso.so-XXXXXX"
2730
....@@ -76,7 +79,7 @@
7679 if (vdso_file->found)
7780 return vdso_file->temp_file_name;
7881
79
- if (vdso_file->error || find_vdso_map(&start, &end))
82
+ if (vdso_file->error || find_map(&start, &end, VDSO__MAP_NAME))
8083 return NULL;
8184
8285 size = end - start;
....@@ -130,6 +133,8 @@
130133 if (dso != NULL) {
131134 __dsos__add(&machine->dsos, dso);
132135 dso__set_long_name(dso, long_name, false);
136
+ /* Put dso here because __dsos_add already got it */
137
+ dso__put(dso);
133138 }
134139
135140 return dso;
....@@ -139,9 +144,9 @@
139144 struct thread *thread)
140145 {
141146 enum dso_type dso_type = DSO__TYPE_UNKNOWN;
142
- struct map *map = map_groups__first(thread->mg);
147
+ struct map *map;
143148
144
- for (; map ; map = map_groups__next(map)) {
149
+ maps__for_each_entry(thread->maps, map) {
145150 struct dso *dso = map->dso;
146151 if (!dso || dso->long_name[0] != '/')
147152 continue;