On Tue, 2024-05-28 at 16:19 -0700, Andrii Nakryiko wrote: [...] > > > > +LIBBPF_API int btf_dump__dump_one_type(struct btf_dump *d, __u32 id, bool fwd); > > > > > > not a fan of a name, how about we do `btf_dump__emit_type(struct > > > btf_dump *d, __u32 id, struct btf_dump_emit_type_opts *opts)` and have > > > forward declaration flag as options? We have > > > btf_dump__emit_type_decl(), this one could be called > > > btf_dump__emit_type_def() as well. WDYT? > > > > `btf_dump__emit_type_def` seems good and I can make it accept options > > with forward as a flag. > > > > However, in such a case the following is also a contender: > > > > struct btf_dump_type_opts { > > __u32 sz; > > bool skip_deps; /* flags picked so that by default */ > > bool forward_only; /* the behavior matches non-opts variant */ > > }; > > > > LIBBPF_API int btf_dump__dump_type_opts(struct btf_dump *d, __u32 id, > > struct btf_dump_type_opts *opts); > > > > > > I find this contender more ugly but a bit more consistent. > > Wdyt? > > You'll also need "skip_semicolon" which makes this even uglier. Which > is why I'd not do it as an extension to btf_dump__dump_type() API. Right, forgot about this one. Ok, let's make it `btf_dump__emit_type_def`, thank you.