diff options
author | Usama Arif | 2022-01-12 11:49:53 +0000 |
---|---|---|
committer | Andrii Nakryiko | 2022-01-14 16:47:34 -0800 |
commit | 71a3cdf80c0d12aadca6f9b0f5a43883649bdbea (patch) | |
tree | 0902e079e3c4875f6bf5255d42a56fc30d4e19a1 /crypto/cts.c | |
parent | 86c7ecad3bf83f6a03057b41b353a44b3a4c1f21 (diff) |
bpf/scripts: Raise an exception if the correct number of helpers are not generated
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 raises an
Exception 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@bytedance.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20220112114953.722380-1-usama.arif@bytedance.com
Diffstat (limited to 'crypto/cts.c')
0 files changed, 0 insertions, 0 deletions