]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Allow to augment system Kconfig through extra optional config
authorAndrii Nakryiko <andriin@fb.com>
Thu, 19 Dec 2019 00:28:35 +0000 (16:28 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 19 Dec 2019 01:33:36 +0000 (17:33 -0800)
commit53b6dbffac0da9cbd8f36ec3652e224eada1c78a
treeb490138fcfb50121dbef61121adccbe6d546172b
parentde8d9cf56ce453a2ff41289c5c74311671f5d2be
libbpf: Allow to augment system Kconfig through extra optional config

Instead of all or nothing approach of overriding Kconfig file location, allow
to extend it with extra values and override chosen subset of values though
optional user-provided extra config, passed as a string through open options'
.kconfig option. If same config key is present in both user-supplied config
and Kconfig, user-supplied one wins. This allows applications to more easily
test various conditions despite host kernel's real configuration. If all of
BPF object's __kconfig externs are satisfied from user-supplied config, system
Kconfig won't be read at all.

Simplify selftests by not needing to create temporary Kconfig files.

Suggested-by: Alexei Starovoitov <ast@fb.com>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191219002837.3074619-3-andriin@fb.com
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/testing/selftests/bpf/prog_tests/core_extern.c