From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Masami Hiramatsu <masami.hiramatsu@linaro.org>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Wang Nan <wangnan0@huawei.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 03/11] perf probe: Adjust map->reloc offset when finding kernel symbol from map
Date: Tue, 9 Aug 2016 13:01:26 -0300 [thread overview]
Message-ID: <1470758494-32127-4-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1470758494-32127-1-git-send-email-acme@kernel.org>
From: Masami Hiramatsu <masami.hiramatsu@linaro.org>
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@kernel.org>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20160806192948.e366f3fbc4b194de600f8326@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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 953dc1ab2ed7..d5ccb656fd81 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) {
--
2.7.4
next prev parent reply other threads:[~2016-08-09 16:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-09 16:01 [GIT PULL 00/11] perf/urgent fixes Arnaldo Carvalho de Melo
2016-08-09 16:01 ` [PATCH 01/11] perf script: Add 'bpf-output' field to usage message Arnaldo Carvalho de Melo
2016-08-09 16:01 ` [PATCH 02/11] perf hists: Trim libtraceevent trace_seq buffers Arnaldo Carvalho de Melo
2016-08-09 16:01 ` Arnaldo Carvalho de Melo [this message]
2016-08-09 16:01 ` [PATCH 04/11] perf probe: Fix module name matching Arnaldo Carvalho de Melo
2016-08-09 16:01 ` [PATCH 05/11] perf stat: Avoid skew when reading events Arnaldo Carvalho de Melo
2016-08-09 16:01 ` [PATCH 06/11] perf probe: Support signedness casting Arnaldo Carvalho de Melo
2016-08-09 16:01 ` [PATCH 07/11] tools: Sync cpufeatures.h and vmx.h with the kernel Arnaldo Carvalho de Melo
2016-08-09 16:57 ` Ross Zwisler
2016-08-09 16:01 ` [PATCH 08/11] toops: Sync tools/include/uapi/linux/bpf.h " Arnaldo Carvalho de Melo
2016-08-09 16:01 ` [PATCH 09/11] tools: Sync cpufeatures headers " Arnaldo Carvalho de Melo
2016-08-09 16:01 ` [PATCH 10/11] perf probe: Add function to post process kernel trace events Arnaldo Carvalho de Melo
2016-08-09 16:01 ` [PATCH 11/11] perf probe ppc64le: Fix probe location when using DWARF Arnaldo Carvalho de Melo
2016-08-09 19:12 ` [GIT PULL 00/11] perf/urgent 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=1470758494-32127-4-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=alexei.starovoitov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu@linaro.org \
--cc=mingo@kernel.org \
--cc=wangnan0@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.