From 7dd98e6e4516090e4d6beb977d1ed9a4da91745b Mon Sep 17 00:00:00 2001 From: Stefan Eilemann Date: Wed, 1 Mar 2017 14:59:16 +0100 Subject: [PATCH] Debug improvements --- co/connection.cpp | 2 +- co/eventConnection.cpp | 3 ++- co/rspConnection.cpp | 10 ++++++---- co/rspConnection.h | 2 ++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/co/connection.cpp b/co/connection.cpp index 69523b791..4b4394568 100644 --- a/co/connection.cpp +++ b/co/connection.cpp @@ -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 diff --git a/co/eventConnection.cpp b/co/eventConnection.cpp index 3efaf808c..6a1935c58 100644 --- a/co/eventConnection.cpp +++ b/co/eventConnection.cpp @@ -32,7 +32,8 @@ EventConnection::EventConnection() : _connection(new PipeConnection) , _set(false) #endif -{} +{ +} EventConnection::~EventConnection() { diff --git a/co/rspConnection.cpp b/co/rspConnection.cpp index e936dd12f..82037544d 100644 --- a/co/rspConnection.cpp +++ b/co/rspConnection.cpp @@ -32,7 +32,7 @@ #include -#define CO_INSTRUMENT_RSP +//#define CO_INSTRUMENT_RSP #define CO_RSP_MERGE_WRITES #define CO_RSP_MAX_TIMEOUTS 1000 #ifdef _WIN32 @@ -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; } @@ -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; } } @@ -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; diff --git a/co/rspConnection.h b/co/rspConnection.h index fc64d1a9a..316d68280 100644 --- a/co/rspConnection.h +++ b/co/rspConnection.h @@ -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&);