]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: change logging calls from verbose() to bpf_log() and use log pointer
authorToke Høiland-Jørgensen <toke@redhat.com>
Fri, 25 Sep 2020 21:25:01 +0000 (23:25 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 29 Sep 2020 00:09:59 +0000 (17:09 -0700)
commita17678b65b2548c3dbfe0ecaad9e7dab0e5af3ad
treedbff90d25f49eb38e278dc0edc000c6e0a72d43a
parentfff57c1ff124908f736def20a1761b5ba38f9576
bpf: change logging calls from verbose() to bpf_log() and use log pointer

In preparation for moving code around, change a bunch of references to
env->log (and the verbose() logging helper) to use bpf_log() and a direct
pointer to struct bpf_verifier_log. While we're touching the function
signature, mark the 'prog' argument to bpf_check_type_match() as const.

Also enhance the bpf_verifier_log_needed() check to handle NULL pointers
for the log struct so we can re-use the code with logging disabled.

Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
include/linux/bpf_verifier.h
kernel/bpf/btf.c
kernel/bpf/verifier.c