Re: [PATCH bpf-next 2/5] bpf: Add a bpf_snprintf helper

2021-03-23 Thread Florent Revest
On Tue, Mar 23, 2021 at 4:21 AM Alexei Starovoitov wrote: > > On Wed, Mar 10, 2021 at 11:02:08PM +0100, Florent Revest wrote: > > > > +struct bpf_snprintf_buf { > > + char buf[MAX_SNPRINTF_MEMCPY][MAX_SNPRINTF_STR_LEN]; > > +}; > > +static DEFINE_PER_CPU(struct bpf_snprintf_buf, bpf_snprintf_b

Re: [PATCH bpf-next 2/5] bpf: Add a bpf_snprintf helper

2021-03-22 Thread Alexei Starovoitov
On Wed, Mar 10, 2021 at 11:02:08PM +0100, Florent Revest wrote: > > +struct bpf_snprintf_buf { > + char buf[MAX_SNPRINTF_MEMCPY][MAX_SNPRINTF_STR_LEN]; > +}; > +static DEFINE_PER_CPU(struct bpf_snprintf_buf, bpf_snprintf_buf); > +static DEFINE_PER_CPU(int, bpf_snprintf_buf_used); > + > +BPF_C

Re: [PATCH bpf-next 2/5] bpf: Add a bpf_snprintf helper

2021-03-16 Thread Florent Revest
On Tue, Mar 16, 2021 at 2:25 AM Andrii Nakryiko wrote: > > On Wed, Mar 10, 2021 at 2:02 PM Florent Revest wrote: > > > > The implementation takes inspiration from the existing bpf_trace_printk > > helper but there are a few differences: > > > > To allow for a large number of format-specifiers, pa

Re: [PATCH bpf-next 2/5] bpf: Add a bpf_snprintf helper

2021-03-15 Thread Andrii Nakryiko
On Wed, Mar 10, 2021 at 2:02 PM Florent Revest wrote: > > The implementation takes inspiration from the existing bpf_trace_printk > helper but there are a few differences: > > To allow for a large number of format-specifiers, parameters are > provided in an array, like in bpf_seq_printf. > > Becau

Re: [PATCH bpf-next 2/5] bpf: Add a bpf_snprintf helper

2021-03-10 Thread kernel test robot
Hi Florent, I love your patch! Perhaps something to improve: [auto build test WARNING on bpf-next/master] url: https://github.com/0day-ci/linux/commits/Florent-Revest/bpf-Add-a-ARG_PTR_TO_CONST_STR-argument-type/20210311-070306 base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-

Re: [PATCH bpf-next 2/5] bpf: Add a bpf_snprintf helper

2021-03-10 Thread kernel test robot
Hi Florent, I love your patch! Perhaps something to improve: [auto build test WARNING on bpf-next/master] url: https://github.com/0day-ci/linux/commits/Florent-Revest/bpf-Add-a-ARG_PTR_TO_CONST_STR-argument-type/20210311-070306 base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-

[PATCH bpf-next 2/5] bpf: Add a bpf_snprintf helper

2021-03-10 Thread Florent Revest
The implementation takes inspiration from the existing bpf_trace_printk helper but there are a few differences: To allow for a large number of format-specifiers, parameters are provided in an array, like in bpf_seq_printf. Because the output string takes two arguments and the array of parameters