[PATCH] D143967: [DebugInfo][BPF] Add 'btf:type_tag' annotation in DWARF

Yonghong Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 2 09:16:47 PDT 2023


yonghong-song added a comment.

Related to `btf_type_is_modifier()` issue, Not that depending on call site, sometimes typedef is skipped and sometimes are not. So we could keep btf_type_is_modifier() as is and modify the call size to not skip typedef in specific places. Or we could remove typedef from the function and add a 'or' in call side if typedef needs to be skipped. The following are a few examples in kernel/bpf/btf.c:

/* Similar to btf_type_skip_modifiers() but does not skip typedefs. */
static const struct btf_type *btf_type_skip_qualifiers(const struct btf *btf,

  u32 id)

{

  const struct btf_type *t = btf_type_by_id(btf, id);
  
  while (btf_type_is_modifier(t) &&
         BTF_INFO_KIND(t->info) != BTF_KIND_TYPEDEF) {
          t = btf_type_by_id(btf, t->type);
  }      
         
  return t;

}

So we can add necessary changes (in specific context) to make the btf_type_tag approach with this patch work without breaking backward compatibility.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143967/new/

https://reviews.llvm.org/D143967



More information about the cfe-commits mailing list