libbpf: hide and discourage inconsistently named getters
authorAndrii Nakryiko <andrii@kernel.org>
Mon, 24 Jan 2022 19:42:48 +0000 (11:42 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 26 Jan 2022 01:59:06 +0000 (17:59 -0800)
commit20eccf29e2979a18411517061998bac7d12c8543
tree7278110d788a01aa163e4bc6fa4bc3ef1fc21ab0
parent74bb0f0c299cdc9c68cb3bc8f452e5812aa9eab0
libbpf: hide and discourage inconsistently named getters

Move a bunch of "getters" into libbpf_legacy.h to keep them there in
libbpf 1.0. See [0] for discussion of "Discouraged APIs". These getters
don't add any maintenance burden and are simple alias, but they are
inconsistent in naming. So keep them in libbpf_legacy.h instead of
libbpf.h to "hide" them in favor of preferred getters ([1]). Also add two
missing getters: bpf_program__type() and bpf_program__expected_attach_type().

  [0] https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0#handling-deprecation-of-apis-and-functionality
  [1] Closes: https://github.com/libbpf/libbpf/issues/307

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20220124194254.2051434-2-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/btf.h
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/lib/bpf/libbpf.map
tools/lib/bpf/libbpf_internal.h
tools/lib/bpf/libbpf_legacy.h