]> Git Repo - linux.git/commit - kernel/trace/Makefile
bpf: Use dedicated bpf_trace_printk event instead of trace_printk()
authorAlan Maguire <[email protected]>
Mon, 13 Jul 2020 11:52:33 +0000 (12:52 +0100)
committerAlexei Starovoitov <[email protected]>
Mon, 13 Jul 2020 23:55:49 +0000 (16:55 -0700)
commitac5a72ea5c8989871e61f6bb0852e0f91de51ebe
treedca6c9b98c6653937db455e2c6948e86e3274064
parent93776cb9ee91aeed43ba53dcec97ffed4ae6f1f7
bpf: Use dedicated bpf_trace_printk event instead of trace_printk()

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.

Signed-off-by: Steven Rostedt (VMware) <[email protected]>
Signed-off-by: Alan Maguire <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/bpf/[email protected]
kernel/trace/Makefile
kernel/trace/bpf_trace.c
kernel/trace/bpf_trace.h [new file with mode: 0644]
This page took 0.056417 seconds and 4 git commands to generate.