From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: Yonghong Song <yhs@meta.com>
Cc: bpf@vger.kernel.org, david.faust@oracle.com,
James Hilliard <james.hilliard1@gmail.com>,
Nick Desaulniers <ndesaulniers@google.com>,
David Malcolm <dmalcolm@redhat.com>,
Julia Lawall <julia.lawall@inria.fr>,
elena.zannoni@oracle.com
Subject: Re: BTF tag support in DWARF (notes for today's BPF Office Hours)
Date: Mon, 23 Jan 2023 16:50:11 +0100 [thread overview]
Message-ID: <873581i72k.fsf@oracle.com> (raw)
In-Reply-To: <f3963ae2-2a9c-b8b4-2b19-ebbcc7863b8d@meta.com> (Yonghong Song's message of "Sun, 22 Jan 2023 09:53:51 -0800")
> 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.
>
> [...]
Thanks for checking.
That matches our impression that C2X type attributes actually order the same
way than sparse type annotations, at least in the cases we are
interested on.
next prev parent reply other threads:[~2023-01-23 15:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-05 11:37 BTF tag support in DWARF (notes for today's BPF Office Hours) Jose E. Marchesi
2023-01-05 18:30 ` Jose E. Marchesi
2023-01-22 17:53 ` Yonghong Song
2023-01-23 15:50 ` Jose E. Marchesi [this message]
2023-01-23 18:43 ` David Faust
2023-01-24 7:37 ` Yonghong Song
2023-02-20 23:42 ` Eduard Zingerman
2023-02-21 19:38 ` David Faust
2023-02-21 22:57 ` Eduard Zingerman
2023-02-22 18:03 ` David Faust
2023-02-22 18:11 ` Alexei Starovoitov
2023-02-22 19:43 ` Eduard Zingerman
2023-02-27 21:13 ` Andrii Nakryiko
2023-02-28 0:41 ` Eduard Zingerman
2023-02-28 0:45 ` Andrii Nakryiko
2023-02-28 0:57 ` Eduard Zingerman
2023-02-28 2:44 ` Alexei Starovoitov
2023-02-28 5:28 ` Andrii Nakryiko
2023-02-28 6:53 ` Alexei Starovoitov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=873581i72k.fsf@oracle.com \
--to=jose.marchesi@oracle.com \
--cc=bpf@vger.kernel.org \
--cc=david.faust@oracle.com \
--cc=dmalcolm@redhat.com \
--cc=elena.zannoni@oracle.com \
--cc=james.hilliard1@gmail.com \
--cc=julia.lawall@inria.fr \
--cc=ndesaulniers@google.com \
--cc=yhs@meta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox