From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9646BC33CB6 for ; Fri, 17 Jan 2020 21:55:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6C84B21D7D for ; Fri, 17 Jan 2020 21:55:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OnLlNnFl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729864AbgAQVzV (ORCPT ); Fri, 17 Jan 2020 16:55:21 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:40483 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbgAQVzU (ORCPT ); Fri, 17 Jan 2020 16:55:20 -0500 Received: by mail-qk1-f196.google.com with SMTP id c17so24212907qkg.7; Fri, 17 Jan 2020 13:55:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+4pHI0w4puOIIpTavEP0FpVLcc6fVlC+yRi0odac6wM=; b=OnLlNnFlbPtWmvDFs2w6DvsFAcLmX4osdXWnpFfZPRowiiSOFidqtvn4k2u4rLIuuS rF/yPQfyuO92gl/xCkfCpXQhreRs4Z16jFdJ7gqXHNElDQfyrsc0HL/3IN9Sr1Lxd2rX fYlgrCce6exsuKFtj8a+589HaBKHJJBES4oYJeBXK39cS/mTgBIGqc/6HnVVhhQOGG2M HztzIEHmga7AThmS6Ia+1dP6XpGDYE2eFxhcoJFNqKSQ26pxCcqpD2uadxIqt3a657Pf 3sFGOm7uBMbhq2LO3no2fegZ8oGQVlRKGqMaaYubMhkmUURagXEijme1TQNf0eO3NTpa wepw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+4pHI0w4puOIIpTavEP0FpVLcc6fVlC+yRi0odac6wM=; b=Py4YmjPsVFDEtKAGNWYasJdfmvj9i2GnyWzeop5ulNKi5HdeAmfyopACUx8zQzjgmR 9HOXbIbJS/Xvgy/dpEU8uxv/xgemJAodbd+YjboiF/nIxC30wqTAKFrWyzTbKLPen0ji wZXBTHrd91hDSoShuZLD7ObiAU17WAmHRsQjs7QLDgKDndwhiUneCoMz0sjU9zoGDGb3 4OY9Tc7lvZFDviAW4pbcALYTR1D75Yeii95i50g6yRBpAahL4c6IIb2Hc9mVhPGouSv+ 7evSLDmY66VeXTBo1UoiwUFzdHPaiOqPZjN4d+xhh2AOn0C28TDER1hrg32Jgcf0dBNg da+A== X-Gm-Message-State: APjAAAVF8urQGzYwt+gqvvGC5OQPfSlQ21dtMiKoG8IbQ1XKYrFOtPrR DjBPZKCR/VbwJkhJBh3v0mh82VHAGH3W+dDaNaI= X-Google-Smtp-Source: APXvYqyhURizCoo+zp6Z1+sd0yPDWV0kjzEW58vFdJBxM9dW4GSAxbE/uMh786GoN1L2/Dv2d+926KUAQfh9adUwYTE= X-Received: by 2002:a05:620a:5ae:: with SMTP id q14mr36688643qkq.437.1579298119693; Fri, 17 Jan 2020 13:55:19 -0800 (PST) MIME-Version: 1.0 References: <20200117212825.11755-1-kpsingh@chromium.org> In-Reply-To: <20200117212825.11755-1-kpsingh@chromium.org> From: Andrii Nakryiko Date: Fri, 17 Jan 2020 13:55:08 -0800 Message-ID: Subject: Re: [PATCH bpf-next v2] libbpf: Load btf_vmlinux only once per object. To: KP Singh Cc: open list , bpf , Brendan Jackman , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Anton Protopopov , Florent Revest Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 17, 2020 at 1:28 PM KP Singh wrote: > > From: KP Singh > > As more programs (TRACING, STRUCT_OPS, and upcoming LSM) use vmlinux > BTF information, loading the BTF vmlinux information for every program > in an object is sub-optimal. The fix was originally proposed in: > > https://lore.kernel.org/bpf/CAEf4BzZodr3LKJuM7QwD38BiEH02Cc1UbtnGpVkCJ00Mf+V_Qg@mail.gmail.com/ > > The btf_vmlinux is populated in the object if any of the programs in > the object requires it just before the programs are loaded and freed > after the programs finish loading. > > Reported-by: Andrii Nakryiko > Reviewed-by: Brendan Jackman > Signed-off-by: KP Singh > --- Looks great! Acked-by: Andrii Nakryiko > tools/lib/bpf/libbpf.c | 153 +++++++++++++++++++++++++++-------------- > 1 file changed, 101 insertions(+), 52 deletions(-) > [...]