summaryrefslogtreecommitdiffstats
path: root/kernel/trace/bpf_trace.c
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@plumgrid.com>2015-06-12 19:39:14 -0700
committerDavid S. Miller <davem@davemloft.net>2015-06-15 15:53:50 -0700
commitab1973d3258aa8c40d153dc12bbb1aac56731e47 (patch)
tree6b4c9543550d114d75fad4362c6ef526a0d24b77 /kernel/trace/bpf_trace.c
parent0756ea3e85139d23a8148ebaa95411c2f0aa4f11 (diff)
downloadlinux-ab1973d3258aa8c40d153dc12bbb1aac56731e47.tar.gz
linux-ab1973d3258aa8c40d153dc12bbb1aac56731e47.tar.bz2
linux-ab1973d3258aa8c40d153dc12bbb1aac56731e47.zip
bpf: let kprobe programs use bpf_get_smp_processor_id() helper
It's useful to do per-cpu histograms. Suggested-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/trace/bpf_trace.c')
-rw-r--r--kernel/trace/bpf_trace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 4f9b5d41869b..88a041adee90 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -181,6 +181,8 @@ static const struct bpf_func_proto *kprobe_prog_func_proto(enum bpf_func_id func
return &bpf_get_current_comm_proto;
case BPF_FUNC_trace_printk:
return bpf_get_trace_printk_proto();
+ case BPF_FUNC_get_smp_processor_id:
+ return &bpf_get_smp_processor_id_proto;
default:
return NULL;
}