Libbpf userspace function btf__add_field
Append new field for the current STRUCT
/UNION
type in BTF object.
Definition
int btf__add_field(struct btf *btf, const char *name, int field_type_id, __u32 bit_offset, __u32 bit_size);
Parameters
btf
: pointer to astruct btf
objectname
: name of the field, can beNULL
or empty for anonymous field;field_type_id
: type ID for the type describing field type;bit_offset
: bit offset of the start of the field within struct/union;bit_size
: bit size of a bitfield,0
for non-bitfield fields;
Return
0
, on success; <0
, on error.
Usage
Docs could be improved
This part of the docs is incomplete, contributions are very welcome
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome