Merge changes I71988117,Ia70379a3
* changes: Move app uid stats map dump to NetworkStatsService Move uid counter set map dump to NetworkStatsService
This commit is contained in:
@@ -612,10 +612,6 @@ void TrafficController::dump(int fd, bool verbose) {
|
||||
ScopedIndent indentPreBpfModule(dw);
|
||||
|
||||
dw.blankline();
|
||||
dw.println("mUidCounterSetMap status: %s",
|
||||
getMapStatus(mUidCounterSetMap.getMap(), UID_COUNTERSET_MAP_PATH).c_str());
|
||||
dw.println("mAppUidStatsMap status: %s",
|
||||
getMapStatus(mAppUidStatsMap.getMap(), APP_UID_STATS_MAP_PATH).c_str());
|
||||
dw.println("mStatsMapA status: %s",
|
||||
getMapStatus(mStatsMapA.getMap(), STATS_MAP_A_PATH).c_str());
|
||||
dw.println("mStatsMapB status: %s",
|
||||
@@ -651,32 +647,6 @@ void TrafficController::dump(int fd, bool verbose) {
|
||||
|
||||
ScopedIndent indentForMapContent(dw);
|
||||
|
||||
// Print UidCounterSetMap content.
|
||||
dumpBpfMap("mUidCounterSetMap", dw, "");
|
||||
const auto printUidInfo = [&dw](const uint32_t& key, const uint8_t& value,
|
||||
const BpfMap<uint32_t, uint8_t>&) {
|
||||
dw.println("%u %u", key, value);
|
||||
return base::Result<void>();
|
||||
};
|
||||
base::Result<void> res = mUidCounterSetMap.iterateWithValue(printUidInfo);
|
||||
if (!res.ok()) {
|
||||
dw.println("mUidCounterSetMap print end with error: %s", res.error().message().c_str());
|
||||
}
|
||||
|
||||
// Print AppUidStatsMap content.
|
||||
std::string appUidStatsHeader = StringPrintf("uid rxBytes rxPackets txBytes txPackets");
|
||||
dumpBpfMap("mAppUidStatsMap:", dw, appUidStatsHeader);
|
||||
auto printAppUidStatsInfo = [&dw](const uint32_t& key, const StatsValue& value,
|
||||
const BpfMap<uint32_t, StatsValue>&) {
|
||||
dw.println("%u %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64, key, value.rxBytes,
|
||||
value.rxPackets, value.txBytes, value.txPackets);
|
||||
return base::Result<void>();
|
||||
};
|
||||
res = mAppUidStatsMap.iterateWithValue(printAppUidStatsInfo);
|
||||
if (!res.ok()) {
|
||||
dw.println("mAppUidStatsMap print end with error: %s", res.error().message().c_str());
|
||||
}
|
||||
|
||||
// Print uidStatsMap content.
|
||||
std::string statsHeader = StringPrintf("ifaceIndex ifaceName tag_hex uid_int cnt_set rxBytes"
|
||||
" rxPackets txBytes txPackets");
|
||||
@@ -693,7 +663,7 @@ void TrafficController::dump(int fd, bool verbose) {
|
||||
value.rxPackets, value.txBytes, value.txPackets);
|
||||
return base::Result<void>();
|
||||
};
|
||||
res = mStatsMapA.iterateWithValue(printStatsInfo);
|
||||
base::Result<void> res = mStatsMapA.iterateWithValue(printStatsInfo);
|
||||
if (!res.ok()) {
|
||||
dw.println("mStatsMapA print end with error: %s", res.error().message().c_str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user