Re: [PATCH bpf-next 5/6] selftests/bpf: adjust CO-RE reloc tests for new BPF_CORE_READ macro

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

 



On Tue, Oct 1, 2019 at 12:14 PM John Fastabend <john.fastabend@xxxxxxxxx> wrote:
>
> Andrii Nakryiko wrote:
> > Given introduction of variadic BPF_CORE_READ with slightly different
> > syntax and semantics, define CORE_READ, which is a thin wrapper around
> > low-level bpf_core_read() macro, which in turn is just a wrapper around
> > bpf_probe_read(). BPF_CORE_READ is higher-level variadic macro
> > supporting multi-pointer reads and are tested separately.
> >
> > Signed-off-by: Andrii Nakryiko <andriin@xxxxxx>
> > ---
> >  .../bpf/progs/test_core_reloc_arrays.c         | 10 ++++++----
> >  .../bpf/progs/test_core_reloc_flavors.c        |  8 +++++---
> >  .../selftests/bpf/progs/test_core_reloc_ints.c | 18 ++++++++++--------
> >  .../bpf/progs/test_core_reloc_kernel.c         |  6 ++++--
> >  .../selftests/bpf/progs/test_core_reloc_misc.c |  8 +++++---
> >  .../selftests/bpf/progs/test_core_reloc_mods.c | 18 ++++++++++--------
> >  .../bpf/progs/test_core_reloc_nesting.c        |  6 ++++--
> >  .../bpf/progs/test_core_reloc_primitives.c     | 12 +++++++-----
> >  .../bpf/progs/test_core_reloc_ptr_as_arr.c     |  4 +++-
> >  9 files changed, 54 insertions(+), 36 deletions(-)
> >
>
> Starting to get many layers of macros here but makes sense here.

Yeah, a bit. I was considering to either switch to bpf_core_read()
with explicit sizeof or making bpf_core_read() deriving sizeof(), but
didn't because:

1. wanted to keep bpf_core_read() a direct "substitute" for bpf_probe_read()
2. figured one copy-pasted #define for each of few files is small
enough price for much more readable tests

>
> Acked-by: John Fastabend <john.fastabend@xxxxxxxxx>

Thanks for review!



[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