mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-02 23:54:33 +01:00
perf tools: Decompress kernel module when reading DSO data
Currently perf decompresses kernel modules when loading the symbol table but it missed to do it when reading raw data. 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]>
This commit is contained in:
1 parent
3c84fd5304
commit
1d6b3c9ba7
1 file changed
+16
@@ -475,7 +475,23 @@ static int __open_dso(struct dso *dso, struct machine *machine)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (dso__needs_decompress(dso)) {
|
||||
char newpath[KMOD_DECOMP_LEN];
|
||||
size_t len = sizeof(newpath);
|
||||
|
||||
if (dso__decompress_kmodule_path(dso, name, newpath, len) < 0) {
|
||||
free(name);
|
||||
return -dso->load_errno;
|
||||
}
|
||||
|
||||
strcpy(name, newpath);
|
||||
}
|
||||
|
||||
fd = do_open(name);
|
||||
|
||||
if (dso__needs_decompress(dso))
|
||||
unlink(name);
|
||||
|
||||
free(name);
|
||||
return fd;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user