summaryrefslogtreecommitdiff
path: root/libbpf_android
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2021-01-12 18:26:37 -0800
committerMaciej Żenczykowski <maze@google.com>2021-01-14 03:27:47 +0000
commitef6689652cc66a8ecd934b380be96a5f70600fec (patch)
treee64d5249dc5e1761aab9ea754bf73a1cea2a5c66 /libbpf_android
parentccde8285ee3204e3e711ba3f136f6d955dee6c68 (diff)
downloadbpf-ef6689652cc66a8ecd934b380be96a5f70600fec.tar.gz
4.9 kernels must support eBPF (as of Android S)
so there is no longer a need to look at any properties or api levels. Test: builds, atest, TreeHugger Bug: 167500195 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ia5479db807f5444e48251dff45fd42fff610d5ca
Diffstat (limited to 'libbpf_android')
-rw-r--r--libbpf_android/BpfUtils.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/libbpf_android/BpfUtils.cpp b/libbpf_android/BpfUtils.cpp
index 3b6c764..f640cde 100644
--- a/libbpf_android/BpfUtils.cpp
+++ b/libbpf_android/BpfUtils.cpp
@@ -34,7 +34,6 @@
#include <sstream>
#include <string>
-#include <android-base/properties.h>
#include <android-base/unique_fd.h>
#include <log/log.h>
#include <processgroup/processgroup.h>
@@ -137,22 +136,8 @@ static BpfLevel getUncachedBpfSupportLevel() {
if (kver >= KVER(4, 19, 0)) return BpfLevel::EXTENDED_4_19;
if (kver >= KVER(4, 14, 0)) return BpfLevel::EXTENDED_4_14;
- // Override for devices launched with O but now on a 4.9-P+ kernel.
- bool ebpf_supported = base::GetBoolProperty("ro.kernel.ebpf.supported", false);
- if (ebpf_supported) return BpfLevel::BASIC_4_9;
-
- uint64_t api_level = base::GetUintProperty<uint64_t>("ro.product.first_api_level", 0);
- if (api_level == 0) {
- ALOGE("Cannot determine initial API level of the device");
- api_level = base::GetUintProperty<uint64_t>("ro.build.version.sdk", 0);
- }
-
- // Check if the device is shipped originally with android P.
- if (api_level < MINIMUM_API_REQUIRED) return BpfLevel::NONE;
-
- if (kver >= KVER(4, 9, 0)) return BpfLevel::BASIC_4_9;
-
- return BpfLevel::NONE;
+ // Basic BPF support is required on all devices.
+ return BpfLevel::BASIC_4_9;
}
BpfLevel getBpfSupportLevel() {