Libbpf userspace function btf__add_datasec
Append new BTF_KIND_DATASEC
type to BTF object.
Definition
int btf__add_datasec(struct btf *btf, const char *name, __u32 byte_sz);
Parameters
btf
: pointer to astruct btf
objectname
: name of the data section, can't beNULL
or empty;byte_sz
: size of the data section, in bytes.
Return
>0
, type ID of newly added BTF type; <0
, on error.
Usage
Data section is initially empty. Variables info can be added with btf__add_datasec_var_info
calls, after btf__add_datasec
succeeds.
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome