Just a simple test to make sure we don't introduce unwanted compiler warnings and API still supports passing enums as input argument.
Showing the changes to tools/testing/selftests/bpf/test_cpp.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ |
| 2 | 2 | #include <iostream> |
| 3 | −#pragma GCC diagnostic push | |
| 4 | −#pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |
| 3 | +#include <unistd.h> | |
| 4 | +#include <linux/bpf.h> | |
| 5 | +#include <linux/btf.h> | |
| 5 | 6 | #include <bpf/libbpf.h> |
| 6 | −#pragma GCC diagnostic pop | |
| 7 | 7 | #include <bpf/bpf.h> |
| 8 | 8 | #include <bpf/btf.h> |
| 9 | 9 | #include "test_core_extern.skel.h" |
| @@ -99,6 +99,7 @@ int main(int argc, char *argv[]) · 89 unmodified lines | ||
| 99 | 99 | struct btf_dump_opts opts = { }; |
| 100 | 100 | struct test_core_extern *skel; |
| 101 | 101 | struct btf *btf; |
| 102 | + int fd; | |
| 102 | 103 | |
| 103 | 104 | try_skeleton_template(); |
| 104 | 105 | |
| @@ -117,6 +118,12 @@ int main(int argc, char *argv[]) · 12 unmodified lines | ||
| 117 | 118 | skel = test_core_extern__open_and_load(); |
| 118 | 119 | test_core_extern__destroy(skel); |
| 119 | 120 | |
| 121 | + fd = bpf_enable_stats(BPF_STATS_RUN_TIME); | |
| 122 | + if (fd < 0) | |
| 123 | + std::cout << "FAILED to enable stats: " << fd << std::endl; | |
| 124 | + else | |
| 125 | + ::close(fd); | |
| 126 | + | |
| 120 | 127 | std::cout << "DONE!" << std::endl; |
| 121 | 128 | |
| 122 | 129 | return 0; |