From 6a2adb48aa70bb9d1f178e00794f4c2c8ebef140 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Wed, 9 Nov 2016 09:19:11 +0100 Subject: [PATCH] debugging --- .../src/UDPStandardImplementation.cpp | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 9e178cbe2..f6c4520e9 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -2748,16 +2748,29 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer){ //Print packet loss if(totalWritingPacketCountFromLastCheck[ithread]){ - thread/****/ - printf("\nPackets Lost:%d" - "\tPacketsFromLastCheck:%lld" - "\tCurrentFrameNumber:%lld" - "\tPreviousFrameNumber:%lld\n", - ( ((int)(currentFrameNumber[ithread]-frameNumberInPreviousCheck[ithread])*packetsPerFrame) - totalWritingPacketCountFromLastCheck[ithread]), - totalWritingPacketCountFromLastCheck[ithread], - currentFrameNumber[ithread], - frameNumberInPreviousCheck[ithread] - ); + if(numberofWriterThreads>1){ + printf("\nThread:%d" + "\tPackets Lost:%d" + "\tPacketsFromLastCheck:%lld" + "\tCurrentFrameNumber:%lld" + "\tPreviousFrameNumber:%lld\n", + ithread, + ( ((int)(currentFrameNumber[ithread]-frameNumberInPreviousCheck[ithread])*packetsPerFrame) - totalWritingPacketCountFromLastCheck[ithread]), + totalWritingPacketCountFromLastCheck[ithread], + currentFrameNumber[ithread], + frameNumberInPreviousCheck[ithread] + ); + }else{ + printf("\nPackets Lost:%d" + "\tPacketsFromLastCheck:%lld" + "\tCurrentFrameNumber:%lld" + "\tPreviousFrameNumber:%lld\n", + ( ((int)(currentFrameNumber[ithread]-frameNumberInPreviousCheck[ithread])*packetsPerFrame) - totalWritingPacketCountFromLastCheck[ithread]), + totalWritingPacketCountFromLastCheck[ithread], + currentFrameNumber[ithread], + frameNumberInPreviousCheck[ithread] + ); + } } closeFile(ithread); @@ -2916,12 +2929,10 @@ void UDPStandardImplementation::handleWithoutMissingPackets(int ithread, char* w //Print packet loss and filenames if(tempframenumber && (tempframenumber%(maxFramesPerFile/10)) == 0){ - cprintf(BLUE,"\nThread:%d" - "\t\tPackets Lost:%d" + cprintf(BLUE,"\nPackets Lost:%d" "\tPacketsFromLastCheck:%lld" "\tCurrentFrameNumber:%lld" "\tPreviousFrameNumber:%lld\n", - ithread, ( ((int)(currentFrameNumber[ithread]-frameNumberInPreviousCheck[ithread])*packetsPerFrame) - totalWritingPacketCountFromLastCheck[ithread]), totalWritingPacketCountFromLastCheck[ithread], currentFrameNumber[ithread],