diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-03-13 02:09:38 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-03-13 02:09:38 +0000 |
commit | 17588f185d64c1c1c44db4ae2c55ce5a1e54f13d (patch) | |
tree | 47885db646a17674f523f878538ea0d3a436e0d8 | |
parent | 8c24035f2f427a512ca1b10b36b930e7843859da (diff) | |
parent | 1ebce20b0f778c7927936a55fba86ef2ad8a0330 (diff) | |
download | bpf-17588f185d64c1c1c44db4ae2c55ce5a1e54f13d.tar.gz |
Snap for 7205268 from 1ebce20b0f778c7927936a55fba86ef2ad8a0330 to sc-v2-release
Change-Id: I002f94278401ea4368bace78e64cfa1cce6a48e0
-rw-r--r-- | libbpf_android/include/bpf/BpfUtils.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libbpf_android/include/bpf/BpfUtils.h b/libbpf_android/include/bpf/BpfUtils.h index 9671b8a..8fd2a4a 100644 --- a/libbpf_android/include/bpf/BpfUtils.h +++ b/libbpf_android/include/bpf/BpfUtils.h @@ -45,6 +45,22 @@ static inline bool isAtLeastKernelVersion(unsigned major, unsigned minor, unsign return kernelVersion() >= KVER(major, minor, sub); } +#define SKIP_IF_BPF_SUPPORTED \ + do { \ + if (android::bpf::isAtLeastKernelVersion(4, 9, 0)) { \ + GTEST_LOG_(INFO) << "This test is skipped since bpf is supported\n"; \ + return; \ + } \ + } while (0) + +#define SKIP_IF_BPF_NOT_SUPPORTED \ + do { \ + if (!android::bpf::isAtLeastKernelVersion(4, 9, 0)) { \ + GTEST_LOG_(INFO) << "This test is skipped since bpf is not supported\n"; \ + return; \ + } \ + } while (0) + #define SKIP_IF_EXTENDED_BPF_NOT_SUPPORTED \ do { \ if (!android::bpf::isAtLeastKernelVersion(4, 14, 0)) { \ |