Adding btf_dump__new call to test_cpp, so we can test C++ compilation with that.
Showing the changes to tools/testing/selftests/bpf/test_cpp.cpp (1 of 1 file). Show all
Unified · Split
| @@ -7,9 +7,15 @@ · 6 unmodified lines | ||
| 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); |
| @@ -18,7 +24,8 @@ int main(int argc, char *argv[]) · 2 unmodified lines | ||
| 18 | 24 | bpf_prog_get_fd_by_id(0); |
| 19 | 25 | |
| 20 | 26 | /* btf.h */ |
| 21 | − btf__new(NULL, 0); | |
| 27 | + btf = btf__new(NULL, 0); | |
| 28 | + btf_dump__new(btf, dump_printf, nullptr, &opts); | |
| 22 | 29 | |
| 23 | 30 | /* BPF skeleton */ |
| 24 | 31 | skel = test_core_extern__open_and_load(); |