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
This commit is contained in:
Toke Høiland-Jørgensen
2019-11-09 21:37:32 +01:00
committed by Andrii Nakryiko
parent 26954e103d
commit 79b1d813f9
3 changed files with 9 additions and 0 deletions

View File

@@ -203,4 +203,5 @@ LIBBPF_0.0.6 {
bpf_program__get_type;
bpf_program__is_tracing;
bpf_program__set_tracing;
bpf_program__size;
} LIBBPF_0.0.5;