libbpf: Clean up deprecated and legacy aliases
authorAndrii Nakryiko <andrii@kernel.org>
Tue, 16 Aug 2022 00:19:28 +0000 (17:19 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 17 Aug 2022 20:42:56 +0000 (22:42 +0200)
Remove three missed deprecated APIs that were aliased to new APIs:
bpf_object__unload, bpf_prog_attach_xattr and btf__load.

Also move legacy API libbpf_find_kernel_btf (aliased to
btf__load_vmlinux_btf) into libbpf_legacy.h.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Hao Luo <haoluo@google.com>
Link: https://lore.kernel.org/bpf/20220816001929.369487-4-andrii@kernel.org
tools/lib/bpf/bpf.c
tools/lib/bpf/btf.c
tools/lib/bpf/btf.h
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf_legacy.h

index e3a0bd7efa2fad76cff21c2cf73d3089a74bf634..1d49a035283653943a50b05d1f7c4a506367c7da 100644 (file)
@@ -641,11 +641,6 @@ int bpf_prog_attach_opts(int prog_fd, int target_fd,
        return libbpf_err_errno(ret);
 }
 
-__attribute__((alias("bpf_prog_attach_opts")))
-int bpf_prog_attach_xattr(int prog_fd, int target_fd,
-                         enum bpf_attach_type type,
-                         const struct bpf_prog_attach_opts *opts);
-
 int bpf_prog_detach(int target_fd, enum bpf_attach_type type)
 {
        const size_t attr_sz = offsetofend(union bpf_attr, replace_bpf_fd);
index 2d14f1a52d7aa8780f1a6696246165486270e7d6..361131518d637c145fcae530f7c5c5a9ca016b49 100644 (file)
@@ -1225,8 +1225,6 @@ int btf__load_into_kernel(struct btf *btf)
        return btf_load_into_kernel(btf, NULL, 0, 0);
 }
 
-int btf__load(struct btf *) __attribute__((alias("btf__load_into_kernel")));
-
 int btf__fd(const struct btf *btf)
 {
        return btf->fd;
index 583760df83b42081fc74a7a134e6042c587de6b9..ae543144ee308103071bdd6f6417120beb682aee 100644 (file)
@@ -116,7 +116,6 @@ LIBBPF_API struct btf *btf__parse_raw_split(const char *path, struct btf *base_b
 
 LIBBPF_API struct btf *btf__load_vmlinux_btf(void);
 LIBBPF_API struct btf *btf__load_module_btf(const char *module_name, struct btf *vmlinux_btf);
-LIBBPF_API struct btf *libbpf_find_kernel_btf(void);
 
 LIBBPF_API struct btf *btf__load_from_kernel_by_id(__u32 id);
 LIBBPF_API struct btf *btf__load_from_kernel_by_id_split(__u32 id, struct btf *base_btf);
index 21fc3fc7f44c575a41db74278538725650a9fadb..3ad139285fad0c5d625ad006e2895fcfec9914c8 100644 (file)
@@ -7263,8 +7263,6 @@ static int bpf_object_unload(struct bpf_object *obj)
        return 0;
 }
 
-int bpf_object__unload(struct bpf_object *obj) __attribute__((alias("bpf_object_unload")));
-
 static int bpf_object__sanitize_maps(struct bpf_object *obj)
 {
        struct bpf_map *m;
index 5b7e0155db6a5a9b8358100a98172632935fb333..1e1be467bede6db7821e2d41f0cef8eab56b03b8 100644 (file)
@@ -125,6 +125,8 @@ struct bpf_map;
 struct btf;
 struct btf_ext;
 
+LIBBPF_API struct btf *libbpf_find_kernel_btf(void);
+
 LIBBPF_API enum bpf_prog_type bpf_program__get_type(const struct bpf_program *prog);
 LIBBPF_API enum bpf_attach_type bpf_program__get_expected_attach_type(const struct bpf_program *prog);
 LIBBPF_API const char *bpf_map__get_pin_path(const struct bpf_map *map);