Re: [PATCH] selftests/bpf: Add ring_buffer__consume_n test.

2024-04-25 Thread Andrea Righi
On Thu, Apr 25, 2024 at 02:23:30PM +0200, Jiri Olsa wrote: > On Thu, Apr 25, 2024 at 08:19:04AM +0200, Andrea Righi wrote: > > On Sun, Apr 21, 2024 at 10:11:33PM +0200, Jiri Olsa wrote: > > ... > > > > static struct test_ringbuf_map_key_lskel *skel_map_key; > > > > +static struct

Re: [PATCH] selftests/bpf: Add ring_buffer__consume_n test.

2024-04-25 Thread Jiri Olsa
On Thu, Apr 25, 2024 at 08:19:04AM +0200, Andrea Righi wrote: > On Sun, Apr 21, 2024 at 10:11:33PM +0200, Jiri Olsa wrote: > ... > > > static struct test_ringbuf_map_key_lskel *skel_map_key; > > > +static struct test_ringbuf_n_lskel *skel_n; > > > > seems like there's no need for this to be

Re: [PATCH] selftests/bpf: Add ring_buffer__consume_n test.

2024-04-25 Thread Andrea Righi
On Sun, Apr 21, 2024 at 10:11:33PM +0200, Jiri Olsa wrote: ... > > static struct test_ringbuf_map_key_lskel *skel_map_key; > > +static struct test_ringbuf_n_lskel *skel_n; > > seems like there's no need for this to be static variable Can you elaborate more? I think we want these pointers to be

Re: [PATCH] selftests/bpf: Add ring_buffer__consume_n test.

2024-04-21 Thread Jiri Olsa
On Sat, Apr 20, 2024 at 05:59:04PM +0200, Andrea Righi wrote: > Add a testcase for the ring_buffer__consume_n() API. > > The test produces multiple samples in a ring buffer, using a > sys_getpid() fentry prog, and consumes them from user-space in batches, > rather than consuming all of them

[PATCH] selftests/bpf: Add ring_buffer__consume_n test.

2024-04-20 Thread Andrea Righi
Add a testcase for the ring_buffer__consume_n() API. The test produces multiple samples in a ring buffer, using a sys_getpid() fentry prog, and consumes them from user-space in batches, rather than consuming all of them greedily, like ring_buffer__consume() does. Link: