Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3322970yba; Tue, 16 Apr 2019 09:03:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzw747kaCN0zZeljJcnWgrGs+nk5ZVg3tjcukDXMmrMnaZUFAG3Q4Ca1mrgkxvTjPUr/D2v X-Received: by 2002:a17:902:b717:: with SMTP id d23mr80396063pls.260.1555430604311; Tue, 16 Apr 2019 09:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555430604; cv=none; d=google.com; s=arc-20160816; b=vfyXHi1bD/CzQFY3r1dIAT9npQEkcM4xjWfxs5zXSnK7XsTp2rxPtgfeUlB+zXCP4B gZsjRyIvKaEu8psH87PJQqs2g9G5A7V4+RRxqoOehyPZvuAQwslwczuXeIIyVTfcDLk4 XUj6bZM9MzDIcDHxbLZMa2WH4QF4QQHx+6jzHUPpYJlvyiNZYj91MsTUkhbxy0bI3ePV wzDUYiewt0KPg/+wpDNHEI+0WVd1noxkTGNzhx6lnigvHp4xKVgNyv51AZ5JHD1P9Co6 NUs1jyXuiI1exToZiq0bF5RYyRoQeo5XL/VQUHA5Ie3R0IqJWEVvp1D552l66VtC1XYA xIYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Gy3P2sTKSmrF2Y0cWZgnlQGMKner30gF++BIZe7CdIs=; b=jv4uz1eapXyPuDYPidncO5tKKUCsdxSKORJMIajTDxzPNyyFrbFd7nkO2ylJyEbBXj wjAGAvXgOQQowb1/lh2ftIuB6FwX/Ax2VfPpD/Pm0t7ncqwF02YrQ0EGaMlu+FIq/KBS paJCFGS/D9z2ZhEYrwcf+80cGN27XmVUPqTQoCM9BaeqMJfpaWeF1XjUbE8JwCyXTdQj SkAoBqvTcnFvQ0Reupyn4SjhjKb421P+y+E+FG7EvRGFTnYghhcCqChKJzfeqnq78Fyd A5TsOKQgnhaxq9jEQDrGsq3qhMHc84/cYuZEivFwYPx9sxt9iajFu9MTEvttnZRXyKmu lpjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1si48489159plt.79.2019.04.16.09.03.07; Tue, 16 Apr 2019 09:03:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730062AbfDPQCH (ORCPT + 99 others); Tue, 16 Apr 2019 12:02:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41336 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730046AbfDPQCG (ORCPT ); Tue, 16 Apr 2019 12:02:06 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1FB78667B; Tue, 16 Apr 2019 16:02:05 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74FBC5D71B; Tue, 16 Apr 2019 16:02:03 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Andi Kleen , Adrian Hunter , Song Liu , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH 10/12] perf tools: Keep zero in pgoff bpf map Date: Tue, 16 Apr 2019 18:01:25 +0200 Message-Id: <20190416160127.30203-11-jolsa@kernel.org> In-Reply-To: <20190416160127.30203-1-jolsa@kernel.org> References: <20190416160127.30203-1-jolsa@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 16 Apr 2019 16:02:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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-nqgyzbqgekvxqc5tjmsb3da2@git.kernel.org Signed-off-by: Jiri Olsa --- 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