You need to sign in or sign up before continuing.

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 <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.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 a2f1c160
...@@ -225,11 +225,7 @@ static inline struct map *map_groups__find(struct map_groups *mg, u64 addr) ...@@ -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); return __map_groups__find(mg, MAP__FUNCTION, addr);
} }
static inline struct map *map_groups__first(struct map_groups *mg, struct map *map_groups__first(struct map_groups *mg);
enum map_type type)
{
return maps__first(&mg->maps[type]);
}
static inline struct map *map_groups__next(struct map *map) static inline struct map *map_groups__next(struct map *map)
{ {
......
...@@ -1044,6 +1044,16 @@ int compare_proc_modules(const char *from, const char *to) ...@@ -1044,6 +1044,16 @@ int compare_proc_modules(const char *from, const char *to)
return ret; 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, static int do_validate_kcore_modules(const char *filename, struct map *map,
struct map_groups *kmaps) struct map_groups *kmaps)
{ {
...@@ -1055,7 +1065,7 @@ static int do_validate_kcore_modules(const char *filename, struct map *map, ...@@ -1055,7 +1065,7 @@ static int do_validate_kcore_modules(const char *filename, struct map *map,
if (err) if (err)
return err; return err;
old_map = map_groups__first(kmaps, map->type); old_map = __map_groups__first(kmaps, map->type);
while (old_map) { while (old_map) {
struct map *next = map_groups__next(old_map); struct map *next = map_groups__next(old_map);
struct module_info *mi; struct module_info *mi;
...@@ -1218,7 +1228,7 @@ static int dso__load_kcore(struct dso *dso, struct map *map, ...@@ -1218,7 +1228,7 @@ static int dso__load_kcore(struct dso *dso, struct map *map,
} }
/* Remove old maps */ /* Remove old maps */
old_map = map_groups__first(kmaps, map->type); old_map = __map_groups__first(kmaps, map->type);
while (old_map) { while (old_map) {
struct map *next = map_groups__next(old_map); struct map *next = map_groups__next(old_map);
......
...@@ -139,12 +139,10 @@ static enum dso_type machine__thread_dso_type(struct machine *machine, ...@@ -139,12 +139,10 @@ static enum dso_type machine__thread_dso_type(struct machine *machine,
struct thread *thread) struct thread *thread)
{ {
enum dso_type dso_type = DSO__TYPE_UNKNOWN; enum dso_type dso_type = DSO__TYPE_UNKNOWN;
struct map *map; struct map *map = map_groups__first(thread->mg);
struct dso *dso;
map = map_groups__first(thread->mg, MAP__FUNCTION);
for (; map ; map = map_groups__next(map)) { for (; map ; map = map_groups__next(map)) {
dso = map->dso; struct dso *dso = map->dso;
if (!dso || dso->long_name[0] != '/') if (!dso || dso->long_name[0] != '/')
continue; continue;
dso_type = dso__type(dso, machine); dso_type = dso__type(dso, machine);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册