Skip to content

Commit 29ebda6

Browse files
committed
Remove (some) debug functions and traces
1 parent a1b2ff7 commit 29ebda6

File tree

3 files changed

+3
-146
lines changed

3 files changed

+3
-146
lines changed

node/Bond.cpp

+2-144
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,6 @@ void Bond::setReasonableDefaults(int policy, SharedPtr<Bond> templateBond, bool
16601660
memcpy(_qualityWeights, templateBond->_qualityWeights, ZT_QOS_WEIGHT_SIZE * sizeof(float));
16611661
}
16621662

1663-
16641663
//
16651664
// Second, apply user specified values (only if they make sense)
16661665

@@ -1705,11 +1704,8 @@ void Bond::setUserQualityWeights(float weights[], int len)
17051704
}
17061705
}
17071706

1708-
17091707
bool Bond::relevant() {
1710-
return _peer->identity().address().toInt() == 0x16a03a3d03
1711-
|| _peer->identity().address().toInt() == 0x4410300d03
1712-
|| _peer->identity().address().toInt() == 0x795cbf86fa;
1708+
return false;
17131709
}
17141710

17151711
SharedPtr<Link> Bond::getLink(const SharedPtr<Path>& path)
@@ -1719,145 +1715,7 @@ SharedPtr<Link> Bond::getLink(const SharedPtr<Path>& path)
17191715

