mbox series

[v2,bpf-next,0/3] libbpf: btf typed data dumping fixes (__int128 usage, error propagation)

Message ID 1626770993-11073-1-git-send-email-alan.maguire@oracle.com (mailing list archive)
Headers show
Series libbpf: btf typed data dumping fixes (__int128 usage, error propagation) | expand

Message

Alan Maguire July 20, 2021, 8:49 a.m. UTC
This series aims to resolve further issues with the BTF typed data
dumping interfaces in libbpf.

Compilation failures with use of __int128 on 32-bit platforms were
reported [1].  As a result, the use of __int128 in libbpf typed data
dumping is replaced with __u64 usage for bitfield manipulations.
In the case of 128-bit integer values, they are simply split into
two 64-bit hex values for display (patch 1).

Tests are added for __int128 display in patch 2, using conditional
compilation to avoid problems with a lack of __int128 support.

Patch 3 resolves an issue Andrii noted about error propagation
when handling enum data display.

More followup work is required to ensure multi-dimensional char array
display works correctly.

[1] https://lore.kernel.org/bpf/1626362126-27775-1-git-send-email-alan.maguire@oracle.com/T/#mc2cb023acfd6c3cd0b661e385787b76bb757430d

Changes since v1:

 - added error handling for bitfield size > 64 bits by changing function
   signature for bitfield retrieval to return an int error value and to set
   bitfield value via a __u64 * argument (Andrii)

Alan Maguire (3):
  libbpf: avoid use of __int128 in typed dump display
  selftests/bpf: add __int128-specific tests for typed data dump
  libbpf: propagate errors when retrieving enum value for typed data
    display

 tools/lib/bpf/btf_dump.c                          | 103 ++++++++++++++--------
 tools/testing/selftests/bpf/prog_tests/btf_dump.c |  17 ++++
 2 files changed, 85 insertions(+), 35 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org July 20, 2021, 9 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (refs/heads/master):

On Tue, 20 Jul 2021 09:49:50 +0100 you wrote:
> This series aims to resolve further issues with the BTF typed data
> dumping interfaces in libbpf.
> 
> Compilation failures with use of __int128 on 32-bit platforms were
> reported [1].  As a result, the use of __int128 in libbpf typed data
> dumping is replaced with __u64 usage for bitfield manipulations.
> In the case of 128-bit integer values, they are simply split into
> two 64-bit hex values for display (patch 1).
> 
> [...]

Here is the summary with links:
  - [v2,bpf-next,1/3] libbpf: avoid use of __int128 in typed dump display
    https://git.kernel.org/bpf/bpf-next/c/a1d3cc3c5eca
  - [v2,bpf-next,2/3] selftests/bpf: add __int128-specific tests for typed data dump
    https://git.kernel.org/bpf/bpf-next/c/a17553dde294
  - [v2,bpf-next,3/3] libbpf: propagate errors when retrieving enum value for typed data display
    https://git.kernel.org/bpf/bpf-next/c/720c29fca9fb

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html