Re: [PATCH v2 bpf-next 2/7] bpf: move to generic BTF show support, apply it to seq files/strings

2020-05-18 Thread Yonghong Song
On 5/18/20 2:46 AM, Alan Maguire wrote: On Wed, 13 May 2020, Yonghong Song wrote: +struct btf_show { + u64 flags; + void *target; /* target of show operation (seq file, buffer) */ + void (*showfn)(struct btf_show *show, const char *fmt, ...); + const struct btf *b

Re: [PATCH v2 bpf-next 2/7] bpf: move to generic BTF show support, apply it to seq files/strings

2020-05-18 Thread Alan Maguire
On Wed, 13 May 2020, Yonghong Song wrote: > > > +struct btf_show { > > + u64 flags; > > + void *target; /* target of show operation (seq file, buffer) */ > > + void (*showfn)(struct btf_show *show, const char *fmt, ...); > > + const struct btf *btf; > > + /* below are used during iter

Re: [PATCH v2 bpf-next 2/7] bpf: move to generic BTF show support, apply it to seq files/strings

2020-05-13 Thread Yonghong Song
On 5/11/20 10:56 PM, Alan Maguire wrote: generalize the "seq_show" seq file support in btf.c to support a generic show callback of which we support two instances; the current seq file show, and a show with snprintf() behaviour which instead writes the type data to a supplied string. Both clas

[PATCH v2 bpf-next 2/7] bpf: move to generic BTF show support, apply it to seq files/strings

2020-05-11 Thread Alan Maguire
generalize the "seq_show" seq file support in btf.c to support a generic show callback of which we support two instances; the current seq file show, and a show with snprintf() behaviour which instead writes the type data to a supplied string. Both classes of show function call btf_type_show() with