perf map: Remove enum_type arg to map_groups__first()
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: dce0478b5fa05147a69dc6dd6cfcaac2f0e0eb2f Gitweb: https://git.kernel.org/tip/dce0478b5fa05147a69dc6dd6cfcaac2f0e0eb2f Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Wed, 25 Apr 2018 17:28:55 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 26 Apr 2018 13:47:15 -0300
perf map: Remove enum_type arg to map_groups__first()
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 <[email protected]>
Cc David Ahern <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Wang Nan <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/util/map.h | 6 +----- tools/perf/util/symbol.c | 14 ++++++++++++-- tools/perf/util/vdso.c | 6 ++---- 3 files changed, 15 insertions(+), 11 deletions(-)
tools/perf/util/map.h +1 -5
@@ -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) {
tools/perf/util/symbol.c +12 -2
@@ -1044,6 +1044,16 @@ out_delete_from: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);
tools/perf/util/vdso.c +2 -4
@@ -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);