libbpf: Add getter for program size
authorToke Høiland-Jørgensen <toke@redhat.com>
Sat, 9 Nov 2019 20:37:32 +0000 (21:37 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 11 Nov 2019 03:26:30 +0000 (19:26 -0800)
commit1a734efe06948c17122808f74f0c8cc550c10cf5
tree051f5faf97bf712570b11f65b035a812daab7703
parent473f4e133a12dd083bae044ba1782be4767177c1
libbpf: Add getter for program size

This adds a new getter for the BPF program size (in bytes). This is useful
for a caller that is trying to predict how much memory will be locked by
loading a BPF object into the kernel.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/157333185272.88376.10996937115395724683.stgit@toke.dk
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/lib/bpf/libbpf.map