From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: 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: Thu, 15 Dec 2022 23:14:37 +0100 [thread overview]
Message-ID: <87359ge2lu.fsf@oracle.com> (raw)
In-Reply-To: <87o7s4ece1.fsf@oracle.com> (Jose E. Marchesi's message of "Thu, 15 Dec 2022 19:43:18 +0100")
> 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.
Note that the non-pointed based types don't have to be basic types. The
limitation also impacts non-basic types that are not pointed to,
including pointer types themselves.
Therefore:
> : int * __tag1 * __tag2 h;
>
> - sparse
> + __tag1 applies to int*, __tag2 applies to int**
> : got int *[noderef] __tag1 *[addressable] [noderef] [toplevel] __tag2 h
> - clang
> + According to DWARF __tag1 applies to int*, no __tag2 (??).
> + According to BTF __tag1 applies to int*, no __tag2 (??).
> : DWARF
> : 0x00000023: DW_TAG_variable
> : DW_AT_name ("h")
> : DW_AT_type (0x0000002e "int **")
> :
> : 0x0000002e: DW_TAG_pointer_type
> : DW_AT_type (0x00000037 "int *")
> :
> : 0x00000033: DW_TAG_LLVM_annotation
> : DW_AT_name ("btf_type_tag")
> : DW_AT_const_value ("tag1")
> : BTF
> : [1] TYPE_TAG 'tag1' type_id=3
> : [2] PTR '(anon)' type_id=1
> : [3] PTR '(anon)' type_id=4
> : [4] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED
> : [5] VAR 'h' type_id=2, linkage=global
> :
> : 'h' -> ptr -> 'tag1' -> ptr -> int
In the example above, `tag2' doesn't appear in neither DWARF nor BTF
because the type int** isn't pointed itself, and as Yonghong mentioned
in the call, the implementation of btf_type_tag in clang ignores these
cases.
next prev parent reply other threads:[~2022-12-15 22:11 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 [this message]
2022-12-17 1:38 ` Yonghong Song
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=87359ge2lu.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 \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.