]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
perf map: Remove enum_type arg to map_groups__first()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 25 Apr 2018 20:28:55 +0000 (17:28 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 26 Apr 2018 16:47:15 +0000 (13:47 -0300)
Only the symbol core needs to use that, so provide a __ variant for that
case, that will end up removed when we ditch the MAP__ split.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-x29k9e1ohastsoqbilp3mguh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/map.h
tools/perf/util/symbol.c
tools/perf/util/vdso.c

index b4bcf569a1313d9c12b57203100490112a652add..579ad7d2711d06064b22eb9fc52718d268aa7b39 100644 (file)
@@ -225,11 +225,7 @@ static inline struct map *map_groups__find(struct map_groups *mg, u64 addr)
        return __map_groups__find(mg, MAP__FUNCTION, addr);
 }
 
-static inline struct map *map_groups__first(struct map_groups *mg,
-                                           enum map_type type)
-{
-       return maps__first(&mg->maps[type]);
-}
+struct map *map_groups__first(struct map_groups *mg);
 
 static inline struct map *map_groups__next(struct map *map)
 {
index 8d99673573545a3b7f5d2f10616fdcf0d0fd8343..5d77c60e63bf1a518ee9c00910a0db5bff0970ff 100644 (file)
@@ -1044,6 +1044,16 @@ int compare_proc_modules(const char *from, const char *to)
        return ret;
 }
 
+static struct map *__map_groups__first(struct map_groups *mg, enum map_type type)
+{
+       return maps__first(&mg->maps[type]);
+}
+
+struct map *map_groups__first(struct map_groups *mg)
+{
+       return __map_groups__first(mg, MAP__FUNCTION);
+}
+
 static int do_validate_kcore_modules(const char *filename, struct map *map,
                                  struct map_groups *kmaps)
 {
@@ -1055,7 +1065,7 @@ static int do_validate_kcore_modules(const char *filename, struct map *map,
        if (err)
                return err;
 
-       old_map = map_groups__first(kmaps, map->type);
+       old_map = __map_groups__first(kmaps, map->type);
        while (old_map) {
                struct map *next = map_groups__next(old_map);
                struct module_info *mi;
@@ -1218,7 +1228,7 @@ static int dso__load_kcore(struct dso *dso, struct map *map,
        }
 
        /* Remove old maps */
-       old_map = map_groups__first(kmaps, map->type);
+       old_map = __map_groups__first(kmaps, map->type);
        while (old_map) {
                struct map *next = map_groups__next(old_map);
 
index 0acb1ec0e2f08c0ead7aa14835725b3a20f2fd76..741af209b19d65283f8ce130d6104c233864dac1 100644 (file)
@@ -139,12 +139,10 @@ static enum dso_type machine__thread_dso_type(struct machine *machine,
                                              struct thread *thread)
 {
        enum dso_type dso_type = DSO__TYPE_UNKNOWN;
-       struct map *map;
-       struct dso *dso;
+       struct map *map = map_groups__first(thread->mg);
 
-       map = map_groups__first(thread->mg, MAP__FUNCTION);
        for (; map ; map = map_groups__next(map)) {
-               dso = map->dso;
+               struct dso *dso = map->dso;
                if (!dso || dso->long_name[0] != '/')
                        continue;
                dso_type = dso__type(dso, machine);