Re: [PATCH pahole] dwarves: add __int128 types in base_type_name_to_size

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

 



Em Thu, Jan 10, 2019 at 11:39:06AM -0800, Yonghong Song escreveu:
> Added int128 types to dwarf base_type_name_to_size table
> so that the correct base type size can be retrieved in certain
> cases. Note that for type "unsigned __int128", the dwarf in gcc
> has type name "__int128 unsigned" while clang has
> "unsigned __int128".
> 
>   -bash-4.4$ cat t.c
>   struct t {
>         __int128 si128a;
>         __int128 si128b;
>         unsigned __int128 bits3:3;
>         unsigned __int128 bits80:80;
>         unsigned __int128 ui128;
>   } g;
>   -bash-4.4$ clang -O2 -c -g -target bpf -Xclang -target-feature -Xclang +dwarfris t.c
>   -bash-4.4$ pahole -F dwarf t.o
>   struct t {
>         __int128                   si128a;               /*     0    16 */
>         __int128                   si128b;               /*    16    16 */
>         unsigned __int128          bits3:3;              /*    32:125 16 */
>         unsigned __int128          bits80:80;            /*    32:45 16 */
> 
>         /* XXX 45 bits hole, try to pack */
> 
>         unsigned __int128          ui128;                /*    48    16 */
> 
>         /* size: 64, cachelines: 1, members: 5 */
>         /* bit holes: 1, sum bit holes: 45 bits */
>   };
>   -bash-4.4$ pahole -F btf t.o
>   struct t {
>         __int128                   si128a;               /*     0    16 */
>         __int128                   si128b;               /*    16    16 */
>         unsigned __int128          bits3:3;              /*    32:125 16 */
>         unsigned __int128          bits80:80;            /*    32:45 16 */
> 
>         /* XXX 45 bits hole, try to pack */
> 
>         unsigned __int128          ui128;                /*    48    16 */
> 
>         /* size: 64, cachelines: 1, members: 5 */
>         /* bit holes: 1, sum bit holes: 45 bits */
>   };

cool, at first I got briefly confused with the 32:125 16, part, but just
for a momentm its byte_offset:bit_offset byte_size, all is right, thanks
for the patch, applied!

Now its just a matter of combing cu__fixup_btf_bitfields() to figure out
the packed struct case...

- Arnaldo



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux