perf tools: Add lzma decompression support for kernel module
tip-bot for Jiri Olsa
merge botCommit-ID: 80a32e5b498a7547073e5e4b2b804edc7219979d Gitweb: http://git.kernel.org/tip/80a32e5b498a7547073e5e4b2b804edc7219979d Author: Jiri Olsa <[email protected]> AuthorDate: Thu, 29 Jan 2015 13:29:39 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Sat, 21 Mar 2015 14:53:40 -0300
perf tools: Add lzma decompression support for kernel module
In short, Fedora compresses kernel modules now (since version 21) with lzma compression.
Adding lzma decompress support into the dso.c:compressions array introduced by Namhyung earlier.
Signed-off-by Jiri Olsa <[email protected]>
Acked-by Namhyung Kim <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Corey Ashford <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/Makefile.perf | 2 + tools/perf/config/Makefile | 11 ++++++ tools/perf/util/Build | 1 + tools/perf/util/dso.c | 3 ++ tools/perf/util/lzma.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++ tools/perf/util/util.h | 4 ++ 6 files changed, 116 insertions(+)
tools/perf/Makefile.perf +2 -0
@@ -71,6 +71,8 @@ include config/utilities.mak # # Define NO_LIBBABELTRACE if you do not want libbabeltrace support # for CTF data format. +# +# Define NO_LZMA if you do not want to support compressed (xz) kernel modules ifeq ($(srctree),) srctree := $(patsubst %/,%,$(dir $(shell pwd)))
tools/perf/config/Makefile +11 -0
@@ -541,6 +541,17 @@ ifndef NO_ZLIB endif endif +ifndef NO_LZMA + ifeq ($(feature-lzma), 1) + CFLAGS += -DHAVE_LZMA_SUPPORT + EXTLIBS += -llzma + $(call detected,CONFIG_LZMA) + else + msg := $(warning No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev); + NO_LZMA := 1 + endif +endif + ifndef NO_BACKTRACE ifeq ($(feature-backtrace), 1) CFLAGS += -DHAVE_BACKTRACE_SUPPORT
tools/perf/util/Build +1 -0
@@ -94,6 +94,7 @@ libperf-y += scripting-engines/ libperf-$(CONFIG_PERF_REGS) += perf_regs.o libperf-$(CONFIG_ZLIB) += zlib.o +libperf-$(CONFIG_LZMA) += lzma.o CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" CFLAGS_exec_cmd.o += -DPERF_EXEC_PATH="BUILD_STR($(perfexecdir_SQ))" -DPREFIX="BUILD_STR($(prefix_SQ))"
tools/perf/util/dso.c +3 -0
@@ -148,6 +148,9 @@ static const struct { #ifdef HAVE_ZLIB_SUPPORT { "gz", gzip_decompress_to_file }, #endif +#ifdef HAVE_LZMA_SUPPORT + { "xz", lzma_decompress_to_file }, +#endif { NULL, NULL }, };
tools/perf/util/lzma.c new file +95 -0
95 lines not on this page · raw message
tools/perf/util/util.h +4 -0
@@ -329,4 +329,8 @@ bool find_process(const char *name);int gzip_decompress_to_file (const char *input,int output_fd);#endif +#ifdef HAVE_LZMA_SUPPORT +int lzma_decompress_to_file (const char *input,int output_fd); +#endif +#endif /* GIT_COMPAT_UTIL_H */