perf symbols: Keep DSO->symtab_type after decompress
authorNamhyung Kim <[email protected]>
Thu, 8 Jun 2017 07:31:08 +0000 (16:31 +0900)
committerArnaldo Carvalho de Melo <[email protected]>
Thu, 8 Jun 2017 18:39:26 +0000 (15:39 -0300)
The symsrc__init() overwrites dso->symtab_type as symsrc->type in
dso__load_sym().  But for compressed kernel modules in the build-id
cache, it should have original symtab type to be decompressed as needed.

This fixes perf annotate to show disassembly of the function properly.

Signed-off-by: Namhyung Kim <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Wang Nan <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/symbol-elf.c

index d342e771dbadb9a31bb04d68489f9cf8c62f6744..502505cf236af30226b22ff82878098060f19862 100644 (file)
@@ -671,6 +671,8 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
                fd = dso__decompress_kmodule_fd(dso, name);
                if (fd < 0)
                        return -1;
+
+               type = dso->symtab_type;
        } else {
                fd = open(name, O_RDONLY);
                if (fd < 0) {