From: Yonghong Song <yhs@meta.com>
To: "Jose E. Marchesi" <jose.marchesi@oracle.com>, bpf@vger.kernel.org
Cc: david.faust@oracle.com, elena.zannoni@oracle.com,
David Malcolm <dmalcolm@redhat.com>,
Nick Desaulniers <ndesaulniers@google.com>,
Julia Lawall <julia.lawall@inria.fr>
Subject: Re: Follow up from the btf_type_tag discussion in the BPF office hours
Date: Fri, 16 Dec 2022 17:38:50 -0800 [thread overview]
Message-ID: <757e5dde-75ed-80e2-9a34-ff7c2259de78@meta.com> (raw)
In-Reply-To: <87o7s4ece1.fsf@oracle.com>
On 12/15/22 10:43 AM, Jose E. Marchesi wrote:
>
> Of the two problems discussed:
>
> 1. DW_TAG_LLVM_annotation not being able to denote annotations to
> non-pointed based types. clang currently ignores these instances.
>
> We discussed two possible options to deal with this:
> 1.1 To continue ignoring these cases in the front-end, keep the dwarf
> expressiveness limitation, and document it.
> 1.2 To change DW_TAG_LLVM_annotation so it behaves like a qualifier
> DIE (like const, volatile, etc.) so it can apply to any type.
Thanks for the detailed update. Yes, we do want to __tag behaving like
a qualifier.
Today clang only support 'base_type <type_tag> *' style of code.
But we are open to support non-pointer style of tagging like
'base_type <type_tag> global_var'. Because of this, the following
dwarf output should be adopted:
C: int __tag1 * __tag2 * p;
dwarf: ptr -> __tag2 --> ptr -> __tag1 -> int
or
C: int __tag1 g;
dwarf: var_g -> __tag1 --> int
The above format *might* require particular dwarf tools to add support
for __tag attribute. But I think it is a good thing in the long run
esp. if we might add support to non-pointer types. In current
implementation, dwarf tools can simply ignore the children of ptr
which they may already do it.
>
> 2. The ordering problem: sparse annotations order differently than
> GNU/C99 compiler attributes. Therefore translating 1-to-1 from
> sparse annotations to compiler attributes results in attributes with
> different syntax than normal compiler attributes.
>
> This was accepted in clang.
> But found resistance in GCC when we sent the first patch series.
>
> During the meeting we went thru several possible ways of dealing with
> this problem, but we didn't reach any conclusion on what to do, since
> the time ran out.
>
> We agreed to continue the discussion at the BPF office hours next 5
> January 2023.
>
> In the meanwhile, below in this email is a slightly updated version of
> the material used to go thru the topics during the discussion. If there
> is any mistake or if you see that our understanding of the
> problem/situation is not correct, please point it out. If you want to
> add more information, please do so by replying to this thread.
>
> Finally, it was agreed that we (GCC BPF hackers) would send Yonghong our
> github accounts so he can subscribe us to notifications in the llvm
> phabricator, so we can be aware of potentially ABI/breaking changes at
> the time they are discussed, and not afterwards scanning bpf@vger. I
> alredy sent him the information.
>
> Thank you for your time today. It is appreciated.
>
[...]
next prev parent reply other threads:[~2022-12-17 1:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-15 18:43 Follow up from the btf_type_tag discussion in the BPF office hours Jose E. Marchesi
2022-12-15 22:14 ` Jose E. Marchesi
2022-12-17 1:38 ` Yonghong Song [this message]
2022-12-19 17:27 ` Jose E. Marchesi
2022-12-28 4:49 ` Yonghong Song
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=757e5dde-75ed-80e2-9a34-ff7c2259de78@meta.com \
--to=yhs@meta.com \
--cc=bpf@vger.kernel.org \
--cc=david.faust@oracle.com \
--cc=dmalcolm@redhat.com \
--cc=elena.zannoni@oracle.com \
--cc=jose.marchesi@oracle.com \
--cc=julia.lawall@inria.fr \
--cc=ndesaulniers@google.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