Skip to content

Commit

Permalink
Add debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
liuh-80 committed Sep 27, 2024
1 parent ff0b951 commit eab66f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cfgmgr/portmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ bool PortMgr::isPortStateOk(const string &alias)
auto state_opt = swss::fvsGetValue(temp, "state", true);
if (!state_opt)
{
SWSS_LOG_WARN("Port %s is not ready", alias.c_str());
return false;
}

SWSS_LOG_INFO("Port %s is ready", alias.c_str());
SWSS_LOG_WARN("Port %s is ready", alias.c_str());
return true;
}

SWSS_LOG_WARN("Port %s get failed", alias.c_str());
return false;
}

Expand Down Expand Up @@ -199,7 +201,7 @@ void PortMgr::doTask(Consumer &consumer)

if (!portOk)
{
SWSS_LOG_INFO("Port %s is not ready, pending...", alias.c_str());
SWSS_LOG_WARN("Port %s is not ready, pending...", alias.c_str());

writeConfigToAppDb(alias, "mtu", mtu);
writeConfigToAppDb(alias, "admin_status", admin_status);
Expand All @@ -215,18 +217,18 @@ void PortMgr::doTask(Consumer &consumer)
if (!mtu.empty())
{
setPortMtu(alias, mtu);
SWSS_LOG_NOTICE("Configure %s MTU to %s", alias.c_str(), mtu.c_str());
SWSS_LOG_WARN("Configure %s MTU to %s", alias.c_str(), mtu.c_str());
}

if (!admin_status.empty())
{
setPortAdminStatus(alias, admin_status == "up");
SWSS_LOG_NOTICE("Configure %s admin status to %s", alias.c_str(), admin_status.c_str());
SWSS_LOG_WARN("Configure %s admin status to %s", alias.c_str(), admin_status.c_str());
}
}
else if (op == DEL_COMMAND)
{
SWSS_LOG_NOTICE("Delete Port: %s", alias.c_str());
SWSS_LOG_WARN("Delete Port: %s", alias.c_str());
m_appPortTable.del(alias);
m_portList.erase(alias);
}
Expand Down
3 changes: 3 additions & 0 deletions orchagent/orch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ void Consumer::execute()
std::deque<KeyOpFieldsValuesTuple> entries;
table->pops(entries);

// debug log
SWSS_LOG_WARN("[HUA] Consumer::execute %s pops %d", table->getTableName().c_str(), (int)(entries.size()));

// add to sync
addToSync(entries);

Expand Down

0 comments on commit eab66f4

Please sign in to comment.