OSDN Git Service

Merge branch 'Bpf skeleton helper method'
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 8 Sep 2021 00:32:10 +0000 (17:32 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 8 Sep 2021 00:47:44 +0000 (17:47 -0700)
commitd6be5947efddb7e760cf1c1554f5a1049d7ca118
tree37c3235c409c14ced15e1a5eefc6b63f74783e98
parent03e601f48b2da6fb44d0f7b86957a8f6bacfb347
parent980a1a4c342f353a62d64174d0a6a9466a741273
Merge branch 'Bpf skeleton helper method'

Matt Smith says:

====================

This patch series changes the type of bpf_object_skeleton->data
to const void * and provides a helper method X__elf_bytes(size_t *sz)
for accessing the raw binary data of the compiled embedded BPF object.

The type change enforces the previously implied behavior of immutability
for this field while casting it to (void *) before assignment allows
for compiling with previous versions of the libbpf headers without
compiler warnings.

The helper method allows easier access to the BPF binary object data
and is leveraged to populate the skeleton field.  The inclusion of
this helper method will allow users to get access to the data without
needing to populate an entire skeleton first.

Checks are added in the third patch to validate the behavior of the
added method
====================

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>