linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Jiri Olsa <jolsa@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	David Ahern <dsahern@gmail.com>,
	Michael Petlan <mpetlan@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 11/21] perf tools: Store compression id into struct dso
Date: Mon, 20 Aug 2018 13:15:52 -0300	[thread overview]
Message-ID: <20180820161602.6830-12-acme@kernel.org> (raw)
In-Reply-To: <20180820161602.6830-1-acme@kernel.org>

From: Jiri Olsa <jolsa@kernel.org>

Add comp to 'struct dso' to hold the compression index.  It will be used
in the following patches.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180817094813.15086-8-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/dso.c     | 5 ++++-
 tools/perf/util/dso.h     | 1 +
 tools/perf/util/machine.c | 4 +++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index d34e47bb09d9..d875e6956a3e 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -417,8 +417,10 @@ void dso__set_module_info(struct dso *dso, struct kmod_path *m,
 		dso->symtab_type = DSO_BINARY_TYPE__GUEST_KMODULE;
 
 	/* _KMODULE_COMP should be next to _KMODULE */
-	if (m->kmod && m->comp)
+	if (m->kmod && m->comp) {
 		dso->symtab_type++;
+		dso->comp = m->comp;
+	}
 
 	dso__set_short_name(dso, strdup(m->name), true);
 }
@@ -1224,6 +1226,7 @@ struct dso *dso__new(const char *name)
 		dso->a2l_fails = 1;
 		dso->kernel = DSO_TYPE_USER;
 		dso->needs_swap = DSO_SWAP__UNSET;
+		dso->comp = COMP_ID__NONE;
 		RB_CLEAR_NODE(&dso->rb_node);
 		dso->root = NULL;
 		INIT_LIST_HEAD(&dso->node);
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index 7bde23f6e5a9..a6c7af52115f 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -175,6 +175,7 @@ struct dso {
 	u16		 short_name_len;
 	void		*dwfl;			/* DWARF debug info */
 	struct auxtrace_cache *auxtrace_cache;
+	int		 comp;
 
 	/* dso data file */
 	struct {
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index b300a3973448..c4acd2001db0 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1212,8 +1212,10 @@ static int map_groups__set_module_path(struct map_groups *mg, const char *path,
 	 * Full name could reveal us kmod compression, so
 	 * we need to update the symtab_type if needed.
 	 */
-	if (m->comp && is_kmod_dso(map->dso))
+	if (m->comp && is_kmod_dso(map->dso)) {
 		map->dso->symtab_type++;
+		map->dso->comp = m->comp;
+	}
 
 	return 0;
 }
-- 
2.14.4

  parent reply	other threads:[~2018-08-20 16:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20 16:15 [GIT PULL 00/21] perf/core improvements and fixes Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 01/21] perf tools: Disable parallelism for 'make clean' Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 02/21] perf parser: Improve error message for PMU address filters Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 03/21] perf llvm: Allow passing options to llc in addition to clang Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 04/21] tools lib traceevent: Change to SPDX License format Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 05/21] perf tools: Get rid of dso__needs_decompress() call in read_object_code() Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 06/21] perf tools: Get rid of dso__needs_decompress() call in symbol__disassemble() Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 07/21] perf tools: Get rid of dso__needs_decompress() call in __open_dso() Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 08/21] perf tools: Make decompress_to_file() function static Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 09/21] perf tools: Make is_supported_compression() static Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 10/21] perf tools: Add compression id into 'struct kmod_path' Arnaldo Carvalho de Melo
2018-08-20 16:15 ` Arnaldo Carvalho de Melo [this message]
2018-08-20 16:15 ` [PATCH 12/21] perf tools: Use compression id in decompress_kmodule() Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 13/21] perf tools: Move the temp file processing into decompress_kmodule Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 14/21] perf tools: Add is_compressed callback to compressions array Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 15/21] perf tools: Add lzma_is_compressed function Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 16/21] perf tools: Add gzip_is_compressed function Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 17/21] perf tools: Remove ext from struct kmod_path Arnaldo Carvalho de Melo
2018-08-20 16:15 ` [PATCH 18/21] perf mmap: Store real cpu number in 'struct perf_mmap' Arnaldo Carvalho de Melo
2018-08-20 16:16 ` [PATCH 19/21] perf python: Fix pyrf_evlist__read_on_cpu() interface Arnaldo Carvalho de Melo
2018-08-20 16:16 ` [PATCH 20/21] tools arch x86: Update tools's copy of cpufeatures.h Arnaldo Carvalho de Melo
2018-08-20 16:16 ` [PATCH 21/21] tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' Arnaldo Carvalho de Melo
2018-08-23  8:31 ` [GIT PULL 00/21] perf/core improvements and fixes Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180820161602.6830-12-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).