[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-8e34189b347d76acf48ce05831176582201b664d@git.kernel.org>
Date: Tue, 9 Aug 2016 12:17:45 -0700
From: tip-bot for Masami Hiramatsu <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: wangnan0@...wei.com, linux-kernel@...r.kernel.org,
alexei.starovoitov@...il.com, hpa@...or.com, acme@...nel.org,
tglx@...utronix.de, acme@...hat.com, masami.hiramatsu@...aro.org,
mingo@...nel.org
Subject: [tip:perf/urgent] perf probe: Adjust map->reloc offset when finding
kernel symbol from map
Commit-ID: 8e34189b347d76acf48ce05831176582201b664d
Gitweb: http://git.kernel.org/tip/8e34189b347d76acf48ce05831176582201b664d
Author: Masami Hiramatsu <masami.hiramatsu@...aro.org>
AuthorDate: Sat, 6 Aug 2016 19:29:48 +0900
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 9 Aug 2016 10:47:43 -0300
perf probe: Adjust map->reloc offset when finding kernel symbol from map
Adjust map->reloc offset for the unmapped address when finding
alternative symbol address from map, because KASLR can relocate the
kernel symbol address.
The same adjustment has been done when finding appropriate kernel symbol
address from map which was introduced by commit f90acac75713 ("perf
probe: Find given address from offline dwarf")
Reported-by: Arnaldo Carvalho de Melo <acme@...nel.org>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@...aro.org>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/r/20160806192948.e366f3fbc4b194de600f8326@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/probe-event.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 953dc1a..d5ccb65 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -385,7 +385,7 @@ static int find_alternative_probe_point(struct debuginfo *dinfo,
if (uprobes)
address = sym->start;
else
- address = map->unmap_ip(map, sym->start);
+ address = map->unmap_ip(map, sym->start) - map->reloc;
break;
}
if (!address) {
Powered by blists - more mailing lists