diff options
author | Jiri Olsa <jolsa@kernel.org> | 2020-07-11 23:53:23 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-07-13 10:42:02 -0700 |
commit | 5a2798ab32ba2952cfe25701ee460bccbd434c75 (patch) | |
tree | 129a8daa75fe60daa836cdf4de8a5418311de5a9 /kernel/bpf | |
parent | 33a57ce0a54d498275f432db04850001175dfdfa (diff) | |
download | linux-5a2798ab32ba2952cfe25701ee460bccbd434c75.tar.bz2 |
bpf: Add BTF_ID_LIST/BTF_ID/BTF_ID_UNUSED macros
Adding support to generate .BTF_ids section that will hold BTF
ID lists for verifier.
Adding macros that will help to define lists of BTF ID values
placed in .BTF_ids section. They are initially filled with zeros
(during compilation) and resolved later during the linking phase
by resolve_btfids tool.
Following defines list of one BTF ID value:
BTF_ID_LIST(bpf_skb_output_btf_ids)
BTF_ID(struct, sk_buff)
It also defines following variable to access the list:
extern u32 bpf_skb_output_btf_ids[];
The BTF_ID_UNUSED macro defines 4 zero bytes. It's used when we
want to define 'unused' entry in BTF_ID_LIST, like:
BTF_ID_LIST(bpf_skb_output_btf_ids)
BTF_ID(struct, sk_buff)
BTF_ID_UNUSED
BTF_ID(struct, task_struct)
Suggested-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Tested-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200711215329.41165-4-jolsa@kernel.org
Diffstat (limited to 'kernel/bpf')
0 files changed, 0 insertions, 0 deletions