bpf: Use dedicated bpf_trace_printk event instead of trace_printk()
mainline inclusion from mainline-v5.9-rc1 commit ac5a72ea category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4PKDW CVE: NA -------------------------------- 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: NSteven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: NAlan Maguire <alan.maguire@oracle.com> Signed-off-by: NAlexei Starovoitov <ast@kernel.org> Acked-by: NAndrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/r/20200628194334.6238b933@oasis.local.home Link: https://lore.kernel.org/bpf/1594641154-18897-2-git-send-email-alan.maguire@oracle.com Signed-off-by: Liu Xinpeng <liuxp11@chinatelecom.cn> # openEuler_contributor Signed-off-by: Ctyun Kernel <ctyuncommiter01@chinatelecom.cn> # openEuler_contributor Signed-off-by: NPu Lehui <pulehui@huawei.com> Reviewed-by: NYang Jihong <yangjihong1@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
kernel/trace/bpf_trace.h
0 → 100644
想要评论请 注册 或 登录