Re: [RFC] libbpf: Allow to emit all dependent definitions

2019-10-15 Thread Jiri Olsa
On Tue, Oct 15, 2019 at 09:22:35AM -0700, Andrii Nakryiko wrote: > On Tue, Oct 15, 2019 at 6:03 AM Jiri Olsa wrote: > > > > Currently the bpf dumper does not emit definitions > > of pointers to structs. It only emits forward type > > declarations. > > > > Having 2 structs like: > > > >struct B

Re: [RFC] libbpf: Allow to emit all dependent definitions

2019-10-15 Thread Andrii Nakryiko
On Tue, Oct 15, 2019 at 6:03 AM Jiri Olsa wrote: > > Currently the bpf dumper does not emit definitions > of pointers to structs. It only emits forward type > declarations. > > Having 2 structs like: > >struct B { > int b; >}; > >struct A { > struct B *ptr; >}; > > the ca

[RFC] libbpf: Allow to emit all dependent definitions

2019-10-15 Thread Jiri Olsa
Currently the bpf dumper does not emit definitions of pointers to structs. It only emits forward type declarations. Having 2 structs like: struct B { int b; }; struct A { struct B *ptr; }; the call to btf_dump__dump_type(id = struct A) dumps: struct B; struct A {