Re: [PATCH v2 bpf-next 6/7] bpf: add BPF ringbuf and perf buffer benchmarks

2020-05-22 Thread Andrii Nakryiko
On Thu, May 21, 2020 at 6:21 PM Alexei Starovoitov wrote: > > On Sun, May 17, 2020 at 12:57:26PM -0700, Andrii Nakryiko wrote: > > + > > +static inline int roundup_len(__u32 len) > > +{ > > + /* clear out top 2 bits */ > > + len <<= 2; > > + len >>= 2; > > + /* add length prefix */

Re: [PATCH v2 bpf-next 6/7] bpf: add BPF ringbuf and perf buffer benchmarks

2020-05-21 Thread Alexei Starovoitov
On Sun, May 17, 2020 at 12:57:26PM -0700, Andrii Nakryiko wrote: > + > +static inline int roundup_len(__u32 len) > +{ > + /* clear out top 2 bits */ > + len <<= 2; > + len >>= 2; > + /* add length prefix */ > + len += RINGBUF_META_LEN; > + /* round up to 8 byte alignment */

[PATCH v2 bpf-next 6/7] bpf: add BPF ringbuf and perf buffer benchmarks

2020-05-17 Thread Andrii Nakryiko
Extend bench framework with ability to have benchmark-provided child argument parser for custom benchmark-specific parameters. This makes bench generic code modular and independent from any specific benchmark. Also implement a set of benchmarks for new BPF ring buffer and existing perf buffer. 4 b