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

bpf: add support for BTF_KIND_DECL_TAG typedef #1974

Closed
wants to merge 6 commits into from

Commits on Oct 23, 2021

  1. adding ci files

    Nobody committed Oct 23, 2021
    Copy the full SHA
    4e4551d View commit details
    Browse the repository at this point in the history
  2. bpf: add BTF_KIND_DECL_TAG typedef support

    The llvm patches ([1], [2]) added support to attach btf_decl_tag
    attributes to typedef declarations. This patch added
    support in kernel.
    
      [1] https://reviews.llvm.org/D110127
      [2] https://reviews.llvm.org/D112259
    
    Signed-off-by: Yonghong Song <yhs@fb.com>
    yonghong-song authored and Nobody committed Oct 23, 2021
    Copy the full SHA
    3306bff View commit details
    Browse the repository at this point in the history
  3. selftests/bpf: add BTF_KIND_DECL_TAG typedef unit tests

    Test good and bad variants of typedef BTF_KIND_DECL_TAG encoding.
    
    Signed-off-by: Yonghong Song <yhs@fb.com>
    yonghong-song authored and Nobody committed Oct 23, 2021
    Copy the full SHA
    9c1653c View commit details
    Browse the repository at this point in the history
  4. selftests/bpf: test deduplication for BTF_KIND_DECL_TAG typedef

    Add unit tests for deduplication of BTF_KIND_DECL_TAG to typedef types.
    Also changed a few comments from "tag" to "decl_tag" to match
    BTF_KIND_DECL_TAG enum value name.
    
    Signed-off-by: Yonghong Song <yhs@fb.com>
    yonghong-song authored and Nobody committed Oct 23, 2021
    Copy the full SHA
    aa1c47b View commit details
    Browse the repository at this point in the history
  5. selftests/bpf: add BTF_KIND_DECL_TAG typedef example in tag.c

    Change value type in progs/tag.c to a typedef with a btf_decl_tag.
    With `bpftool btf dump file tag.o`, we have
      ...
      [14] TYPEDEF 'value_t' type_id=17
      [15] DECL_TAG 'tag1' type_id=14 component_idx=-1
      [16] DECL_TAG 'tag2' type_id=14 component_idx=-1
      [17] STRUCT '(anon)' size=8 vlen=2
            'a' type_id=2 bits_offset=0
            'b' type_id=2 bits_offset=32
      ...
    
    The btf_tag selftest also succeeded:
      $ ./test_progs -t tag
        #21 btf_tag:OK
        Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED
    
    Signed-off-by: Yonghong Song <yhs@fb.com>
    yonghong-song authored and Nobody committed Oct 23, 2021
    Copy the full SHA
    c9ab6c5 View commit details
    Browse the repository at this point in the history
  6. docs/bpf: update documentation for BTF_KIND_DECL_TAG typedef support

    Add BTF_KIND_DECL_TAG typedef support in btf.rst.
    
    Signed-off-by: Yonghong Song <yhs@fb.com>
    yonghong-song authored and Nobody committed Oct 23, 2021
    Copy the full SHA
    dbed823 View commit details
    Browse the repository at this point in the history