bpf: let kprobe programs use bpf_get_smp_processor_id() helper
authorAlexei Starovoitov <ast@plumgrid.com>
Sat, 13 Jun 2015 02:39:14 +0000 (19:39 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Jun 2015 22:53:50 +0000 (15:53 -0700)
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>
kernel/trace/bpf_trace.c

index 4f9b5d41869b320266b8902bd84270d34709df60..88a041adee901f5109c50e560cb5e13fc96f0357 100644 (file)
@@ -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;
        }