diff options
author | Yonghong Song <yhs@fb.com> | 2020-05-09 20:59:12 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-05-10 03:05:26 +0300 |
commit | b121b341e5983bdccf7a5d6cf9236a45c965a31f (patch) | |
tree | cf9b12cb78f31f1be6df106598fcaf4874da1245 /scripts | |
parent | eaaacd23910f2d7c4b22d43f591002cc217d294b (diff) | |
download | linux-b121b341e5983bdccf7a5d6cf9236a45c965a31f.tar.xz |
bpf: Add PTR_TO_BTF_ID_OR_NULL support
Add bpf_reg_type PTR_TO_BTF_ID_OR_NULL support.
For tracing/iter program, the bpf program context
definition, e.g., for previous bpf_map target, looks like
struct bpf_iter__bpf_map {
struct bpf_iter_meta *meta;
struct bpf_map *map;
};
The kernel guarantees that meta is not NULL, but
map pointer maybe NULL. The NULL map indicates that all
objects have been traversed, so bpf program can take
proper action, e.g., do final aggregation and/or send
final report to user space.
Add btf_id_or_null_non0_off to prog->aux structure, to
indicate that if the context access offset is not 0,
set to PTR_TO_BTF_ID_OR_NULL instead of PTR_TO_BTF_ID.
This bit is set for tracing/iter program.
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200509175912.2476576-1-yhs@fb.com
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions