[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPhsuW4OOx6nDwPpzjXmnKRj6dBaXuF=GVjG6D4YmF_OWwsKcA@mail.gmail.com>
Date: Thu, 3 Oct 2019 13:35:46 -0700
From: Song Liu <liu.song.a23@...il.com>
To: Andrii Nakryiko <andriin@...com>
Cc: bpf <bpf@...r.kernel.org>, Networking <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...com>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii.nakryiko@...il.com>,
Kernel Team <kernel-team@...com>
Subject: Re: [PATCH v2 bpf-next 6/7] libbpf: add BPF_CORE_READ/BPF_CORE_READ_INTO
helpers
On Wed, Oct 2, 2019 at 3:02 PM Andrii Nakryiko <andriin@...com> wrote:
>
> Add few macros simplifying BCC-like multi-level probe reads, while also
> emitting CO-RE relocations for each read.
>
> Acked-by: John Fastabend <john.fastabend@...il.com>
> Signed-off-by: Andrii Nakryiko <andriin@...com>
> ---
> tools/lib/bpf/bpf_helpers.h | 143 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 143 insertions(+)
>
> diff --git a/tools/lib/bpf/bpf_helpers.h b/tools/lib/bpf/bpf_helpers.h
> index cb9d4d2224af..847dfd7125e4 100644
> --- a/tools/lib/bpf/bpf_helpers.h
> +++ b/tools/lib/bpf/bpf_helpers.h
> @@ -19,6 +19,10 @@
> */
> #define SEC(NAME) __attribute__((section(NAME), used))
>
> +#ifndef __always_inline
> +#define __always_inline __attribute__((always_inline))
> +#endif
> +
> /* helper functions called from eBPF programs written in C */
> static void *(*bpf_map_lookup_elem)(void *map, const void *key) =
> (void *) BPF_FUNC_map_lookup_elem;
> @@ -312,4 +316,143 @@ struct bpf_map_def {
> bpf_probe_read(dst, sz, \
> (const void *)__builtin_preserve_access_index(src))
>
> +/*
nit: extra /*.
Well, I actually don't have a strong preference with this. Just to highlight
we are mixing two styles, which we already do in current bpf_helpers.h.
There are multiple other instances below.
Besides these.
Acked-by: Song Liu <songliubraving@...com>
Powered by blists - more mailing lists