Merge changes Ida29dcbb,Icc1f255a
* changes: Remove unuseful program status dump in TrafficController Revert bpf map status dump in TrafficController
This commit is contained in:
@@ -572,17 +572,6 @@ void TrafficController::setPermissionForUids(int permission, const std::vector<u
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProgramStatus(const char *path) {
|
||||
int ret = access(path, R_OK);
|
||||
if (ret == 0) {
|
||||
return StringPrintf("OK");
|
||||
}
|
||||
if (ret != 0 && errno == ENOENT) {
|
||||
return StringPrintf("program is missing at: %s", path);
|
||||
}
|
||||
return StringPrintf("check Program %s error: %s", path, strerror(errno));
|
||||
}
|
||||
|
||||
std::string getMapStatus(const base::unique_fd& map_fd, const char* path) {
|
||||
if (map_fd.get() < 0) {
|
||||
return StringPrintf("map fd lost");
|
||||
@@ -614,6 +603,10 @@ void TrafficController::dump(int fd, bool verbose) {
|
||||
dw.blankline();
|
||||
dw.println("mCookieTagMap status: %s",
|
||||
getMapStatus(mCookieTagMap.getMap(), COOKIE_TAG_MAP_PATH).c_str());
|
||||
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",
|
||||
@@ -627,19 +620,6 @@ void TrafficController::dump(int fd, bool verbose) {
|
||||
dw.println("mUidOwnerMap status: %s",
|
||||
getMapStatus(mUidOwnerMap.getMap(), UID_OWNER_MAP_PATH).c_str());
|
||||
|
||||
dw.blankline();
|
||||
dw.println("Cgroup ingress program status: %s",
|
||||
getProgramStatus(BPF_INGRESS_PROG_PATH).c_str());
|
||||
dw.println("Cgroup egress program status: %s", getProgramStatus(BPF_EGRESS_PROG_PATH).c_str());
|
||||
dw.println("xt_bpf ingress program status: %s",
|
||||
getProgramStatus(XT_BPF_INGRESS_PROG_PATH).c_str());
|
||||
dw.println("xt_bpf egress program status: %s",
|
||||
getProgramStatus(XT_BPF_EGRESS_PROG_PATH).c_str());
|
||||
dw.println("xt_bpf bandwidth allowlist program status: %s",
|
||||
getProgramStatus(XT_BPF_ALLOWLIST_PROG_PATH).c_str());
|
||||
dw.println("xt_bpf bandwidth denylist program status: %s",
|
||||
getProgramStatus(XT_BPF_DENYLIST_PROG_PATH).c_str());
|
||||
|
||||
if (!verbose) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user