Skip to content

Commit

Permalink
Debug improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Eilemann authored and eile committed May 29, 2017
1 parent c4d71ef commit 7dd98e6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion co/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Connection::~Connection()
{
LBVERB << "Delete Connection @" << (void*)this << std::endl;
#ifdef STATISTICS
if (_impl->outBytes || _impl->inBytes)
if (_impl->outBytes > LB_1MB || _impl->inBytes > LB_1MB)
LBINFO << *this << ": " << (_impl->outBytes >> 20) << " MB out, "
<< (_impl->inBytes >> 20) << " MB in" << std::endl;
#endif
Expand Down
3 changes: 2 additions & 1 deletion co/eventConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ EventConnection::EventConnection()
: _connection(new PipeConnection)
, _set(false)
#endif
{}
{
}

EventConnection::~EventConnection()
{
Expand Down
10 changes: 6 additions & 4 deletions co/rspConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include <boost/bind.hpp>

#define CO_INSTRUMENT_RSP
//#define CO_INSTRUMENT_RSP
#define CO_RSP_MERGE_WRITES
#define CO_RSP_MAX_TIMEOUTS 1000
#ifdef _WIN32
Expand Down Expand Up @@ -942,7 +942,7 @@ void RSPConnection::_handleAcceptIDData(const size_t bytes)
break;

default:
LBERROR << "Got unexpected datagram type " << node.type << std::endl;
LBDEBUG << "Got unexpected datagram type " << node.type << std::endl;
LBUNIMPLEMENTED;
break;
}
Expand Down Expand Up @@ -984,8 +984,7 @@ void RSPConnection::_handleInitData(const size_t bytes, const bool connected)
return;

default:
LBERROR << "Got unexpected datagram type " << node.type << std::endl;
LBUNIMPLEMENTED;
LBDEBUG << "Got unexpected datagram type " << node.type << std::endl;
break;
}
}
Expand Down Expand Up @@ -1720,6 +1719,9 @@ std::ostream& operator<<(std::ostream& os, const RSPConnection& connection)
nNAcksSend = 0;
nNAcksRead = 0;
writeWaitTime = 0.f;

for (auto child : connection._children)
os << *child << std::endl;
#endif
os << std::endl << lunchbox::enableHeader << lunchbox::enableFlush;

Expand Down
2 changes: 2 additions & 0 deletions co/rspConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ class RSPConnection : public Connection
{
return !_threadBuffers.isEmpty() || !_writeBuffers.empty();
}

friend std::ostream& operator<<(std::ostream&, const RSPConnection&);
};

std::ostream& operator<<(std::ostream&, const RSPConnection&);
Expand Down

0 comments on commit 7dd98e6

Please sign in to comment.