Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/bpf: Add btf_dump__new to test_cpp

Adding btf_dump__new call to test_cpp, so we can
test C++ compilation with that.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20211223131736.483956-2-jolsa@kernel.org

authored by

Jiri Olsa and committed by
Andrii Nakryiko
ecf45e60 5652b807

+8 -1
+8 -1
tools/testing/selftests/bpf/test_cpp.cpp
··· 7 7 8 8 /* do nothing, just make sure we can link successfully */ 9 9 10 + static void dump_printf(void *ctx, const char *fmt, va_list args) 11 + { 12 + } 13 + 10 14 int main(int argc, char *argv[]) 11 15 { 16 + struct btf_dump_opts opts = { }; 12 17 struct test_core_extern *skel; 18 + struct btf *btf; 13 19 14 20 /* libbpf.h */ 15 21 libbpf_set_print(NULL); ··· 24 18 bpf_prog_get_fd_by_id(0); 25 19 26 20 /* btf.h */ 27 - btf__new(NULL, 0); 21 + btf = btf__new(NULL, 0); 22 + btf_dump__new(btf, dump_printf, nullptr, &opts); 28 23 29 24 /* BPF skeleton */ 30 25 skel = test_core_extern__open_and_load();