perf machine: Remove needless map_type from machine__load_vmlinux_path()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 25 Apr 2018 15:18:11 +0000 (12:18 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 26 Apr 2018 16:47:11 +0000 (13:47 -0300)
Since it uses machine__kernel_map() and this function always returns the
MAP__FUNCTION map, it doesn't make sense to call it with MAP__VARIABLE.

And also this is a step in the direction of nuking the MAP__{FUNCTION,VARIABLE}
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-0h3eof3kx3kq32ixg5fquf3p@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/vmlinux-kallsyms.c
tools/perf/util/machine.c
tools/perf/util/machine.h

index b99e605..4e6c804 100644 (file)
@@ -94,7 +94,7 @@ int test__vmlinux_matches_kallsyms(struct test *test __maybe_unused, int subtest
         * maps__reloc_vmlinux will notice and set proper ->[un]map_ip routines
         * to fixup the symbols.
         */
-       if (machine__load_vmlinux_path(&vmlinux, type) <= 0) {
+       if (machine__load_vmlinux_path(&vmlinux) <= 0) {
                pr_debug("Couldn't find a vmlinux that matches the kernel running on this machine, skipping test\n");
                err = TEST_SKIP;
                goto out;
index d39432c..0017c4a 100644 (file)
@@ -1005,13 +1005,13 @@ int __machine__load_kallsyms(struct machine *machine, const char *filename,
        return ret;
 }
 
-int machine__load_vmlinux_path(struct machine *machine, enum map_type type)
+int machine__load_vmlinux_path(struct machine *machine)
 {
        struct map *map = machine__kernel_map(machine);
        int ret = dso__load_vmlinux_path(map->dso, map);
 
        if (ret > 0)
-               dso__set_loaded(map->dso, type);
+               dso__set_loaded(map->dso, map->type);
 
        return ret;
 }
index dc95404..ac3b840 100644 (file)
@@ -245,7 +245,7 @@ static inline int machine__load_kallsyms(struct machine *machine, const char *fi
        return __machine__load_kallsyms(machine, filename, MAP__FUNCTION);
 }
 
-int machine__load_vmlinux_path(struct machine *machine, enum map_type type);
+int machine__load_vmlinux_path(struct machine *machine);
 
 size_t machine__fprintf_dsos_buildid(struct machine *machine, FILE *fp,
                                     bool (skip)(struct dso *dso, int parm), int parm);