Commit ecf45e60 authored by Jiri Olsa's avatar Jiri Olsa Committed by Andrii Nakryiko

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: default avatarJiri Olsa <jolsa@kernel.org>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20211223131736.483956-2-jolsa@kernel.org
parent 5652b807
...@@ -7,9 +7,15 @@ ...@@ -7,9 +7,15 @@
/* do nothing, just make sure we can link successfully */ /* do nothing, just make sure we can link successfully */
static void dump_printf(void *ctx, const char *fmt, va_list args)
{
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
struct btf_dump_opts opts = { };
struct test_core_extern *skel; struct test_core_extern *skel;
struct btf *btf;
/* libbpf.h */ /* libbpf.h */
libbpf_set_print(NULL); libbpf_set_print(NULL);
...@@ -18,7 +24,8 @@ int main(int argc, char *argv[]) ...@@ -18,7 +24,8 @@ int main(int argc, char *argv[])
bpf_prog_get_fd_by_id(0); bpf_prog_get_fd_by_id(0);
/* btf.h */ /* btf.h */
btf__new(NULL, 0); btf = btf__new(NULL, 0);
btf_dump__new(btf, dump_printf, nullptr, &opts);
/* BPF skeleton */ /* BPF skeleton */
skel = test_core_extern__open_and_load(); skel = test_core_extern__open_and_load();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment