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

2020-09-24 Thread Alexei Starovoitov
On Wed, Sep 23, 2020 at 06:46:24PM +0100, Alan Maguire wrote: > > +/* Chunk size we use in safe copy of data to be shown. */ > +#define BTF_SHOW_OBJ_SAFE_SIZE 256 sizeof(struct btf_show) == 472 It's allocated on stack and called from bpf prog. It's a leaf function, but it still wor

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

2020-09-23 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