aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/dso.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2020-11-26 18:00:09 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-11-27 08:36:53 -0300
commit7ac22b088afe26a42978ff7576730ca419da76aa (patch)
tree2b09011daf322ab1a167892916c69a10224cc562 /tools/perf/util/dso.h
parentperf tools: Add build_id__is_defined function (diff)
downloadlinux-dev-7ac22b088afe26a42978ff7576730ca419da76aa.tar.xz
linux-dev-7ac22b088afe26a42978ff7576730ca419da76aa.zip
perf tools: Add filename__decompress function
Factor filename__decompress from decompress_kmodule function. It can decompress files with compressions supported in perf - xz and gz, the support needs to be compiled in. It will to be used in following changes to get build id out of compressed elf objects. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Song Liu <songliubraving@fb.com> Cc: Stephane Eranian <eranian@google.com> Link: http://lore.kernel.org/lkml/20201126170026.2619053-9-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/dso.h')
-rw-r--r--tools/perf/util/dso.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index d8cb4f5680a4..cd2fe64a3c5d 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -274,6 +274,8 @@ bool dso__needs_decompress(struct dso *dso);
int dso__decompress_kmodule_fd(struct dso *dso, const char *name);
int dso__decompress_kmodule_path(struct dso *dso, const char *name,
char *pathname, size_t len);
+int filename__decompress(const char *name, char *pathname,
+ size_t len, int comp, int *err);
#define KMOD_DECOMP_NAME "/tmp/perf-kmod-XXXXXX"
#define KMOD_DECOMP_LEN sizeof(KMOD_DECOMP_NAME)