Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1434659imc; Mon, 11 Mar 2019 13:46:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9qXpVmhlA88mDuA/1Vp5K9ZaPVMSToL8ApB//uMmMm4fF29yfhyBf8F7WmmyA//atAfKL X-Received: by 2002:a17:902:b20e:: with SMTP id t14mr35152195plr.97.1552337192684; Mon, 11 Mar 2019 13:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552337192; cv=none; d=google.com; s=arc-20160816; b=fSHQeAZftzM6SMHplalkwWHs2VSUaaLxWGydsOlL3+uabd5IqSrpTfkJO4rv2W6ljC 5K1vfuZ7xc5ZpyccV0l6QAU65TaAOgs8zjIj/JrC0LPq2wsCX7usQ6roRT7cx5BVvpDh iEv1uivmsw5xO2a6sbtdyj3F1QpZvWV0JSkNSYE9A3cYek04eASfIwPehRMYDUgWTdxu e022VjaZNoTzY75rxc51KBUD6fWP5NHgXzHdxzg/wuzJMnOwX8ricSMS8V1jp22zY3v/ 2oGt51603IbEHsvyc4Z7OWd4nsRc33A2mJDkJ2q9waihtGj3bXCWveyG/+rU+0R7yl8o yXsw== 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:from:references:cc:to:subject; bh=53QuUXoDB2TP6zVkbOAq2kIdGybFSn3ntA5+X++MyYg=; b=VwGk2Ja3482gIPp/mUESjWGzjEOfQyALIwNaSeVIYCwJ3rljjcTOPBmxpbLFVi/5KN TsioCNjyLXV+EYPn5mI/2KntuBQMeiHAOXBVJjbTmE0FTHKhWK1MTb+BDZ5HNwCvvVXP zkNP1QETqyGOIY188OYxoH5mlIONoNJfR0XERjjJ6nA/d8DFErxve+/FZROlWjBsHHhg 81Y5HzJsRjd5BeYeSP86m26zKKZEZin4+OgfbokTF6nvnjd+nq7Sx7qODpgr0XJi6aED YCnAgVppbCcO3A0DP8kHgzxp0nsGZ9YyZBVgW2g+KA3gXFEn4IxU8KihB05/mJNeSirU hg4w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t129si5854772pgc.525.2019.03.11.13.46.15; Mon, 11 Mar 2019 13:46:32 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727904AbfCKUpz (ORCPT + 99 others); Mon, 11 Mar 2019 16:45:55 -0400 Received: from www62.your-server.de ([213.133.104.62]:58078 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727304AbfCKUpy (ORCPT ); Mon, 11 Mar 2019 16:45:54 -0400 Received: from [88.198.220.130] (helo=sslproxy01.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1h3Rnz-00065F-F5; Mon, 11 Mar 2019 21:45:51 +0100 Received: from [178.197.248.21] (helo=linux.home) by sslproxy01.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1h3Rnz-0004mF-3B; Mon, 11 Mar 2019 21:45:51 +0100 Subject: Re: [PATCH v7 perf,bpf 02/15] bpf: libbpf: introduce bpf_program__get_prog_info_linear() To: Arnaldo Carvalho de Melo , Alexei Starovoitov , Song Liu Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ast@kernel.org, kernel-team@fb.com, peterz@infradead.org, acme@redhat.com, jolsa@kernel.org, namhyung@kernel.org References: <20190307175810.249857-1-songliubraving@fb.com> <20190307175810.249857-3-songliubraving@fb.com> <20190311182631.GX10690@kernel.org> From: Daniel Borkmann Message-ID: Date: Mon, 11 Mar 2019 21:45:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20190311182631.GX10690@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.2/25385/Mon Mar 11 08:43:35 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/11/2019 07:26 PM, Arnaldo Carvalho de Melo wrote: > Em Thu, Mar 07, 2019 at 09:57:57AM -0800, Song Liu escreveu: >> Currently, bpf_prog_info includes 9 arrays. The user has the option to >> fetch any combination of these arrays. However, this requires a lot of >> handling of these arrays. This work becomes more tricky when we need to >> store bpf_prog_info to a file, because these arrays are allocated >> independently. >> >> This patch introduces struct bpf_prog_info_linear, which stores arrays >> of bpf_prog_info in continues memory. Helper functions are introduced >> to unify the work to get different information of bpf_prog_info. >> Specifically, bpf_program__get_prog_info_linear() allows the user to >> select which arrays to fetch, and handles details for the user. >> >> Plesae see the comments before enum bpf_prog_info_array for more details >> and examples. >> >> Cc: Daniel Borkmann >> Cc: Alexei Starovoitov > > Daniel, are you ok with these changes to libbpf and bpftool? Perhaps > those should be detached from this patchkit and submitted sooner, > eroding the size of this kit. > > Alternatively, if you're ok with it, please provide your Acked-by and > I'll process as soon as I get back to it after Jiri is done reviewing. Overall looks okay. Are you planning to get these in for 5.1 window? If yes, that would be great, otherwise we might need to cherry-pick the libbpf and bpftool ones from your tree into bpf-next as well since there's just too much going on in this area where we'd potentially run into complex merge conflicts. In the latter case, libbpf.map would need to be fixed up to LIBBPF_0.0.3 as convention is that this is in line with kernel release. Thanks, Daniel > - Arnaldo