Re: [RFC PATCH bpf-next 1/2] bpf: share BTF "show" implementation between kernel and libbpf

2021-01-14 Thread Andrii Nakryiko
On Thu, Jan 14, 2021 at 7:37 AM Alan Maguire wrote: > > On Mon, 11 Jan 2021, Andrii Nakryiko wrote: > > > On Mon, Jan 11, 2021 at 9:34 AM Alan Maguire > > wrote: > > > Currently the only "show" function for userspace is to write the > > > representation of the typed data to a string via > > > >

Re: [RFC PATCH bpf-next 1/2] bpf: share BTF "show" implementation between kernel and libbpf

2021-01-14 Thread Alan Maguire
On Mon, 11 Jan 2021, Andrii Nakryiko wrote: > On Mon, Jan 11, 2021 at 9:34 AM Alan Maguire wrote: > > Currently the only "show" function for userspace is to write the > > representation of the typed data to a string via > > > > LIBBPF_API int > > btf__snprintf(struct btf *btf, char *buf, int len,

Re: [RFC PATCH bpf-next 1/2] bpf: share BTF "show" implementation between kernel and libbpf

2021-01-11 Thread Andrii Nakryiko
On Mon, Jan 11, 2021 at 9:34 AM Alan Maguire wrote: > > libbpf already supports a "dumper" API for dumping type information, > but there is currently no support for dumping typed _data_ via libbpf. > However this functionality does exist in the kernel, in part to > facilitate the bpf_snprintf_btf(

[RFC PATCH bpf-next 1/2] bpf: share BTF "show" implementation between kernel and libbpf

2021-01-11 Thread Alan Maguire
libbpf already supports a "dumper" API for dumping type information, but there is currently no support for dumping typed _data_ via libbpf. However this functionality does exist in the kernel, in part to facilitate the bpf_snprintf_btf() helper which dumps a string representation of the pointer pas