mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Added debug traces
This commit is contained in:
parent
08d9dc5c68
commit
20a25a6a45
2 changed files with 14 additions and 0 deletions
|
@ -44,6 +44,8 @@
|
||||||
|
|
||||||
#include "../osdep/Phy.hpp"
|
#include "../osdep/Phy.hpp"
|
||||||
|
|
||||||
|
#include "../include/ZeroTierDebug.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum return value of preferenceRank()
|
* Maximum return value of preferenceRank()
|
||||||
*/
|
*/
|
||||||
|
@ -314,6 +316,7 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void recordOutgoingPacket(int64_t now, int64_t packetId, uint16_t payloadLength, Packet::Verb verb)
|
inline void recordOutgoingPacket(int64_t now, int64_t packetId, uint16_t payloadLength, Packet::Verb verb)
|
||||||
{
|
{
|
||||||
|
DEBUG_INFO("");
|
||||||
Mutex::Lock _l(_statistics_m);
|
Mutex::Lock _l(_statistics_m);
|
||||||
if (verb != Packet::VERB_ACK && verb != Packet::VERB_QOS_MEASUREMENT) {
|
if (verb != Packet::VERB_ACK && verb != Packet::VERB_QOS_MEASUREMENT) {
|
||||||
if ((packetId & (ZT_PATH_QOS_ACK_PROTOCOL_DIVISOR - 1)) == 0) {
|
if ((packetId & (ZT_PATH_QOS_ACK_PROTOCOL_DIVISOR - 1)) == 0) {
|
||||||
|
@ -337,6 +340,7 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void recordIncomingPacket(int64_t now, int64_t packetId, uint16_t payloadLength, Packet::Verb verb)
|
inline void recordIncomingPacket(int64_t now, int64_t packetId, uint16_t payloadLength, Packet::Verb verb)
|
||||||
{
|
{
|
||||||
|
DEBUG_INFO("");
|
||||||
Mutex::Lock _l(_statistics_m);
|
Mutex::Lock _l(_statistics_m);
|
||||||
if (verb != Packet::VERB_ACK && verb != Packet::VERB_QOS_MEASUREMENT) {
|
if (verb != Packet::VERB_ACK && verb != Packet::VERB_QOS_MEASUREMENT) {
|
||||||
if ((packetId & (ZT_PATH_QOS_ACK_PROTOCOL_DIVISOR - 1)) == 0) {
|
if ((packetId & (ZT_PATH_QOS_ACK_PROTOCOL_DIVISOR - 1)) == 0) {
|
||||||
|
@ -357,6 +361,7 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void receivedAck(int64_t now, int32_t ackedBytes)
|
inline void receivedAck(int64_t now, int32_t ackedBytes)
|
||||||
{
|
{
|
||||||
|
DEBUG_INFO("");
|
||||||
_expectingAckAsOf = 0;
|
_expectingAckAsOf = 0;
|
||||||
_unackedBytes = (ackedBytes > _unackedBytes) ? 0 : _unackedBytes - ackedBytes;
|
_unackedBytes = (ackedBytes > _unackedBytes) ? 0 : _unackedBytes - ackedBytes;
|
||||||
int64_t timeSinceThroughputEstimate = (now - _lastThroughputEstimation);
|
int64_t timeSinceThroughputEstimate = (now - _lastThroughputEstimation);
|
||||||
|
@ -401,6 +406,7 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void sentAck(int64_t now)
|
inline void sentAck(int64_t now)
|
||||||
{
|
{
|
||||||
|
DEBUG_INFO("");
|
||||||
Mutex::Lock _l(_statistics_m);
|
Mutex::Lock _l(_statistics_m);
|
||||||
_inACKRecords.clear();
|
_inACKRecords.clear();
|
||||||
_packetsReceivedSinceLastAck = 0;
|
_packetsReceivedSinceLastAck = 0;
|
||||||
|
@ -418,6 +424,7 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void receivedQoS(int64_t now, int count, uint64_t *rx_id, uint16_t *rx_ts)
|
inline void receivedQoS(int64_t now, int count, uint64_t *rx_id, uint16_t *rx_ts)
|
||||||
{
|
{
|
||||||
|
DEBUG_INFO("");
|
||||||
Mutex::Lock _l(_statistics_m);
|
Mutex::Lock _l(_statistics_m);
|
||||||
// Look up egress times and compute latency values for each record
|
// Look up egress times and compute latency values for each record
|
||||||
std::map<uint64_t,uint64_t>::iterator it;
|
std::map<uint64_t,uint64_t>::iterator it;
|
||||||
|
@ -442,6 +449,7 @@ public:
|
||||||
*/
|
*/
|
||||||
inline int32_t generateQoSPacket(int64_t now, char *qosBuffer)
|
inline int32_t generateQoSPacket(int64_t now, char *qosBuffer)
|
||||||
{
|
{
|
||||||
|
DEBUG_INFO("");
|
||||||
Mutex::Lock _l(_statistics_m);
|
Mutex::Lock _l(_statistics_m);
|
||||||
int32_t len = 0;
|
int32_t len = 0;
|
||||||
std::map<uint64_t,uint64_t>::iterator it = _inQoSRecords.begin();
|
std::map<uint64_t,uint64_t>::iterator it = _inQoSRecords.begin();
|
||||||
|
@ -466,6 +474,7 @@ public:
|
||||||
* @param Current time
|
* @param Current time
|
||||||
*/
|
*/
|
||||||
inline void sentQoS(int64_t now) {
|
inline void sentQoS(int64_t now) {
|
||||||
|
DEBUG_INFO("");
|
||||||
_packetsReceivedSinceLastQoS = 0;
|
_packetsReceivedSinceLastQoS = 0;
|
||||||
_lastQoSMeasurement = now;
|
_lastQoSMeasurement = now;
|
||||||
}
|
}
|
||||||
|
@ -584,6 +593,7 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void processBackgroundPathMeasurements(int64_t now) {
|
inline void processBackgroundPathMeasurements(int64_t now) {
|
||||||
if (now - _lastPathQualityComputeTime > ZT_PATH_QUALITY_COMPUTE_INTERVAL) {
|
if (now - _lastPathQualityComputeTime > ZT_PATH_QUALITY_COMPUTE_INTERVAL) {
|
||||||
|
DEBUG_INFO("");
|
||||||
Mutex::Lock _l(_statistics_m);
|
Mutex::Lock _l(_statistics_m);
|
||||||
_lastPathQualityComputeTime = now;
|
_lastPathQualityComputeTime = now;
|
||||||
address().toString(_addrString);
|
address().toString(_addrString);
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
#include "RingBuffer.hpp"
|
#include "RingBuffer.hpp"
|
||||||
#include "Utils.hpp"
|
#include "Utils.hpp"
|
||||||
|
|
||||||
|
#include "../include/ZeroTierDebug.h"
|
||||||
|
|
||||||
namespace ZeroTier {
|
namespace ZeroTier {
|
||||||
|
|
||||||
Peer::Peer(const RuntimeEnvironment *renv,const Identity &myIdentity,const Identity &peerIdentity) :
|
Peer::Peer(const RuntimeEnvironment *renv,const Identity &myIdentity,const Identity &peerIdentity) :
|
||||||
|
@ -681,6 +683,8 @@ inline void Peer::processBackgroundPeerTasks(int64_t now)
|
||||||
_localMultipathSupported = ((RR->node->getMultipathMode() != ZT_MULTIPATH_NONE) && (ZT_PROTO_VERSION > 9));
|
_localMultipathSupported = ((RR->node->getMultipathMode() != ZT_MULTIPATH_NONE) && (ZT_PROTO_VERSION > 9));
|
||||||
_remoteMultipathSupported = _vProto > 9;
|
_remoteMultipathSupported = _vProto > 9;
|
||||||
// If both peers support multipath and more than one path exist, we can use multipath logic
|
// If both peers support multipath and more than one path exist, we can use multipath logic
|
||||||
|
DEBUG_INFO("from=%llx, _localMultipathSupported=%d, _remoteMultipathSupported=%d, (_uniqueAlivePathCount > 1)=%d",
|
||||||
|
this->_id.address().toInt(), _localMultipathSupported, _remoteMultipathSupported, (_uniqueAlivePathCount > 1));
|
||||||
_canUseMultipath = _localMultipathSupported && _remoteMultipathSupported && (_uniqueAlivePathCount > 1);
|
_canUseMultipath = _localMultipathSupported && _remoteMultipathSupported && (_uniqueAlivePathCount > 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue