perf symbols: Do not attempt to read data from kallsyms
authorAdrian Hunter <adrian.hunter@intel.com>
Mon, 14 Jul 2014 10:02:43 +0000 (13:02 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 16 Jul 2014 20:57:35 +0000 (17:57 -0300)
Record kallsyms binary type so that tools will not
attempt to read binary data from it.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1405332185-4050-20-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/symbol.c

index ae2e4464afa7165a555e6cc0c3f1a0f8059d577c..156ae36dfcfcd1a625ce72937634065ac523697a 100644 (file)
@@ -1664,6 +1664,7 @@ do_kallsyms:
        free(kallsyms_allocated_filename);
 
        if (err > 0 && !dso__is_kcore(dso)) {
+               dso->binary_type = DSO_BINARY_TYPE__KALLSYMS;
                dso__set_long_name(dso, "[kernel.kallsyms]", false);
                map__fixup_start(map);
                map__fixup_end(map);
@@ -1711,6 +1712,7 @@ static int dso__load_guest_kernel_sym(struct dso *dso, struct map *map,
        if (err > 0)
                pr_debug("Using %s for symbols\n", kallsyms_filename);
        if (err > 0 && !dso__is_kcore(dso)) {
+               dso->binary_type = DSO_BINARY_TYPE__GUEST_KALLSYMS;
                machine__mmap_name(machine, path, sizeof(path));
                dso__set_long_name(dso, strdup(path), true);
                map__fixup_start(map);