BpfUtils.h - add back SKIP_IF_BPF_NOT_SUPPORTED macro am: 67fa2073ff am: 625c2c6bc6
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1631935
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I8d84f5368f2f9fa78b136d67dc92587cf05e3b81
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 @@
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)) { \