提交 0b064f43 编写于 作者: N Namhyung Kim 提交者: Arnaldo Carvalho de Melo

perf symbols: Support to read compressed module from build-id cache

The commit c00c48fc ("perf symbols: Preparation for compressed
kernel module support") added support for compressed kernel modules but
it only supports system path DSOs.  When a dso is read from build-id
cache, its filename doesn't end with ".gz" but has build-id.  In this
case, we should fallback to the original dso->name.
Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1422518843-25818-2-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 62e503b7
...@@ -574,13 +574,16 @@ static int decompress_kmodule(struct dso *dso, const char *name, ...@@ -574,13 +574,16 @@ static int decompress_kmodule(struct dso *dso, const char *name,
const char *ext = strrchr(name, '.'); const char *ext = strrchr(name, '.');
char tmpbuf[] = "/tmp/perf-kmod-XXXXXX"; char tmpbuf[] = "/tmp/perf-kmod-XXXXXX";
if ((type != DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP && if (type != DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP &&
type != DSO_BINARY_TYPE__GUEST_KMODULE_COMP) || type != DSO_BINARY_TYPE__GUEST_KMODULE_COMP &&
type != dso->symtab_type) type != DSO_BINARY_TYPE__BUILD_ID_CACHE)
return -1; return -1;
if (!ext || !is_supported_compression(ext + 1)) if (!ext || !is_supported_compression(ext + 1)) {
return -1; ext = strrchr(dso->name, '.');
if (!ext || !is_supported_compression(ext + 1))
return -1;
}
fd = mkstemp(tmpbuf); fd = mkstemp(tmpbuf);
if (fd < 0) if (fd < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册