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


Groups > linux.kernel > #1673267

[PATCH/RFC 1/9] perf symbols: Use absolute address to fixup map address

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject [PATCH/RFC 1/9] perf symbols: Use absolute address to fixup map address
Date Fri, 23 Jun 2017 07:50:01 +0200
Message-ID <tVpDH-6AF-3@gated-at.bofh.it> (permalink)
References <tVpDH-6AF-5@gated-at.bofh.it>
X-Original-To Arnaldo Carvalho de Melo <acme@kernel.org>
X-Original-Senderip 156.147.1.127
X-Original-Mailfrom namhyung@kernel.org
X-Original-Senderip 10.177.227.17
X-Original-Mailfrom namhyung@kernel.org
X-Mailer git-send-email 2.13.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 36
Organization linux.* mail to news gateway
X-Original-Cc Ingo Molnar <mingo@kernel.org>, Peter Zijlstra <a.p.zijlstra@chello.nl>, Jiri Olsa <jolsa@kernel.org>, LKML <linux-kernel@vger.kernel.org>, kernel-team@lge.com, Masami Hiramatsu <mhiramat@kernel.org>, Andi Kleen <andi@firstfloor.org>, Adrian Hunter <adrian.hunter@intel.com>, Wang Nan <wangnan0@huawei.com>
X-Original-Date Fri, 23 Jun 2017 14:48:19 +0900
X-Original-Message-ID <20170623054827.3828-2-namhyung@kernel.org>
X-Original-References <20170623054827.3828-1-namhyung@kernel.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1673267

Show key headers only | View raw


A symbol address is relative in a map/dso, to setup modules addresses it
should be converted to absolute address.  Note that it only used for
kernel mappings which uses identity map but theorically it should unmap
the address IMHO.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/map.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 2179b2deb730..4867265b800a 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -265,7 +265,7 @@ void map__fixup_start(struct map *map)
 	struct rb_node *nd = rb_first(symbols);
 	if (nd != NULL) {
 		struct symbol *sym = rb_entry(nd, struct symbol, rb_node);
-		map->start = sym->start;
+		map->start = map->unmap_ip(map, sym->start);
 	}
 }
 
@@ -275,7 +275,7 @@ void map__fixup_end(struct map *map)
 	struct rb_node *nd = rb_last(symbols);
 	if (nd != NULL) {
 		struct symbol *sym = rb_entry(nd, struct symbol, rb_node);
-		map->end = sym->end;
+		map->end = map->unmap_ip(map, sym->end);
 	}
 }
 
-- 
2.13.1

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH/RFC 1/9] perf symbols: Use absolute address to fixup map address Namhyung Kim <namhyung@kernel.org> - 2017-06-23 07:50 +0200

csiph-web