APF: add debug code.
1. Store additional debug information when RA filtering. 2. Add a toString method for RA packets. 3. Make "adb shell dumpsys connectivity apf" dump APF filter state. Bug: 26238573 Change-Id: I1441ff7bc90e63624f8b10a220b2ac97f4d390a5
This commit is contained in:
@@ -1784,6 +1784,38 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void dumpNetworkDiagnostics(IndentingPrintWriter pw) {
|
||||||
|
final List<NetworkDiagnostics> netDiags = new ArrayList<NetworkDiagnostics>();
|
||||||
|
final long DIAG_TIME_MS = 5000;
|
||||||
|
for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
|
||||||
|
// Start gathering diagnostic information.
|
||||||
|
netDiags.add(new NetworkDiagnostics(
|
||||||
|
nai.network,
|
||||||
|
new LinkProperties(nai.linkProperties), // Must be a copy.
|
||||||
|
DIAG_TIME_MS));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (NetworkDiagnostics netDiag : netDiags) {
|
||||||
|
pw.println();
|
||||||
|
netDiag.waitForMeasurements();
|
||||||
|
netDiag.dump(pw);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dumpApf(IndentingPrintWriter pw) {
|
||||||
|
pw.println("APF filters:");
|
||||||
|
pw.increaseIndent();
|
||||||
|
for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
|
||||||
|
if (nai.apfFilter != null) {
|
||||||
|
pw.println(nai.name() + ":");
|
||||||
|
pw.increaseIndent();
|
||||||
|
nai.apfFilter.dump(pw);
|
||||||
|
pw.decreaseIndent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pw.decreaseIndent();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
|
protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
|
||||||
final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
|
final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
|
||||||
@@ -1796,23 +1828,13 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<NetworkDiagnostics> netDiags = new ArrayList<NetworkDiagnostics>();
|
|
||||||
if (argsContain(args, "--diag")) {
|
if (argsContain(args, "--diag")) {
|
||||||
final long DIAG_TIME_MS = 5000;
|
dumpNetworkDiagnostics(pw);
|
||||||
for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
|
return;
|
||||||
// Start gathering diagnostic information.
|
}
|
||||||
netDiags.add(new NetworkDiagnostics(
|
|
||||||
nai.network,
|
|
||||||
new LinkProperties(nai.linkProperties), // Must be a copy.
|
|
||||||
DIAG_TIME_MS));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (NetworkDiagnostics netDiag : netDiags) {
|
|
||||||
pw.println();
|
|
||||||
netDiag.waitForMeasurements();
|
|
||||||
netDiag.dump(pw);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (argsContain(args, "apf")) {
|
||||||
|
dumpApf(pw);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1878,6 +1900,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
pw.println();
|
pw.println();
|
||||||
mKeepaliveTracker.dump(pw);
|
mKeepaliveTracker.dump(pw);
|
||||||
|
|
||||||
|
pw.println();
|
||||||
|
dumpApf(pw);
|
||||||
|
|
||||||
if (mInetLog != null && mInetLog.size() > 0) {
|
if (mInetLog != null && mInetLog.size() > 0) {
|
||||||
pw.println();
|
pw.println();
|
||||||
pw.println("Inet condition reports:");
|
pw.println("Inet condition reports:");
|
||||||
|
|||||||
Reference in New Issue
Block a user