--- a/kerneltest/e32test/usbho/t_usbdi/src/hostisochronoustransfers.cpp Thu Aug 19 11:14:22 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/hostisochronoustransfers.cpp Tue Aug 31 16:34:26 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
@@ -17,6 +17,10 @@
//
#include "hosttransfers.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "hostisochronoustransfersTraces.h"
+#endif
#include <e32debug.h>
#include <e32test.h>
@@ -31,21 +35,24 @@
iTransferDescriptor(aMaxPacketSize,aMaxNumPackets),
iMaxPacketSize(aMaxPacketSize)
{
- RDebug::Printf("aMaxPacketSize = %d, aMaxNumPackets = %d",aMaxPacketSize, aMaxNumPackets);
+ OstTraceFunctionEntryExt( CISOCHTRANSFER_CISOCHTRANSFER_ENTRY, this );
+ OstTraceExt2(TRACE_NORMAL, CISOCHTRANSFER_CISOCHTRANSFER, "aMaxPacketSize = %d, aMaxNumPackets = %d",aMaxPacketSize, aMaxNumPackets);
+ OstTraceFunctionExit1( CISOCHTRANSFER_CISOCHTRANSFER_EXIT, this );
}
CIsochTransfer::~CIsochTransfer()
{
- LOG_FUNC
+ OstTraceFunctionEntry1( CISOCHTRANSFER_CISOCHTRANSFER_ENTRY_DUP01, this );
// Cancel the transfer
Cancel();
+ OstTraceFunctionExit1( CISOCHTRANSFER_CISOCHTRANSFER_EXIT_DUP01, this );
}
TBool CIsochTransfer::DataPolled(TUint aPacketsToBeRead, RBuf8& aDataPolled)
{
- LOG_FUNC
+ OstTraceFunctionEntryExt( CISOCHTRANSFER_DATAPOLLED_ENTRY, this );
TInt numOfPacketsReturned = 0;
TInt firstPacketIndex = 0;
@@ -57,26 +64,27 @@
do {
TPtrC8 ptrRet = iTransferDescriptor.Packets(firstPacketIndex, packetsToBeRead, numOfPacketsReturned);
- RDebug::Printf("numOfPacketsReturned = %d", numOfPacketsReturned);
- RDebug::Printf("ptrRet.Length() = %d", ptrRet.Length());
+ OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_DATAPOLLED, "numOfPacketsReturned = %d", numOfPacketsReturned);
+ OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_DATAPOLLED_DUP01, "ptrRet.Length() = %d", ptrRet.Length());
firstPacketIndex = numOfPacketsReturned;
totalPacketsRead += numOfPacketsReturned;
packetsToBeRead = packetsToBeRead - numOfPacketsReturned;
- RDebug::Printf("totalPacketsRead = %d", totalPacketsRead);
- RDebug::Printf("packetsToBeRead = %d", packetsToBeRead);
+ OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_DATAPOLLED_DUP02, "totalPacketsRead = %d", totalPacketsRead);
+ OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_DATAPOLLED_DUP03, "packetsToBeRead = %d", packetsToBeRead);
aDataPolled.Append(ptrRet);
} while(totalPacketsRead != aPacketsToBeRead);
+ OstTraceFunctionExitExt( CISOCHTRANSFER_DATAPOLLED_EXIT, this, ETrue );
return ETrue;
}
TInt CIsochTransfer::TransferInL(TInt aPacketsExpected)
{
- LOG_FUNC
+ OstTraceFunctionEntryExt( CISOCHTRANSFER_TRANSFERINL_ENTRY, this );
// Activate the asynchronous transfer
- RDebug::Printf("Activating isoch. in transfer");
+ OstTrace0(TRACE_NORMAL, CISOCHTRANSFER_TRANSFERINL, "Activating isoch. in transfer");
iTransferDescriptor.Reset();
TPacketLengths fullLengths = iTransferDescriptor.Lengths();
@@ -86,36 +94,38 @@
fullLengths[packet] = iMaxPacketSize;
}
- RDebug::Printf("fullLengths.MaxNumPackets() == %d",fullLengths.MaxNumPackets());
+ OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_TRANSFERINL_DUP01, "fullLengths.MaxNumPackets() == %d",fullLengths.MaxNumPackets());
iTransferDescriptor.ReceivePackets(aPacketsExpected);
Pipe().Transfer(iTransferDescriptor,iStatus);
SetActive();
+ OstTraceFunctionExitExt( CISOCHTRANSFER_TRANSFERINL_EXIT, this, KErrNone );
return KErrNone;
}
TInt CIsochTransfer::RegisterTransferDescriptor()
{
- LOG_FUNC
+ OstTraceFunctionEntry1( CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR_ENTRY, this );
// Register the transfer descriptor with the interface
TInt err(Interface().RegisterTransferDescriptor(iTransferDescriptor));
if(err != KErrNone)
{
- RDebug::Printf("<Error %d> Unable to register transfer descriptor",err);
+ OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR, "<Error %d> Unable to register transfer descriptor",err);
}
+ OstTraceFunctionExitExt( CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR_EXIT, this, err );
return err;
}
TInt CIsochTransfer::PrepareTransfer(const TDesC8& aIsochData)
{
- LOG_FUNC
+OstTraceFunctionEntryExt( CISOCHTRANSFER_PREPARETRANSFER_ENTRY, this );
//
iTransferDescriptor.Reset();
TPacketLengths fullLengths = iTransferDescriptor.Lengths();
- RDebug::Printf("fullLengths.MaxNumPackets() == %d",fullLengths.MaxNumPackets());
+ OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_PREPARETRANSFER, "fullLengths.MaxNumPackets() == %d",fullLengths.MaxNumPackets());
//
TInt bytesRemaining(aIsochData.Size());
@@ -123,7 +133,7 @@
TInt startOffset(0);
TInt startPacket(0);
- RDebug::Printf("Audio data is %d bytes",bytesRemaining);
+ OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_PREPARETRANSFER_DUP01, "Audio data is %d bytes",bytesRemaining);
// Keep saving the isoch data to transfer in each packet buffer supplied
// by the transfer descriptor
@@ -136,7 +146,7 @@
if(dataToWrite == 0)
{
- RDebug::Printf("<Warning> dropping the rest of the isoch data");
+ OstTrace0(TRACE_NORMAL, CISOCHTRANSFER_PREPARETRANSFER_DUP02, "<Warning> dropping the rest of the isoch data");
break;
}
@@ -157,15 +167,18 @@
startOffset += maxPacket * iMaxPacketSize;
startPacket += maxPacket;
}
+ OstTraceFunctionExitExt( CISOCHTRANSFER_PREPARETRANSFER_EXIT, this, KErrNone );
return KErrNone;
}
TInt CIsochTransfer::TransferOut()
{
+ OstTraceFunctionEntry1( CISOCHTRANSFER_TRANSFEROUT_ENTRY, this );
// Transfer the iscohronous data
- RDebug::Printf("Activating isochronous out transfer");
+ OstTrace0(TRACE_NORMAL, CISOCHTRANSFER_TRANSFEROUT, "Activating isochronous out transfer");
Pipe().Transfer(iTransferDescriptor,iStatus);
SetActive();
+ OstTraceFunctionExitExt( CISOCHTRANSFER_TRANSFEROUT_EXIT, this, KErrNone );
return KErrNone;
}