[PATCH] D106622: [BPF] support btf_tag attribute in .BTF section

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 17:39:29 PDT 2021


yonghong-song created this revision.
yonghong-song added reviewers: ast, anakryiko.
Herald added a subscriber: hiraditya.
yonghong-song requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

A new kind BTF_KIND_TAG is added to .BTF to encode
btf_tag attributes. The format looks like

  CommonType.name : attribute string
  CommonType.type : attached to a struct/union/func/func_proto/var.
  CommonType.info : encoding BTF_KIND_TAG
                    kflag bit to indicate the attribute is
                    for CommonType.type, or for struct/union member
                    or func_proto argument.
  one uint32_t    : to encode which member/argument starting from 0.

If one particular type or member/argument has more than one attribute,
multiple BTF_KIND_TAG will be generated.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106622

Files:
  llvm/lib/Target/BPF/BTF.def
  llvm/lib/Target/BPF/BTF.h
  llvm/lib/Target/BPF/BTFDebug.cpp
  llvm/lib/Target/BPF/BTFDebug.h
  llvm/test/CodeGen/BPF/BTF/tag-1.ll
  llvm/test/CodeGen/BPF/BTF/tag-2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106622.361045.patch
Type: text/x-patch
Size: 17288 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210723/4805bc8c/attachment.bin>


More information about the llvm-commits mailing list