Re: [PATCH v2 bpf-next 6/7] libbpf: add BPF_CORE_READ/BPF_CORE_READ_INTO helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 3, 2019 at 1:35 PM Song Liu <liu.song.a23@xxxxxxxxx> wrote:
>
> On Wed, Oct 2, 2019 at 3:02 PM Andrii Nakryiko <andriin@xxxxxx> 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@xxxxxxxxx>
> > Signed-off-by: Andrii Nakryiko <andriin@xxxxxx>
> > ---
> >  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.

I made it consistent, thanks.

>
> There are multiple other instances below.
>
> Besides these.
>
> Acked-by: Song Liu <songliubraving@xxxxxx>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux