On Tue, Jan 11, 2022 at 10:44 AM Usama Arif <usama.arif@xxxxxxxxxxxxx> wrote: > > Currently bpf_helper_defs.h and the bpf helpers man page are auto-generated > using function documentation present in bpf.h. If the documentation for the > helper is missing or doesn't follow a specific format for e.g. if a function > is documented as: > * long bpf_kallsyms_lookup_name( const char *name, int name_sz, int flags, u64 *res ) > instead of > * long bpf_kallsyms_lookup_name(const char *name, int name_sz, int flags, u64 *res) > (notice the extra space at the start and end of function arguments) > then that helper is not dumped in the auto-generated header and results in > an invalid call during eBPF runtime, even if all the code specific to the > helper is correct. > > This patch checks the number of functions documented within the header file > with those present as part of #define __BPF_FUNC_MAPPER and generates an > error in the header file and the man page if they don't match. It is not > needed with the currently documented upstream functions, but can help in > debugging when developing new helpers when there might be missing or > misformatted documentation. > > Signed-off-by: Usama Arif <usama.arif@xxxxxxxxxxxxx> Acked-by: Song Liu <songliubraving@xxxxxx> [...]