]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Deprecate bpf_objects_list
authorJoe Burton <jevburton@google.com>
Tue, 26 Oct 2021 22:35:28 +0000 (22:35 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 27 Oct 2021 18:00:12 +0000 (11:00 -0700)
commit4f39d075c5d01f5d1b0b0613005d7d939137776c
tree9b411fd28927651dbdd6ca144d8b8d410ab560c6
parent00a6cafb479d135ed54e483bd545095326419da3
libbpf: Deprecate bpf_objects_list

Add a flag to `enum libbpf_strict_mode' to disable the global
`bpf_objects_list', preventing race conditions when concurrent threads
call bpf_object__open() or bpf_object__close().

bpf_object__next() will return NULL if this option is set.

Callers may achieve the same workflow by tracking bpf_objects in
application code.

  [0] Closes: https://github.com/libbpf/libbpf/issues/293

Signed-off-by: Joe Burton <jevburton@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211026223528.413950-1-jevburton.kernel@gmail.com
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/lib/bpf/libbpf_legacy.h