diff options
| author | Paul Chaignon <paul.chaignon@gmail.com> | 2024-10-10 00:14:22 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-10-10 09:10:20 +0000 |
| commit | d44647df1f3b9d3b0e1ae15e2cd12ede672283fb (patch) | |
| tree | bcb482af8197733426a3a01b05ff55e91e83a307 /sys/linux | |
| parent | 3937a9e90d502451ef8555e1ed1eca08dd50da7b (diff) | |
sys/linux: describe new BTF types
Describe four new BTF types introduced in commits [1, 2, 3, 4]
upstream. Note BTF_KIND_TAG was later renamed to BTF_KIND_DECL_TAG.
These four types are also described in the documentation at [5].
1 - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b1828f0b04828
2 - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b5ea834dde6b6
3 - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8c42d2fa4eeab
4 - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6089fb325cf73
5 - https://docs.kernel.org/bpf/btf.html#btf-kind-float
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Diffstat (limited to 'sys/linux')
| -rw-r--r-- | sys/linux/bpf.txt | 50 | ||||
| -rw-r--r-- | sys/linux/bpf.txt.const | 4 |
2 files changed, 54 insertions, 0 deletions
diff --git a/sys/linux/bpf.txt b/sys/linux/bpf.txt index 9f856d70c..2f4a7bd50 100644 --- a/sys/linux/bpf.txt +++ b/sys/linux/bpf.txt @@ -671,6 +671,10 @@ btf_type [ func_proto btf_type_func_proto var btf_type_var datasec btf_type_datasec + float btf_type_float + decl_tag btf_type_decl_tag + type_tag btf_type_type_tag + enum64 btf_type_enum64 ] [varlen] btf_type_int { @@ -797,6 +801,52 @@ btf_var_secinfo { size int32 } +btf_float_size = 2, 4, 8, 12, 16 + +btf_type_float { + name_off btf_name_off + info_vlen const[0, int16] + info_pad const[0, int8] + info_typ const[BTF_KIND_FLOAT, int8] + size flags[btf_float_size, int32] +} + +btf_type_decl_tag { + name_off btf_name_off + info_vlen const[0, int16] + info_pad const[0, int8] + info_typ const[BTF_KIND_DECL_TAG, int8] + type btf_type_id +# -1 or the index of a struct field or function argument. + component_idx int32[-1:10] +} + +btf_type_type_tag { + name_off btf_name_off + info_vlen const[0, int16] + info_pad const[0, int8] + info_typ const[BTF_KIND_TYPE_TAG, int8] + type btf_type_id +} + +btf_enum64_sizes = 1, 2, 4, 8 + +btf_type_enum64 { + name_off btf_name_off + info_vlen len[enum64, int16] + info_pad const[0, int8] + info_typ const[BTF_KIND_ENUM64, int8:7] + info_kflag int8:1 + size flags[btf_enum64_sizes, int32] + enum64 array[btf_enum64] +} + +btf_enum64 { + name_off btf_name_off + val_lo32 int32 + val_hi32 int32 +} + bpf_btf_strings { z0 const[0, int8] data array[flags[bpf_btf_strings_elem, int8]] diff --git a/sys/linux/bpf.txt.const b/sys/linux/bpf.txt.const index 608d7bf3e..fe3cfdfbd 100644 --- a/sys/linux/bpf.txt.const +++ b/sys/linux/bpf.txt.const @@ -228,7 +228,10 @@ BTF_INT_SIGNED = 1 BTF_KIND_ARRAY = 3 BTF_KIND_CONST = 10 BTF_KIND_DATASEC = 15 +BTF_KIND_DECL_TAG = 17 BTF_KIND_ENUM = 6 +BTF_KIND_ENUM64 = 19 +BTF_KIND_FLOAT = 16 BTF_KIND_FUNC = 12 BTF_KIND_FUNC_PROTO = 13 BTF_KIND_FWD = 7 @@ -237,6 +240,7 @@ BTF_KIND_PTR = 2 BTF_KIND_RESTRICT = 11 BTF_KIND_STRUCT = 4 BTF_KIND_TYPEDEF = 8 +BTF_KIND_TYPE_TAG = 18 BTF_KIND_UNION = 5 BTF_KIND_VAR = 14 BTF_KIND_VOLATILE = 9 |
