OSDN Git Service

libbpf: Avoid use of __int128 in typed dump display
authorAlan Maguire <alan.maguire@oracle.com>
Tue, 20 Jul 2021 08:49:51 +0000 (09:49 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 20 Jul 2021 20:49:25 +0000 (13:49 -0700)
commita1d3cc3c5eca598cfabee3a35f30f34fbe2f709b
treeb5120416c8e843e2c0c120a5d60d7de71d5036b1
parent875fc315dbc3cdd3a5cab57b2bb7c1976ec8df44
libbpf: Avoid use of __int128 in typed dump display

__int128 is not supported for some 32-bit platforms (arm and i386).
__int128 was used in carrying out computations on bitfields which
aid display, but the same calculations could be done with __u64
with the small effect of not supporting 128-bit bitfields.

With these changes, a big-endian issue with casting 128-bit integers
to 64-bit for enum bitfields is solved also, as we now use 64-bit
integers for bitfield calculations.

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/1626770993-11073-2-git-send-email-alan.maguire@oracle.com
tools/lib/bpf/btf_dump.c