NetworkStats: disable BPF
This commit is contained in:
parent
e8386b7af7
commit
7a031e81e4
62
fix-NetworkStats-disable-BPF.patch
Normal file
62
fix-NetworkStats-disable-BPF.patch
Normal file
@ -0,0 +1,62 @@
|
||||
From b6eea3c624f846b90d1befa92604cddac1671be4 Mon Sep 17 00:00:00 2001
|
||||
From: nyyu <mail@nyyu.dev>
|
||||
Date: Fri, 2 Dec 2022 21:18:50 +0100
|
||||
Subject: [PATCH] NetworkStats: disable BPF
|
||||
|
||||
---
|
||||
service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp | 4 ++--
|
||||
service-t/src/com/android/server/net/NetworkStatsFactory.java | 2 +-
|
||||
service/src/com/android/server/BpfNetMaps.java | 4 ++--
|
||||
3 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp b/service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp
|
||||
index 0948598df..0ee628bb8 100644
|
||||
--- a/service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp
|
||||
+++ b/service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp
|
||||
@@ -100,13 +100,13 @@ int bpfGetIfaceStats(const char* iface, Stats* stats) {
|
||||
int ret;
|
||||
if (!ifaceStatsMap.isValid()) {
|
||||
ret = -errno;
|
||||
- ALOGE("get ifaceStats map fd failed: %s", strerror(errno));
|
||||
+ //ALOGE("get ifaceStats map fd failed: %s", strerror(errno));
|
||||
return ret;
|
||||
}
|
||||
BpfMapRO<uint32_t, IfaceValue> ifaceIndexNameMap(IFACE_INDEX_NAME_MAP_PATH);
|
||||
if (!ifaceIndexNameMap.isValid()) {
|
||||
ret = -errno;
|
||||
- ALOGE("get ifaceIndexName map fd failed: %s", strerror(errno));
|
||||
+ //ALOGE("get ifaceIndexName map fd failed: %s", strerror(errno));
|
||||
return ret;
|
||||
}
|
||||
return bpfGetIfaceStatsInternal(iface, stats, ifaceStatsMap, ifaceIndexNameMap);
|
||||
diff --git a/service-t/src/com/android/server/net/NetworkStatsFactory.java b/service-t/src/com/android/server/net/NetworkStatsFactory.java
|
||||
index 3b93f1a19..191400841 100644
|
||||
--- a/service-t/src/com/android/server/net/NetworkStatsFactory.java
|
||||
+++ b/service-t/src/com/android/server/net/NetworkStatsFactory.java
|
||||
@@ -164,7 +164,7 @@ public class NetworkStatsFactory {
|
||||
}
|
||||
|
||||
public NetworkStatsFactory(@NonNull Context ctx) {
|
||||
- this(ctx, new File("/proc/"), true);
|
||||
+ this(ctx, new File("/proc/"), false);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
diff --git a/service/src/com/android/server/BpfNetMaps.java b/service/src/com/android/server/BpfNetMaps.java
|
||||
index c006bc605..3d1fc9b71 100644
|
||||
--- a/service/src/com/android/server/BpfNetMaps.java
|
||||
+++ b/service/src/com/android/server/BpfNetMaps.java
|
||||
@@ -67,9 +67,9 @@ public class BpfNetMaps {
|
||||
}
|
||||
|
||||
private void maybeThrow(final int err, final String msg) {
|
||||
- if (err != 0) {
|
||||
+ /*if (err != 0) {
|
||||
throw new ServiceSpecificException(err, msg + ": " + Os.strerror(err));
|
||||
- }
|
||||
+ }*/
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.38.1
|
5
sync.sh
5
sync.sh
@ -66,6 +66,11 @@ git am $DRONE_WORKSPACE_BASE/fix-bt-3.patch || git am --abort
|
||||
git am $DRONE_WORKSPACE_BASE/fix-bt-le.patch || git am --abort
|
||||
cd $TOPDIR
|
||||
|
||||
#connectivity
|
||||
cd packages/modules/Connectivity
|
||||
git am $DRONE_WORKSPACE_BASE/fix-NetworkStats-disable-BPF.patch || git am --abort
|
||||
cd $TOPDIR
|
||||
|
||||
#safetynet
|
||||
repopick -f 334348 -P system/core
|
||||
repopick -f 334343 334344 -P frameworks/base
|
Loading…
Reference in New Issue
Block a user