On 10/17/18 4:02 AM, Edward Cree wrote: > I think the BTF work needs to be better documented; at the moment the only way > to determine how BTF sections are structured is to read through the headers, > and cross-reference with the DWARF spec to guess at the semantics of various > fields. I've been working on adding BTF support to ebpf_asm, and finding > very frustrating the amount of guesswork required. > Therefore please make sure that each patch extending the BTF format includes > documentation patches describing both the layout and the semantics of the > new
Make sense. I will add some comments to describe the layout in patch #9. > extensions. For example in patch #9 there is no explanation of > btf_ext_header.line_info_off and btf_ext_header.line_info_len (they're not > even used by the code, so one cannot reverse-engineer it); while it's fairly > clear that they indicate the bounds of the line_info subsection, there is no The line_info field is added because it is implemented in llvm. I imported it to kernel tools directory to be compatible with what llvm generates although we did not process it yet. I will add a comment on this. In the long term, I guess we should add description of format etc. in Documentation/bpf directory like BTF.rst. > specification of what this subsection contains. > > -Ed >