BPF Archive on lore.kernel.org
 help / color / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Song Liu <songliubraving@fb.com>,
	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
Subject: Re: [PATCH v7 perf,bpf 02/15] bpf: libbpf: introduce bpf_program__get_prog_info_linear()
Date: Tue, 12 Mar 2019 12:20:24 +0100
Message-ID: <ce92c091-e80d-a0c1-4aa0-987706c42b20@iogearbox.net> (raw)
In-Reply-To: <20190311205720.GD10690@kernel.org>

On 03/11/2019 09:57 PM, Arnaldo Carvalho de Melo wrote:
> Em Mon, Mar 11, 2019 at 09:45:49PM +0100, Daniel Borkmann escreveu:
>> 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 <daniel@iogearbox.net>
>>>> Cc: Alexei Starovoitov <ast@kernel.org>
>>>
>>> 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
> 
> I hope so.
> 
>> yes, that would be great, otherwise we might need to cherry-pick the libbpf
> 
> So I'll try and grab those for my next pull req to Ingo, this week,
> will add your Acked-by, ok?

Please do, thanks.

>> 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.
> 
> BTW, while running my build tests I had to add this to today's batch,
> should be trivial when merging, I think, ok?

That's fine as well, ack, lets shoot for getting it in during merge window
such that we don't need to duplicate these dependencies in bpf trees.

> commit dfcbc2f2994b8a3af3605a26dc29c07ad7378bf4
> Author: Arnaldo Carvalho de Melo <acme@redhat.com>
> Date:   Mon Mar 11 17:07:52 2019 -0300
> 
>     tools lib bpf: Fix the build by adding a missing stdarg.h include
>     
>     The libbpf_print_fn_t typedef uses va_list without including the header
>     where that type is defined, stdarg.h, breaking in places where we're
>     unlucky for that type not to be already defined by some previously
>     included header.
>     
>     Noticed while building on fedora 24 cross building tools/perf to the ARC
>     architecture using the uClibc C library:
>     
>       28 fedora:24-x-ARC-uClibc   : FAIL arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710
>     
>         CC       /tmp/build/perf/tests/llvm.o
>       In file included from tests/llvm.c:3:0:
>       /git/linux/tools/lib/bpf/libbpf.h:57:20: error: unknown type name 'va_list'
>             const char *, va_list ap);
>                           ^~~~~~~
>       /git/linux/tools/lib/bpf/libbpf.h:59:34: error: unknown type name 'libbpf_print_fn_t'
>        LIBBPF_API void libbpf_set_print(libbpf_print_fn_t fn);
>                                         ^~~~~~~~~~~~~~~~~
>       mv: cannot stat '/tmp/build/perf/tests/.llvm.o.tmp': No such file or directory
>     
>     Cc: Alexei Starovoitov <ast@kernel.org>
>     Cc: Daniel Borkmann <daniel@iogearbox.net>
>     Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
>     Cc: Jiri Olsa <jolsa@kernel.org>
>     Cc: Namhyung Kim <namhyung@kernel.org>
>     Cc: Quentin Monnet <quentin.monnet@netronome.com>
>     Cc: Stanislav Fomichev <sdf@google.com>
>     Cc: Yonghong Song <yhs@fb.com>
>     Fixes: a8a1f7d09cfc ("libbpf: fix libbpf_print")
>     Link: https://lkml.kernel.org/n/tip-5270n2quu2gqz22o7itfdx00@git.kernel.org
>     Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
> index b4652aa1a58a..aa1521a51687 100644
> --- a/tools/lib/bpf/libbpf.h
> +++ b/tools/lib/bpf/libbpf.h
> @@ -10,6 +10,7 @@
>  #ifndef __LIBBPF_LIBBPF_H
>  #define __LIBBPF_LIBBPF_H
>  
> +#include <stdarg.h>
>  #include <stdio.h>
>  #include <stdint.h>
>  #include <stdbool.h>
> 

Thanks,
Daniel

  reply index

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 17:57 [PATCH v7 perf,bpf 00/15] perf annotation of BPF programs Song Liu
2019-03-07 17:57 ` [PATCH v7 perf,bpf 01/15] perf, bpf: consider events with attr.bpf_event as side-band events Song Liu
2019-03-07 17:57 ` [PATCH v7 perf,bpf 02/15] bpf: libbpf: introduce bpf_program__get_prog_info_linear() Song Liu
2019-03-11 18:26   ` Arnaldo Carvalho de Melo
2019-03-11 20:45     ` Daniel Borkmann
2019-03-11 20:57       ` Arnaldo Carvalho de Melo
2019-03-12 11:20         ` Daniel Borkmann [this message]
2019-03-07 17:57 ` [PATCH v7 perf,bpf 03/15] bpf: bpftool: use bpf_program__get_prog_info_linear() in prog.c:do_dump() Song Liu
2019-03-07 17:57 ` [PATCH v7 perf,bpf 04/15] perf, bpf: synthesize bpf events with bpf_program__get_prog_info_linear() Song Liu
2019-03-07 17:58 ` [PATCH v7 perf,bpf 05/15] perf: change prototype of perf_event__synthesize_bpf_events() Song Liu
2019-03-07 17:58 ` [PATCH v7 perf,bpf 06/15] perf, bpf: save bpf_prog_info in a rbtree in perf_env Song Liu
2019-03-07 17:58 ` [PATCH v7 perf,bpf 07/15] perf, bpf: save bpf_prog_info information as headers to perf.data Song Liu
2019-03-11 17:56   ` Jiri Olsa
2019-03-11 18:05     ` Song Liu
2019-03-07 17:58 ` [PATCH v7 perf,bpf 08/15] perf, bpf: save btf in a rbtree in perf_env Song Liu
2019-03-07 17:58 ` [PATCH v7 perf,bpf 09/15] perf, bpf: save btf information as headers to perf.data Song Liu
2019-03-11 17:56   ` Jiri Olsa
2019-03-07 17:58 ` [PATCH v7 perf,bpf 10/15] perf-top: add option --no-bpf-event Song Liu
2019-03-07 17:58 ` [PATCH v7 perf,bpf 11/15] perf: add -lopcodes to feature-libbfd Song Liu
2019-03-07 23:26   ` Stanislav Fomichev
2019-03-07 23:47     ` Song Liu
2019-03-07 17:58 ` [PATCH v7 perf,bpf 12/15] perf, bpf: enable annotation of bpf program Song Liu
2019-03-11 17:56   ` Jiri Olsa
2019-03-11 18:04     ` Song Liu
2019-03-07 17:58 ` [PATCH v7 perf,bpf 13/15] perf, bpf: process PERF_BPF_EVENT_PROG_LOAD for annotation Song Liu
2019-03-07 17:58 ` [PATCH v7 perf,bpf 14/15] perf: introduce side band thread Song Liu
2019-03-11 17:57   ` Jiri Olsa
2019-03-07 17:58 ` [PATCH v7 perf,bpf 15/15] perf, bpf: save bpf_prog_info and btf of short living bpf programs Song Liu
2019-03-11 13:59 ` [PATCH v7 perf,bpf 00/15] perf annotation of BPF programs Jiri Olsa
2019-03-11 14:16   ` Song Liu

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ce92c091-e80d-a0c1-4aa0-987706c42b20@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=acme@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=arnaldo.melo@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=songliubraving@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

BPF Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/bpf/0 bpf/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 bpf bpf/ https://lore.kernel.org/bpf \
		bpf@vger.kernel.org
	public-inbox-index bpf

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.bpf


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git