From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: Yonghong Song <yhs@meta.com>
Cc: bpf@vger.kernel.org, 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: Mon, 19 Dec 2022 18:27:32 +0100 [thread overview]
Message-ID: <87h6xrfgmz.fsf@oracle.com> (raw)
In-Reply-To: <757e5dde-75ed-80e2-9a34-ff7c2259de78@meta.com> (Yonghong Song's message of "Fri, 16 Dec 2022 17:38:50 -0800")
Hi Yonghong.
> 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.
I wonder, since these annotations are atomic, is there a reason for not
using an attribute instead of a DIE tag? Something like DW_AT_annotation.
The attribute could then be used by any DIE (declaration, type, ...) and
existing DWARF consumers that don't support the new attribute would
happily just ignore it.
next prev parent reply other threads:[~2022-12-19 17:23 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
2022-12-19 17:27 ` Jose E. Marchesi [this message]
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=87h6xrfgmz.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=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