With pgoff set to zero, the map__map_ip function will return bpf address based from 0, which is what we need when we read the data from bpf dso.
Adding bpf symbols with mapped ip addresses as well. Link: http://lkml.kernel.org/n/tip-nqgyzbqgekvxqc5tjmsb3...@git.kernel.org Signed-off-by: Jiri Olsa <jo...@kernel.org> --- tools/perf/util/machine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index ad0205fbb506..d4aa44489011 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -704,12 +704,12 @@ static int machine__process_ksymbol_register(struct machine *machine, return -ENOMEM; map->start = event->ksymbol_event.addr; - map->pgoff = map->start; map->end = map->start + event->ksymbol_event.len; map_groups__insert(&machine->kmaps, map); } - sym = symbol__new(event->ksymbol_event.addr, event->ksymbol_event.len, + sym = symbol__new(map->map_ip(map, map->start), + event->ksymbol_event.len, 0, 0, event->ksymbol_event.name); if (!sym) return -ENOMEM; -- 2.17.2