bpf: Make struct cgroup btf id global
authorYonghong Song <yhs@fb.com>
Wed, 26 Oct 2022 04:28:40 +0000 (21:28 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 26 Oct 2022 06:19:19 +0000 (23:19 -0700)
Make struct cgroup btf id global so later patch can reuse
the same btf id.

Acked-by: David Vernet <void@manifault.com>
Signed-off-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20221026042840.672602-1-yhs@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/btf_ids.h
kernel/bpf/cgroup_iter.c

index 2aea877..c9744ef 100644 (file)
@@ -265,5 +265,6 @@ MAX_BTF_TRACING_TYPE,
 };
 
 extern u32 btf_tracing_ids[];
+extern u32 bpf_cgroup_btf_id[];
 
 #endif
index 0d200a9..c6ffc70 100644 (file)
@@ -157,7 +157,7 @@ static const struct seq_operations cgroup_iter_seq_ops = {
        .show   = cgroup_iter_seq_show,
 };
 
-BTF_ID_LIST_SINGLE(bpf_cgroup_btf_id, struct, cgroup)
+BTF_ID_LIST_GLOBAL_SINGLE(bpf_cgroup_btf_id, struct, cgroup)
 
 static int cgroup_iter_seq_init(void *priv, struct bpf_iter_aux_info *aux)
 {