Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
You need to sign in or sign up before continuing.
  • linux
  • scripts
  • bpf_doc.py
Find file BlameHistoryPermalink
  • Usama Arif's avatar
    bpf/scripts: Raise an exception if the correct number of helpers are not generated · 71a3cdf8
    Usama Arif authored Jan 12, 2022
    
    
    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: default avatarUsama Arif <usama.arif@bytedance.com>
    Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
    Reviewed-by: default avatarQuentin Monnet <quentin@isovalent.com>
    Acked-by: default avatarSong Liu <songliubraving@fb.com>
    Link: https://lore.kernel.org/bpf/20220112114953.722380-1-usama.arif@bytedance.com
    71a3cdf8
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7