diff options
author | Maciej Żenczykowski <maze@google.com> | 2021-03-12 09:20:54 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-03-12 09:20:54 +0000 |
commit | 625c2c6bc6406ab36fa41600af77beebf6043c27 (patch) | |
tree | 47885db646a17674f523f878538ea0d3a436e0d8 | |
parent | 76f565a3f18c24ad1e939395bb21683aaf3aeecc (diff) | |
parent | 67fa2073ffbeb0baa6ad20cc9f309853efb1b536 (diff) | |
download | bpf-625c2c6bc6406ab36fa41600af77beebf6043c27.tar.gz |
BpfUtils.h - add back SKIP_IF_BPF_NOT_SUPPORTED macro am: 67fa2073ff
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1631935
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I4319f83b426be2800ee92f3fb900ad98ec597ed9
-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)) { \ |