On Fri, Jul 10, 2020 at 7:25 AM Alan Maguire <alan.maguire@xxxxxxxxxx> wrote: > > The bpf helper bpf_trace_printk() uses trace_printk() under the hood. > This leads to an alarming warning message originating from trace > buffer allocation which occurs the first time a program using > bpf_trace_printk() is loaded. > > We can instead create a trace event for bpf_trace_printk() and enable > it in-kernel when/if we encounter a program using the > bpf_trace_printk() helper. With this approach, trace_printk() > is not used directly and no warning message appears. > > This work was started by Steven (see Link) and finished by Alan; added > Steven's Signed-off-by with his permission. > > Link: https://lore.kernel.org/r/20200628194334.6238b933@xxxxxxxxxxxxxxxx > Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx> > Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx> > --- LGTM. Acked-by: Andrii Nakryiko <andriin@xxxxxx> > kernel/trace/Makefile | 2 ++ > kernel/trace/bpf_trace.c | 41 ++++++++++++++++++++++++++++++++++++----- > kernel/trace/bpf_trace.h | 34 ++++++++++++++++++++++++++++++++++ > 3 files changed, 72 insertions(+), 5 deletions(-) > create mode 100644 kernel/trace/bpf_trace.h > [...]