mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
perf symbols: Support to read compressed module from build-id cache
The commit c00c48fc6e ("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: Namhyung Kim <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
62e503b7ed
commit
0b064f4300
1 changed files with 8 additions and 5 deletions
|
|
@ -574,13 +574,16 @@ static int decompress_kmodule(struct dso *dso, const char *name,
|
|||
const char *ext = strrchr(name, '.');
|
||||
char tmpbuf[] = "/tmp/perf-kmod-XXXXXX";
|
||||
|
||||
if ((type != DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP &&
|
||||
type != DSO_BINARY_TYPE__GUEST_KMODULE_COMP) ||
|
||||
type != dso->symtab_type)
|
||||
if (type != DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP &&
|
||||
type != DSO_BINARY_TYPE__GUEST_KMODULE_COMP &&
|
||||
type != DSO_BINARY_TYPE__BUILD_ID_CACHE)
|
||||
return -1;
|
||||
|
||||
if (!ext || !is_supported_compression(ext + 1))
|
||||
return -1;
|
||||
if (!ext || !is_supported_compression(ext + 1)) {
|
||||
ext = strrchr(dso->name, '.');
|
||||
if (!ext || !is_supported_compression(ext + 1))
|
||||
return -1;
|
||||
}
|
||||
|
||||
fd = mkstemp(tmpbuf);
|
||||
if (fd < 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue