diff options
author | Yonghong Song <yhs@fb.com> | 2020-05-09 10:59:12 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-05-09 17:05:26 -0700 |
commit | b121b341e5983bdccf7a5d6cf9236a45c965a31f (patch) | |
tree | cf9b12cb78f31f1be6df106598fcaf4874da1245 /kernel/trace | |
parent | eaaacd23910f2d7c4b22d43f591002cc217d294b (diff) | |
download | linux-b121b341e5983bdccf7a5d6cf9236a45c965a31f.tar.gz linux-b121b341e5983bdccf7a5d6cf9236a45c965a31f.tar.bz2 linux-b121b341e5983bdccf7a5d6cf9236a45c965a31f.zip |
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 'kernel/trace')
0 files changed, 0 insertions, 0 deletions