]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Use static const fmt string in __bpf_printk
authorDave Marchevsky <davemarchevsky@fb.com>
Fri, 17 Sep 2021 18:29:07 +0000 (11:29 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 17 Sep 2021 21:02:05 +0000 (14:02 -0700)
commit23607c301d429add028021b3b97d5d71dca6a7e5
treefe11dc67b044b33bb16b5603bfe14652594fcc7e
parent970030ff01f8c7d4f80a2a1ee6766dc6fc835fac
libbpf: Use static const fmt string in __bpf_printk

The __bpf_printk convenience macro was using a 'char' fmt string holder
as it predates support for globals in libbpf. Move to more efficient
'static const char', but provide a fallback to the old way via
BPF_NO_GLOBAL_DATA so users on old kernels can still use the macro.

Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210917182911.2426606-6-davemarchevsky@fb.com
tools/lib/bpf/bpf_helpers.h