projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5652b80
)
selftests/bpf: Add btf_dump__new to test_cpp
author
Jiri Olsa
<jolsa@redhat.com>
Thu, 23 Dec 2021 13:17:36 +0000
(14:17 +0100)
committer
Andrii Nakryiko
<andrii@kernel.org>
Thu, 23 Dec 2021 18:23:51 +0000
(10:23 -0800)
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
tools/testing/selftests/bpf/test_cpp.cpp
patch
|
blob
|
blame
|
history
diff --git
a/tools/testing/selftests/bpf/test_cpp.cpp
b/tools/testing/selftests/bpf/test_cpp.cpp
index a8d2e9a87fbfa6a38f121728d7d9fa23a93abdce..e00201de28901254cf508108317a4dfd5fcbcac1 100644
(file)
--- a/
tools/testing/selftests/bpf/test_cpp.cpp
+++ b/
tools/testing/selftests/bpf/test_cpp.cpp
@@
-7,9
+7,15
@@
/* 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[])
{
+ struct btf_dump_opts opts = { };
struct test_core_extern *skel;
+ struct btf *btf;
/* libbpf.h */
libbpf_set_print(NULL);
@@
-18,7
+24,8
@@
int main(int argc, char *argv[])
bpf_prog_get_fd_by_id(0);
/* btf.h */
- btf__new(NULL, 0);
+ btf = btf__new(NULL, 0);
+ btf_dump__new(btf, dump_printf, nullptr, &opts);
/* BPF skeleton */
skel = test_core_extern__open_and_load();