Skip to content

Commit

Permalink
perf tools: Decompress kernel module when reading DSO data
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
namhyung authored and acmel committed Jun 8, 2017
1 parent 3c84fd5 commit 1d6b3c9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tools/perf/util/dso.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1d6b3c9

Please sign in to comment.