diff options
| author | Joe Burton <[email protected]> | 2021-10-26 22:35:28 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2021-10-27 18:00:12 +0000 |
| commit | 689624f037ce219d42312534eff4dc470b54dec4 (patch) | |
| tree | 9b411fd28927651dbdd6ca144d8b8d410ab560c6 /tools/lib/bpf/libbpf_legacy.h | |
| parent | selftests/bpf: Guess function end for test_get_branch_snapshot (diff) | |
| download | kernel-689624f037ce219d42312534eff4dc470b54dec4.tar.gz kernel-689624f037ce219d42312534eff4dc470b54dec4.zip | |
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 <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/libbpf_legacy.h')
| -rw-r--r-- | tools/lib/bpf/libbpf_legacy.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf_legacy.h b/tools/lib/bpf/libbpf_legacy.h index 29ccafab11a8..5ba5c9beccfa 100644 --- a/tools/lib/bpf/libbpf_legacy.h +++ b/tools/lib/bpf/libbpf_legacy.h @@ -57,6 +57,12 @@ enum libbpf_strict_mode { * function name instead of section name. */ LIBBPF_STRICT_SEC_NAME = 0x04, + /* + * Disable the global 'bpf_objects_list'. Maintaining this list adds + * a race condition to bpf_object__open() and bpf_object__close(). + * Clients can maintain it on their own if it is valuable for them. + */ + LIBBPF_STRICT_NO_OBJECT_LIST = 0x08, __LIBBPF_STRICT_LAST, }; |
