]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
perf probe: Adjust map->reloc offset when finding kernel symbol from map
authorMasami Hiramatsu <masami.hiramatsu@linaro.org>
Sat, 6 Aug 2016 10:29:48 +0000 (19:29 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 9 Aug 2016 13:47:43 +0000 (10:47 -0300)
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

index 953dc1ab2ed7bd0be442c4491c9c8a4862aa3386..d5ccb656fd81fc6b05bc48285629c4d4286bd1d2 100644 (file)
@@ -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) {