Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3898636yba; Tue, 16 Apr 2019 23:38:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3dOBOm3mPrEyxVDu0t68+FtpryKa1aXyikrJ2vvWDUV2FgWCZyuL2WxrwAOnDQSRHv14v X-Received: by 2002:a17:902:b713:: with SMTP id d19mr87836032pls.54.1555483086612; Tue, 16 Apr 2019 23:38:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555483086; cv=none; d=google.com; s=arc-20160816; b=oVxXLvPRMZ6xqSnLO1AV2QCKZJ0ObHYoRqYxxyEPubXMq+4mDp9LPPXoBJ4qQ2++2l MQ3WKogAbqzjToKpOJpPm5tZ/Lm9+AkkwEwfwUM13QnTWvEY3eKvF2XVfIjFx7Br9Kox uZVoe0eIXK+0RbLRk+ctmcLTpM005ib6hs0CcqZQ5sjKB8AbfBQYuk1vdDW6uuoFsPl0 2HMtspQVkD95jPHqVylLptIkv0fxQS0QSUX5Clf46X0WhWD/nX+AEpvzwDi38O5B+F0A oHX2uLbUgI63V5DE+GSrE0M69Y0sF1LZnZ1ZhJrEenhro9uKWxzP2YqIGP+rymaZCWqa S8PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=XRKz9yl3q3CIXnKDMz5tFrnJqmjYEpvgS25BHWViYnc=; b=0cq9suKKWs5/1tSvDdwfk+V6ts7wAuYvSWXjxU9ZQqxJ+BRwexcfuXUwFYUa+KBk86 Il9xlSG1qb8/kMEkfUP54FwABNa4MdhViaIcUk0eHlDJW+wlZLz97Eins11C5VI03bFM 3p4yz/VDhDo2m40k5teE/+7RNz1ifaKJpkZgwgOgf0R0QcPEm05yOCtBKlSI9O0un2JD b1TA3Uo+6u+v3pLT3rNmp9srO6shYaf3MzueXMGyvwObBWg7/VjMfzCK85nuFZaheO+k JyGC4HLlDhAZXp1IRBt0KWYH8D9l54z02rjuicbniAWZj6m883FhXaTIzffsEXN9SOVo 3Ldw== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r15si49921046pgi.27.2019.04.16.23.37.50; Tue, 16 Apr 2019 23:38:06 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729366AbfDQGgy (ORCPT + 99 others); Wed, 17 Apr 2019 02:36:54 -0400 Received: from mga18.intel.com ([134.134.136.126]:49764 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbfDQGgy (ORCPT ); Wed, 17 Apr 2019 02:36:54 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Apr 2019 23:36:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,360,1549958400"; d="scan'208";a="165434092" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.198]) ([10.237.72.198]) by fmsmga001.fm.intel.com with ESMTP; 16 Apr 2019 23:36:51 -0700 Subject: Re: [PATCH 11/12] perf tools: Reuse shared eBPF dso objects To: Jiri Olsa , Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Andi Kleen , Song Liu , Alexei Starovoitov , Daniel Borkmann References: <20190416160127.30203-1-jolsa@kernel.org> <20190416160127.30203-12-jolsa@kernel.org> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <746f02e3-a509-5081-8427-b610e52c1fb0@intel.com> Date: Wed, 17 Apr 2019 09:35:32 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190416160127.30203-12-jolsa@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/04/19 7:01 PM, Jiri Olsa wrote: > The eBPF program can be loaded multiple times > with the same name (tag). We can share dso > objects for those programs. Doesn't a eBPF program get recompiled differently every time it is loaded? > > Link: http://lkml.kernel.org/n/tip-3damf8vq1dryhtpbk5b06jpt@git.kernel.org > Signed-off-by: Jiri Olsa > --- > tools/perf/util/machine.c | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c > index d4aa44489011..a60653827891 100644 > --- a/tools/perf/util/machine.c > +++ b/tools/perf/util/machine.c > @@ -23,6 +23,7 @@ > #include "linux/hash.h" > #include "asm/bug.h" > #include "bpf-event.h" > +#include "dso.h" > > #include "sane_ctype.h" > #include > @@ -699,11 +700,18 @@ static int machine__process_ksymbol_register(struct machine *machine, > > map = map_groups__find(&machine->kmaps, event->ksymbol_event.addr); > if (!map) { > - map = dso__new_map(event->ksymbol_event.name); > - if (!map) > + struct dso *dso; > + > + dso = dsos__findnew(&machine->dsos, event->ksymbol_event.name); > + if (!dso) > return -ENOMEM; > > - map->start = event->ksymbol_event.addr; > + map = map__new2(event->ksymbol_event.addr, dso); > + if (!map) { > + dso__put(dso); > + return -ENOMEM; > + } > + > map->end = map->start + event->ksymbol_event.len; > map_groups__insert(&machine->kmaps, map); > } >