lkml.org 
[lkml]   [2021]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] bpf: remove pointless code from bpf_do_trace_printk()
On Thu, Apr 22, 2021 at 8:35 AM Florent Revest <revest@chromium.org> wrote:
> >
> > I was having a stroll through lib/vsprintf.c and noticed bstr_printf:
> >
> > * This function like C99 vsnprintf, but the difference is that vsnprintf gets
> > * arguments from stack, and bstr_printf gets arguments from @bin_buf which is
> > * a binary buffer that generated by vbin_printf.
> >
> > Maybe it would be easier to just build our argument buffer similarly
> > to what vbin_printf does.
>
> I've been experimenting with this idea and it is quite promising :) it
> also makes the code much cleaner, I find. I'll send a series asap.

You mean to use bstr_printf internally ? That could work indeed.
Make sure CONFIG_BINARY_PRINTF is selected.
CONFIG_TRACING does it already.

> BPF maintainers: should we fix forward or do you prefer reverting the
> snprintf series and then re-applying another snprintf series without
> the regression in bpf_trace_printk that mangles some argument types ?
> (bpf_seq_printf has always been like that so no regression there)

Pls send it as a follow up.
Along with another patch to clean verifier bits we discussed.
The merge window is approaching, so it has to be done asap.

\
 
 \ /
  Last update: 2021-04-22 17:46    [W:0.058 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site