perf symbols: Use __map__is_kernel() instead of ad-hoc equivalent code
Shorter, should be equivalent code, use it. 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-q90olng8sfkvrnsrwu7xnul6@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -1163,7 +1163,6 @@ static int dso__load_kcore(struct dso *dso, struct map *map,
|
|||||||
const char *kallsyms_filename)
|
const char *kallsyms_filename)
|
||||||
{
|
{
|
||||||
struct map_groups *kmaps = map__kmaps(map);
|
struct map_groups *kmaps = map__kmaps(map);
|
||||||
struct machine *machine;
|
|
||||||
struct kcore_mapfn_data md;
|
struct kcore_mapfn_data md;
|
||||||
struct map *old_map, *new_map, *replacement_map = NULL;
|
struct map *old_map, *new_map, *replacement_map = NULL;
|
||||||
bool is_64_bit;
|
bool is_64_bit;
|
||||||
@@ -1174,10 +1173,8 @@ static int dso__load_kcore(struct dso *dso, struct map *map,
|
|||||||
if (!kmaps)
|
if (!kmaps)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
machine = kmaps->machine;
|
|
||||||
|
|
||||||
/* This function requires that the map is the kernel map */
|
/* This function requires that the map is the kernel map */
|
||||||
if (map != machine->vmlinux_maps[map->type])
|
if (!__map__is_kernel(map))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (!filename_from_kallsyms_filename(kcore_filename, "kcore",
|
if (!filename_from_kallsyms_filename(kcore_filename, "kcore",
|
||||||
|
|||||||
Reference in New Issue
Block a user