Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BTF support for tracepoints defined in modules #2479

Merged
merged 2 commits into from
Apr 11, 2023

Commits on Apr 11, 2023

  1. BTF: allow dumping C defs from a single module

    Dumping C definitions from multiple kernel modules at once can introduce
    type redefinitions, hence it is not supported for now. On the other
    hand, we can support dumping from a single module since there should be
    no conflicts and it could help for some situations.
    
    This will enable BTF support for tracepoints defined in modules as
    tracepoints always need to dump C structs from BTF for ClangParser.
    viktormalik committed Apr 11, 2023
    Configuration menu
    Copy the full SHA
    abc4518 View commit details
    Browse the repository at this point in the history
  2. BTF support for tracepoints defined in modules

    For tracepoints defined in vmlinux, we support usage of BTF for type
    parsing which can automatically resolve types from tracepoint defs.
    Thanks to this feature, users do not have to include headers with
    necessary types manually.
    
    This commit enables the same for tracepoints defined in kernel modules.
    Since parsing BTF for modules is already supported for kfuncs, it is
    sufficient to add the tracepoint subsystem name to the list of modules.
    If the name of the subsystem does not correspond to a loaded module, it
    will be ignored.
    
    Note that this is only supported for single-subsystem tracepoints at the
    moment. The reason is that tracepoints require dumping of C definitions
    from BTF which is not possible for multiple modules at once (as it could
    introduce type redefinitions).
    viktormalik committed Apr 11, 2023
    Configuration menu
    Copy the full SHA
    8885911 View commit details
    Browse the repository at this point in the history