diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2021-12-09 22:38:35 +0300 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2021-12-11 02:29:18 +0300 |
commit | b3ce907950350a58880b94fed2b6022f160b8b9a (patch) | |
tree | 077877ec876560290c69d4e499bd2971c450a600 /tools/lib/bpf/libbpf.map | |
parent | 2eda2145ebfc76569fd088f46356203fc0c785a1 (diff) | |
download | linux-b3ce907950350a58880b94fed2b6022f160b8b9a.tar.xz |
libbpf: Add per-program log buffer setter and getter
Allow to set user-provided log buffer on a per-program basis ([0]). This
gives great deal of flexibility in terms of which programs are loaded
with logging enabled and where corresponding logs go.
Log buffer set with bpf_program__set_log_buf() overrides kernel_log_buf
and kernel_log_size settings set at bpf_object open time through
bpf_object_open_opts, if any.
Adjust bpf_object_load_prog_instance() logic to not perform own log buf
allocation and load retry if custom log buffer is provided by the user.
[0] Closes: https://github.com/libbpf/libbpf/issues/418
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211209193840.1248570-8-andrii@kernel.org
Diffstat (limited to 'tools/lib/bpf/libbpf.map')
-rw-r--r-- | tools/lib/bpf/libbpf.map | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map index 08cdfe840436..4d483af7dba6 100644 --- a/tools/lib/bpf/libbpf.map +++ b/tools/lib/bpf/libbpf.map @@ -423,6 +423,8 @@ LIBBPF_0.6.0 { LIBBPF_0.7.0 { global: bpf_btf_load; + bpf_program__log_buf; bpf_program__log_level; + bpf_program__set_log_buf; bpf_program__set_log_level; }; |