]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Add bpf_seq_printf_btf helper
authorAlan Maguire <alan.maguire@oracle.com>
Mon, 28 Sep 2020 11:31:09 +0000 (12:31 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 29 Sep 2020 01:26:58 +0000 (18:26 -0700)
commit10b96a3e58067f57c2ed882a6e98ab836351daf6
tree90908f665c621d466093f55d1cbc4479e0dcd24a
parent19ef88377331d2f215b99a69a2a26762240be31e
bpf: Add bpf_seq_printf_btf helper

A helper is added to allow seq file writing of kernel data
structures using vmlinux BTF.  Its signature is

long bpf_seq_printf_btf(struct seq_file *m, struct btf_ptr *ptr,
                        u32 btf_ptr_size, u64 flags);

Flags and struct btf_ptr definitions/use are identical to the
bpf_snprintf_btf helper, and the helper returns 0 on success
or a negative error value.

Suggested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/1601292670-1616-8-git-send-email-alan.maguire@oracle.com
include/linux/btf.h
include/uapi/linux/bpf.h
kernel/bpf/btf.c
kernel/bpf/core.c
kernel/trace/bpf_trace.c
tools/include/uapi/linux/bpf.h