Searched hist:"1 c6d28a6ac56de5b0af9239a1b02aea4c3011ea3" (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/kernel/bpf/ |
H A D | btf.c | diff 1c6d28a6ac56de5b0af9239a1b02aea4c3011ea3 Tue Aug 25 14:21:17 CDT 2020 Jiri Olsa <jolsa@kernel.org> bpf: Factor btf_struct_access function
Adding btf_struct_walk function that walks through the struct type + given offset and returns following values:
enum bpf_struct_walk_result { /* < 0 error */ WALK_SCALAR = 0, WALK_PTR, WALK_STRUCT, };
WALK_SCALAR - when SCALAR_VALUE is found WALK_PTR - when pointer value is found, its ID is stored in 'next_btf_id' output param WALK_STRUCT - when nested struct object is found, its ID is stored in 'next_btf_id' output param
It will be used in following patches to get all nested struct objects for given type and offset.
The btf_struct_access now calls btf_struct_walk function, as long as it gets nested structs as return value.
Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/20200825192124.710397-8-jolsa@kernel.org
|