]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: btf: support proper non-jit func info
authorYonghong Song <yhs@fb.com>
Sun, 25 Nov 2018 07:20:44 +0000 (23:20 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 27 Nov 2018 01:57:10 +0000 (17:57 -0800)
commit6b686ad9e2b6b41f1449b4724085fc2e01a7fdf9
tree31feaf95b938fe8bc90e8749a90ab6050710518f
parent4ac61150fd2b869c67457c9d1d48415c8fda19ea
bpf: btf: support proper non-jit func info

Commit 42b7bb2cb848 ("bpf: Introduce bpf_func_info")
added bpf func info support. The userspace is able
to get better ksym's for bpf programs with jit, and
is able to print out func prototypes.

For a program containing func-to-func calls, the existing
implementation returns user specified number of function
calls and BTF types if jit is enabled. If the jit is not
enabled, it only returns the type for the main function.

This is undesirable. Interpreter may still be used
and we should keep feature identical regardless of
whether jit is enabled or not.
This patch fixed this discrepancy.

Fixes: 42b7bb2cb848 ("bpf: Introduce bpf_func_info")
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
include/linux/bpf_verifier.h
kernel/bpf/core.c
kernel/bpf/syscall.c
kernel/bpf/verifier.c