Libbpf userspace function btf__add_enum64
Append new BTF_KIND_ENUM64 type to BTF object.
Definition
int btf__add_enum64(struct btf *btf, const char *name, __u32 bytes_sz, bool is_signed);
Parameters
btf: pointer to astruct btfobjectname: name of the enum, can beNULLor empty for anonymous enums;bytes_sz: size of the enum, in bytes.is_signed: whether the enum values are signed or not.
Return
>0, type ID of newly added BTF type; <0, on error.
Usage
Enum initially has no enum values in it (and corresponds to enum forward declaration). Enumerator values can be added by btf__add_enum64_value immediately after btf__add_enum64 succeeds.
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome