]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Initialize the bpf_seq_printf parameters array field by field
authorFlorent Revest <revest@chromium.org>
Mon, 19 Apr 2021 15:52:41 +0000 (17:52 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 19 Apr 2021 22:27:37 +0000 (15:27 -0700)
commit7427115eb5e69f32d4ea948e6986d5c66f13a4f4
tree6c622011982541acb65db2048999e6db1d4f3c9b
parentbc147c230e4802f4172514a077a97c7360c77ff6
libbpf: Initialize the bpf_seq_printf parameters array field by field

When initializing the __param array with a one liner, if all args are
const, the initial array value will be placed in the rodata section but
because libbpf does not support relocation in the rodata section, any
pointer in this array will stay NULL.

Fixes: 7bb5c99c7400 ("tools/libbpf: Add bpf_iter support")
Signed-off-by: Florent Revest <revest@chromium.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210419155243.1632274-5-revest@chromium.org
tools/lib/bpf/bpf_tracing.h