Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1660838

[PATCH v4 5/9] perf tools: Decompress kernel module when reading DSO data

From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v4 5/9] perf tools: Decompress kernel module when reading DSO data
Date 2017-06-08 09:40 +0200
Message-ID <tQ0cV-1hd-5@gated-at.bofh.it> (permalink)
References <tQ0cV-1hd-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Currently perf decompresses kernel modules when loading symbol table but
it missed to do it when reading raw data.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/dso.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index b346b8eba65c..c63525d845c5 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -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;
 }
-- 
2.13.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v4 5/9] perf tools: Decompress kernel module when reading DSO data Namhyung Kim <namhyung@kernel.org> - 2017-06-08 09:40 +0200
  [tip:perf/urgent] perf tools: Decompress kernel module when reading  DSO data tip-bot for Namhyung Kim <tipbot@zytor.com> - 2017-06-09 01:00 +0200

csiph-web