]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: add bpf_get_stack helper
authorYonghong Song <yhs@fb.com>
Sun, 29 Apr 2018 05:28:08 +0000 (22:28 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 29 Apr 2018 15:45:53 +0000 (08:45 -0700)
commitbc657c07e0469f39234424a156a7cd91b5fad5ec
treeb11a7c5682239958cc2089fbbb95f626df7b5b7c
parent7d2814975a4f72ccf8fafddd642dc504dc7d1b12
bpf: add bpf_get_stack helper

Currently, stackmap and bpf_get_stackid helper are provided
for bpf program to get the stack trace. This approach has
a limitation though. If two stack traces have the same hash,
only one will get stored in the stackmap table,
so some stack traces are missing from user perspective.

This patch implements a new helper, bpf_get_stack, will
send stack traces directly to bpf program. The bpf program
is able to see all stack traces, and then can do in-kernel
processing or send stack traces to user space through
shared map or bpf_perf_event_output.

Acked-by: Alexei Starovoitov <ast@fb.com>
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
include/linux/filter.h
include/uapi/linux/bpf.h
kernel/bpf/core.c
kernel/bpf/stackmap.c
kernel/bpf/verifier.c
kernel/trace/bpf_trace.c