]> 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)
commit66d2878480d3a565793d74090b9fe9734388a03c
treeb490138fcfb50121dbef61121adccbe6d546172b
parentc05da9dbcb9d63d4e172fdff367c75f5e7ec3112
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