Re: BTF tag support in DWARF (notes for today's BPF Office Hours)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 1/5/23 10:30 AM, Jose E. Marchesi wrote:

We agreed in the meeting to implement Solution 2 below in both GCC and
clang.

The DW_TAG_LLVM_annotation DIE number will be changed in order to make
it possible for pahole to handle the current tags.  The number of the
new tag will be shared by both GCC and clang.

w.r.t c2x attribute syntax discussion in 01/19 office hour discussion.

I have checked clang c2x syntax w.r.t.
btf_type_tag and btf_decl_tag. They are both supported
with clang 15 and 16.

See:
https://clang.llvm.org/docs/AttributeReference.html

The c2x btf_decl_tag attr syntax is [[clang::btf_decl_tag("")]].
The c2x btf_type_tag attr syntax is [[clang::btf_type_tag("")]].

$ cat t.c
int [[clang::btf_type_tag("aa")]] * [[clang::btf_type_tag("bb")]] *f;
[[clang::btf_decl_tag("cc")]] int foo() { return 5; }
int bar() { return foo(); }
$ clang -std=c2x -g -O2 -c t.c
$ llvm-dwarfdump t.o | grep btf | grep tag
                  DW_AT_name    ("btf_type_tag")
                  DW_AT_name    ("btf_type_tag")
                  DW_AT_name    ("btf_decl_tag")

I double checked and the c2x syntax above generates the *same*
type IR and dwarf compared to __attribute__ style attributes.

[...]



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux