summaryrefslogtreecommitdiff
path: root/kernel/bpf/core.c
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@plumgrid.com>2015-06-13 05:39:13 +0300
committerDavid S. Miller <davem@davemloft.net>2015-06-16 01:53:50 +0300
commit0756ea3e85139d23a8148ebaa95411c2f0aa4f11 (patch)
tree16b702c8ca6da39fc16188f3bf767d238df8b5ff /kernel/bpf/core.c
parentffeedafbf0236f03aeb2e8db273b3e5ae5f5bc89 (diff)
downloadlinux-0756ea3e85139d23a8148ebaa95411c2f0aa4f11.tar.xz
bpf: allow networking programs to use bpf_trace_printk() for debugging
bpf_trace_printk() is a helper function used to debug eBPF programs. Let socket and TC programs use it as well. Note, it's DEBUG ONLY helper. If it's used in the program, the kernel will print warning banner to make sure users don't use it in production. Signed-off-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf/core.c')
-rw-r--r--kernel/bpf/core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 1fc45cc83076..c5bedc82bc1c 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -733,6 +733,10 @@ const struct bpf_func_proto bpf_ktime_get_ns_proto __weak;
const struct bpf_func_proto bpf_get_current_pid_tgid_proto __weak;
const struct bpf_func_proto bpf_get_current_uid_gid_proto __weak;
const struct bpf_func_proto bpf_get_current_comm_proto __weak;
+const struct bpf_func_proto * __weak bpf_get_trace_printk_proto(void)
+{
+ return NULL;
+}
/* Always built-in helper functions. */
const struct bpf_func_proto bpf_tail_call_proto = {