perf symbols: Use __map__is_kernel() instead of ad-hoc equivalent code
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: efdd5c6b81185223e07452a2f8b5467f81b13d96 Gitweb: https://git.kernel.org/tip/efdd5c6b81185223e07452a2f8b5467f81b13d96 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Mon, 23 Apr 2018 16:43:47 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 26 Apr 2018 13:47:00 -0300
perf symbols: Use __map__is_kernel() instead of ad-hoc equivalent code
Shorter, should be equivalent code, use it.
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/symbol.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
tools/perf/util/symbol.c +1 -4
@@ -1163,7 +1163,6 @@ static int dso__load_kcore(struct dso *dso, struct map *map, const char *kallsyms_filename) {struct map_groups *kmaps =map__kmaps (map); -struct machine *machine;struct kcore_mapfn_data md;struct map *old_map, *new_map, *replacement_map =NULL ;bool is_64_bit;
@@ -1174,10 +1173,8 @@ static int dso__load_kcore(struct dso *dso, struct map *map,if (!kmaps)return -EINVAL ; - machine = kmaps->machine; -/* This function requires that the map is the kernel map */ -if (map != machine->vmlinux_maps[map->type]) +if (!__map__is_kernel (map))return -EINVAL ; if (!filename_from_kallsyms_filename(kcore_filename, "kcore",