diff options
author | Alan Maguire <alan.maguire@oracle.com> | 2020-09-28 12:31:09 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-09-28 18:26:58 -0700 |
commit | eb411377aed9e27835e77ee0710ee8f4649958f3 (patch) | |
tree | 90908f665c621d466093f55d1cbc4479e0dcd24a /kernel/bpf/core.c | |
parent | eb58bbf2e5c7917aa30bf8818761f26bbeeb2290 (diff) | |
download | linux-eb411377aed9e27835e77ee0710ee8f4649958f3.tar.gz linux-eb411377aed9e27835e77ee0710ee8f4649958f3.tar.bz2 linux-eb411377aed9e27835e77ee0710ee8f4649958f3.zip |
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
Diffstat (limited to 'kernel/bpf/core.c')
-rw-r--r-- | kernel/bpf/core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 403fb2341a86..c4ba45fa4fe1 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -2217,6 +2217,7 @@ const struct bpf_func_proto bpf_get_current_ancestor_cgroup_id_proto __weak; const struct bpf_func_proto bpf_get_local_storage_proto __weak; const struct bpf_func_proto bpf_get_ns_current_pid_tgid_proto __weak; const struct bpf_func_proto bpf_snprintf_btf_proto __weak; +const struct bpf_func_proto bpf_seq_printf_btf_proto __weak; const struct bpf_func_proto * __weak bpf_get_trace_printk_proto(void) { |