diff options
author | Yonghong Song <yhs@fb.com> | 2021-10-21 12:56:43 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-10-22 17:04:44 -0700 |
commit | 8c18ea2d2c2913c80d8700c8bc8fe8568b8650a1 (patch) | |
tree | 5567db7d9e17a6ca1a19db1a6ce91a0f42c73dc6 /Documentation/bpf | |
parent | 557c8c480401457d885bf7a82221dcc877692aa7 (diff) | |
download | lwn-8c18ea2d2c2913c80d8700c8bc8fe8568b8650a1.tar.gz lwn-8c18ea2d2c2913c80d8700c8bc8fe8568b8650a1.zip |
selftests/bpf: Add BTF_KIND_DECL_TAG typedef example in tag.c
Change value type in progs/tag.c to a typedef with a btf_decl_tag.
With `bpftool btf dump file tag.o`, we have
...
[14] TYPEDEF 'value_t' type_id=17
[15] DECL_TAG 'tag1' type_id=14 component_idx=-1
[16] DECL_TAG 'tag2' type_id=14 component_idx=-1
[17] STRUCT '(anon)' size=8 vlen=2
'a' type_id=2 bits_offset=0
'b' type_id=2 bits_offset=32
...
The btf_tag selftest also succeeded:
$ ./test_progs -t tag
#21 btf_tag:OK
Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211021195643.4020315-1-yhs@fb.com
Diffstat (limited to 'Documentation/bpf')
0 files changed, 0 insertions, 0 deletions