Add forwarded stats dump in tethering hardware offload

The information can be useful for issue debugging, it shows the
accumulated traffic offloaded to the hardware for all upstreams.

$ dumpsys tethering
....
    ForwardedStats:
      rmnet_data2: rx:155686981 tx:799922
....

Bug: b/205762647
Test: adb shell dumpsys tethering
Change-Id: I94143329bdc8ad0eff79c32f329fae95ad3acf8a
This commit is contained in:
KH Shi
2023-04-19 16:23:26 +08:00
parent 8b02a2682a
commit 11dee200f9

View File

@@ -762,6 +762,16 @@ public class OffloadController {
String upstream = (lp != null) ? lp.getInterfaceName() : null;
pw.println("Current upstream: " + upstream);
pw.println("Exempt prefixes: " + mLastLocalPrefixStrs);
pw.println("ForwardedStats:");
pw.increaseIndent();
if (mForwardedStats.isEmpty()) {
pw.println("<empty>");
} else {
for (final Map.Entry<String, ForwardedStats> kv : mForwardedStats.entrySet()) {
pw.println(kv.getKey() + ": " + kv.getValue());
}
}
pw.decreaseIndent();
pw.println("NAT timeout update callbacks received during the "
+ (isStarted ? "current" : "last")
+ " offload session: "