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)
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>

Trivial merge