All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 bpf-next 0/3] Bpf skeleton helper method
@ 2021-09-01 19:44 Matt Smith
  2021-09-01 19:44 ` [PATCH v2 bpf-next 1/3] libbpf: Change bpf_object_skelecton data field to const void* Matt Smith
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Matt Smith @ 2021-09-01 19:44 UTC (permalink / raw)
  To: bpf, ast, andriin, daniel, kernel-team; +Cc: Matt Smith

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

Matt Smith (3):
  libbpf: Change bpf_object_skelecton data field to const void*
  bpftool: Provide a helper method for accessing bpf binary data
  selftests/bpf: Add checks for X__elf_bytes skeleton helper

 tools/bpf/bpftool/gen.c                       | 39 ++++++++++++-------
 tools/lib/bpf/libbpf.h                        |  2 +-
 .../selftests/bpf/prog_tests/skeleton.c       |  7 ++++
 3 files changed, 32 insertions(+), 16 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-08  1:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 19:44 [PATCH v2 bpf-next 0/3] Bpf skeleton helper method Matt Smith
2021-09-01 19:44 ` [PATCH v2 bpf-next 1/3] libbpf: Change bpf_object_skelecton data field to const void* Matt Smith
2021-09-01 19:44 ` [PATCH v2 bpf-next 2/3] bpftool: Provide a helper method for accessing bpf binary data Matt Smith
2021-09-01 19:44 ` [PATCH v2 bpf-next 3/3] selftests/bpf: Add checks for X__elf_bytes skeleton helper Matt Smith
2021-09-08  1:02 ` [PATCH v2 bpf-next 0/3] Bpf skeleton helper method Andrii Nakryiko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.