The use_kcore field is to control usage of /proc/kcore when loading
symbols.  This patch only introduces the new field and don't change any
behavior by itself.

Cc: Adrian Hunter <[email protected]>
Cc: Wang Nan <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
---
 tools/perf/util/symbol.c | 3 ++-
 tools/perf/util/symbol.h | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index fe46eb782297..3f789f33c2ef 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -36,6 +36,7 @@ char **vmlinux_path;
 
 struct symbol_conf symbol_conf = {
        .use_modules            = true,
+       .use_kcore              = true,
        .try_vmlinux_path       = true,
        .annotate_src           = true,
        .demangle               = true,
@@ -1324,7 +1325,7 @@ int __dso__load_kallsyms(struct dso *dso, const char 
*filename,
 int dso__load_kallsyms(struct dso *dso, const char *filename,
                       struct map *map)
 {
-       return __dso__load_kallsyms(dso, filename, map, false);
+       return __dso__load_kallsyms(dso, filename, map, !symbol_conf.use_kcore);
 }
 
 static int dso__load_perf_map(struct dso *dso, struct map *map)
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 41ebba9a2eb2..88361eeae813 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -119,7 +119,8 @@ struct symbol_conf {
                        hide_unresolved,
                        raw_trace,
                        report_hierarchy,
-                       inline_name;
+                       inline_name,
+                       use_kcore;
        const char      *vmlinux_name,
                        *kallsyms_name,
                        *source_prefix,
-- 
2.13.1

Reply via email to