17201716
void Bond::dumpInfo(const int64_t now)
17211717
{
1722-
char pathStr[128];
1723-
//char oldPathStr[128];
1724-
char currPathStr[128];
1725-
1726-
if (!relevant()) {
1727-
return;
1728-
}
1729-
/*
1730-
//fprintf(stderr, "---[ bp=%d, id=%llx, dd=%d, up=%d, pmi=%d, specifiedLinks=%d, _specifiedPrimaryLink=%d, _specifiedFailInst=%d ]\n",
1731-
_policy, _peer->identity().address().toInt(), _downDelay, _upDelay, _monitorInterval, _userHasSpecifiedLinks, _userHasSpecifiedPrimaryLink, _userHasSpecifiedFailoverInstructions);
1732-
1733-
if (_bondingPolicy == ZT_BONDING_POLICY_ACTIVE_BACKUP) {
1734-
//fprintf(stderr, "Paths (bp=%d, stats=%d, primaryReselect=%d) :\n",
1735-
_policy, _shouldCollectPathStatistics, _abLinkSelectMethod);
1736-
}
1737-
if (_bondingPolicy == ZT_BONDING_POLICY_BALANCE_RR
1738-
|| _bondingPolicy == ZT_BONDING_POLICY_BALANCE_XOR
1739-
|| _bondingPolicy == ZT_BONDING_POLICY_BALANCE_AWARE) {
1740-
//fprintf(stderr, "Paths (bp=%d, stats=%d, fh=%d) :\n",
1741-
_policy, _shouldCollectPathStatistics, _allowFlowHashing);
1742-
}*/
1743-
if ((now - _lastPrintTS) < 2000) {
1744-
return;
1745-
}
1746-
_lastPrintTS = now;
1747-
1748-
//fprintf(stderr, "\n\n");
1749-
1750-
for(int i=0; i<ZT_MAX_PEER_NETWORK_PATHS; ++i) {
1751-
if (_paths[i]) {
1752-
SharedPtr<Link> link =RR->bc->getLinkBySocket(_policyAlias, _paths[i]->localSocket());
1753-
_paths[i]->address().toString(pathStr);
1754-
/*fprintf(stderr, " %2d: lat=%8.3f, ac=%3d, fail%5s, fscore=%6d, in=%7d, out=%7d, age=%7ld, ack=%7ld, ref=%6d, ls=%llx",
1755-
i,
1756-
_paths[i]->_latencyMean,
1757-
_paths[i]->_allocation,
1758-
link->failoverToLink().c_str(),
1759-
_paths[i]->_failoverScore,
1760-
_paths[i]->_packetsIn,
1761-
_paths[i]->_packetsOut,
1762-
(long)_paths[i]->age(now),
1763-
(long)_paths[i]->ackAge(now),
1764-
_paths[i]->_refractoryPeriod,
1765-
_paths[i]->localSocket()
1766-
);
1767-
*/
1768-
if (link->spare()) {
1769-
//fprintf(stderr, " SPR.");
1770-
} else {
1771-
//fprintf(stderr, " ");
1772-
}
1773-
if (link->primary()) {
1774-
//fprintf(stderr, " PRIM.");
1775-
} else {
1776-
//fprintf(stderr, " ");
1777-
}
1778-
if (_paths[i]->allowed()) {
1779-
//fprintf(stderr, " ALL.");
1780-
} else {
1781-
//fprintf(stderr, " ");
1782-
}
1783-
if (_paths[i]->eligible(now,_ackSendInterval)) {
1784-
//fprintf(stderr, " ELI.");
1785-
} else {
1786-
//fprintf(stderr, " ");
1787-
}
1788-
if (_paths[i]->preferred()) {
1789-
//fprintf(stderr, " PREF.");
1790-
} else {
1791-
//fprintf(stderr, " ");
1792-
}
1793-
if (_paths[i]->_negotiated) {
1794-
//fprintf(stderr, " NEG.");
1795-
} else {
1796-
//fprintf(stderr, " ");
1797-
}
1798-
if (_paths[i]->bonded()) {
1799-
//fprintf(stderr, " BOND ");
1800-
} else {
1801-
//fprintf(stderr, " ");
1802-
}
1803-
if (_bondingPolicy == ZT_BONDING_POLICY_ACTIVE_BACKUP && _abPath && (_abPath == _paths[i].ptr())) {
1804-
//fprintf(stderr, " ACTIVE ");
1805-
} else if (_bondingPolicy == ZT_BONDING_POLICY_ACTIVE_BACKUP) {
1806-
//fprintf(stderr, " ");
1807-
}
1808-
if (_bondingPolicy == ZT_BONDING_POLICY_ACTIVE_BACKUP && _abFailoverQueue.size() && (_abFailoverQueue.front().ptr() == _paths[i].ptr())) {
1809-
//fprintf(stderr, " NEXT ");
1810-
} else if (_bondingPolicy == ZT_BONDING_POLICY_ACTIVE_BACKUP) {
1811-
//fprintf(stderr, " ");
1812-
}
1813-
//fprintf(stderr, "%5s %s\n", link->ifname().c_str(), pathStr);
1814-
}
1815-
}
1816-
1817-
if (_bondingPolicy == ZT_BONDING_POLICY_ACTIVE_BACKUP) {
1818-
if (!_abFailoverQueue.empty()) {
1819-
//fprintf(stderr, "\nFailover Queue:\n");
1820-
for (std::list<SharedPtr<Path> >::iterator it(_abFailoverQueue.begin()); it!=_abFailoverQueue.end();++it) {
1821-
(*it)->address().toString(currPathStr);
1822-
SharedPtr<Link> link =RR->bc->getLinkBySocket(_policyAlias, (*it)->localSocket());
1823-
/*fprintf(stderr, "\t%8s\tspeed=%7d\trelSpeed=%3d\tipvPref=%3d\tfscore=%9d\t\t%s\n",
1824-
link->ifname().c_str(),
1825-
link->speed(),
1826-
link->relativeSpeed(),
1827-
link->ipvPref(),
1828-
(*it)->_failoverScore,
1829-
currPathStr);
1830-
*/
1831-
}
1832-
}
1833-
else
1834-
{
1835-
//fprintf(stderr, "\nFailover Queue size = %lu\n", _abFailoverQueue.size());
1836-
}
1837-
}
1838-
1839-
if (_bondingPolicy == ZT_BONDING_POLICY_BALANCE_RR
1840-
|| _bondingPolicy == ZT_BONDING_POLICY_BALANCE_XOR
1841-
|| _bondingPolicy == ZT_BONDING_POLICY_BALANCE_AWARE) {
1842-
if (_numBondedPaths) {
1843-
//fprintf(stderr, "\nBonded Paths:\n");
1844-
for (int i=0; i<_numBondedPaths; ++i) {
1845-
_paths[_bondedIdx[i]]->address().toString(currPathStr);
1846-
SharedPtr<Link> link =RR->bc->getLinkBySocket(_policyAlias, _paths[_bondedIdx[i]]->localSocket());
1847-
//fprintf(stderr, " [%d]\t%8s\tflows=%3d\tspeed=%7d\trelSpeed=%3d\tipvPref=%3d\tfscore=%9d\t\t%s\n", i,
1848-
/*fprintf(stderr, " [%d]\t%8s\tspeed=%7d\trelSpeed=%3d\tflowCount=%2d\tipvPref=%3d\tfscore=%9d\t\t%s\n", i,
1849-
link->ifname().c_str(),
1850-
_paths[_bondedIdx[i]]->_assignedFlowCount,
1851-
link->speed(),
1852-
link->relativeSpeed(),
1853-
_paths[_bondedIdx[i]].p->assignedFlows.size(),
1854-
link->ipvPref(),
1855-
_paths[_bondedIdx[i]]->_failoverScore,
1856-
currPathStr);
1857-
*/
1858-
}
1859-
}
1860-
}
1718+
// Omitted
18611719
}
18621720

18631721
} // namespace ZeroTier

node/BondController.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ bool BondController::assignBondingPolicyToPeer(int64_t identity, const std::stri
7979

8080
SharedPtr<Bond> BondController::createTransportTriggeredBond(const RuntimeEnvironment *renv, const SharedPtr<Peer>& peer)
8181
{
82-
//fprintf(stderr, "createTransportTriggeredBond\n");
8382
Mutex::Lock _l(_bonds_m);
8483
int64_t identity = peer->identity().address().toInt();
8584
Bond *bond = nullptr;

node/Packet.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
* + Inline push of CertificateOfMembership deprecated
5757
* 9 - 1.2.0 ... 1.2.14
5858
* 10 - 1.4.0 ... CURRENT
59-
* + Multipath capability and load balancing
59+
* + Multipath capability and load balancing (tentative)
6060
*/
6161
#define ZT_PROTO_VERSION 10
6262

0 commit comments

Comments
 (0)