mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
perf annotate: Use dso__decompress_kmodule_path()
Convert open-coded decompress routine to use the function. 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:
parent
42b3fa6708
commit
3c84fd5304
1 changed files with 3 additions and 24 deletions
|
|
@ -1431,31 +1431,10 @@ int symbol__disassemble(struct symbol *sym, struct map *map, const char *arch_na
|
|||
sizeof(symfs_filename));
|
||||
}
|
||||
} else if (dso__needs_decompress(dso)) {
|
||||
char tmp[PATH_MAX];
|
||||
struct kmod_path m;
|
||||
int fd;
|
||||
bool ret;
|
||||
char tmp[KMOD_DECOMP_LEN];
|
||||
|
||||
if (kmod_path__parse_ext(&m, symfs_filename))
|
||||
goto out;
|
||||
|
||||
snprintf(tmp, PATH_MAX, "/tmp/perf-kmod-XXXXXX");
|
||||
|
||||
fd = mkstemp(tmp);
|
||||
if (fd < 0) {
|
||||
free(m.ext);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = decompress_to_file(m.ext, symfs_filename, fd);
|
||||
|
||||
if (ret)
|
||||
pr_err("Cannot decompress %s %s\n", m.ext, symfs_filename);
|
||||
|
||||
free(m.ext);
|
||||
close(fd);
|
||||
|
||||
if (!ret)
|
||||
if (dso__decompress_kmodule_path(dso, symfs_filename,
|
||||
tmp, sizeof(tmp)) < 0)
|
||||
goto out;
|
||||
|
||||
strcpy(symfs_filename, tmp);
|
||||
|
|
|
|||
Loading…
Reference in a new issue