diff options
author | Maciej Żenczykowski <maze@google.com> | 2021-01-14 07:36:56 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-01-14 07:36:56 +0000 |
commit | 1fddcce3c9748e1142ad0bdf4d738c346c6ce60c (patch) | |
tree | c4c231790ba4d4a604ba320c9b9739b13a78fc63 /libbpf_android | |
parent | 6fadbcf91ab3d916c7f7119a3e0fadbbb5e50b46 (diff) | |
parent | ef6689652cc66a8ecd934b380be96a5f70600fec (diff) | |
download | bpf-1fddcce3c9748e1142ad0bdf4d738c346c6ce60c.tar.gz |
Merge "4.9 kernels must support eBPF (as of Android S)"
Diffstat (limited to 'libbpf_android')
-rw-r--r-- | libbpf_android/BpfUtils.cpp | 19 |
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() { |