diff -r 516af714ebb4 -r f2950aff7424 perfsrv/analyzetool/dynamicmemoryhook/src/analyzetoolfilelog.cpp --- a/perfsrv/analyzetool/dynamicmemoryhook/src/analyzetoolfilelog.cpp Fri Sep 17 08:38:31 2010 +0300 +++ b/perfsrv/analyzetool/dynamicmemoryhook/src/analyzetoolfilelog.cpp Mon Oct 04 02:45:59 2010 +0300 @@ -63,10 +63,12 @@ { LOGSTR1( "ATFL CATFileLog::ATFileLogVersion()" ); + TInt err( KErrNone ); + iFile << KDataFileVersion; - iFile.CommitL(); - return KErrNone; + TRAP( err, iFile.CommitL() ); + return err; } TInt RATFileLog::ATFileLogProcessStarted( const TDesC8& aProcessName, @@ -77,6 +79,8 @@ { LOGSTR1( "ATFL CATFileLog::ATFileLogProcessStarted()" ); + TInt err( KErrNone ); + // log the current time iFile << this->CurrentTime(); @@ -89,9 +93,9 @@ iFile << aApiVersion; // ensure that any buffered data is written to the stream - iFile.CommitL(); + TRAP( err, iFile.CommitL() ); - return KErrNone; + return err; } // ----------------------------------------------------------------------------- @@ -102,7 +106,9 @@ TInt RATFileLog::ATFileLogProcessEnded( TUint aHandleLeakCount ) { LOGSTR1( "ATFL CATFileLog::ATFileLogProcessEnded()" ); - + + TInt err( KErrNone ); + if ( aHandleLeakCount > 0 ) { // HDL @@ -118,9 +124,9 @@ iFile << (TUint8)EProcessEnd; // ensure that any buffered data is written to the stream - iFile.CommitL(); + TRAP( err, iFile.CommitL() ); - return KErrNone; + return err; } @@ -133,7 +139,9 @@ TUint32 aEndAddress ) { LOGSTR1( "ATFL CATFileLog::ATFileLogDllLoaded()" ); - + + TInt err( KErrNone ); + // log the current time iFile << this->CurrentTime(); @@ -149,9 +157,9 @@ iFile << aEndAddress; // ensure that any buffered data is written to the stream - iFile.CommitL(); + TRAP( err, iFile.CommitL() ); - return KErrNone; + return err; } @@ -166,6 +174,8 @@ { LOGSTR1( "ATFL CATFileLog::ATFileLogDllUnloaded()" ); + TInt err( KErrNone ); + // log the current time iFile << this->CurrentTime(); @@ -181,9 +191,9 @@ iFile << aEndAddress; // ensure that any buffered data is written to the stream - iFile.CommitL(); + TRAP( err, iFile.CommitL() ); - return KErrNone; + return err; } @@ -199,6 +209,8 @@ { LOGSTR1( "ATFL CATFileLog::ATFileLogMemoryAllocated()" ); + TInt err( KErrNone ); + // ALH // ... @@ -234,9 +246,9 @@ } // ensure that any buffered data is written to the stream - iFile.CommitL(); + TRAP( err, iFile.CommitL() ); - return KErrNone; + return err; } @@ -251,6 +263,8 @@ { LOGSTR1( "ATFL CATFileLog::ATFileLogMemoryFreed()" ); + TInt err( KErrNone ); + // FRH // ... @@ -287,9 +301,9 @@ } // ensure that any buffered data is written to the stream - iFile.CommitL(); + TRAP( err, iFile.CommitL() ); - return KErrNone; + return err; } @@ -303,7 +317,9 @@ TInt aSize, TUint aThreadId ) { LOGSTR1( "ATFL CATFileLog::ATFileLogMemoryReallocated()" ); - + + TInt err( KErrNone ); + // RAH // ... @@ -342,9 +358,9 @@ } // ensure that any buffered data is written to the stream - iFile.CommitL(); + TRAP( err, iFile.CommitL() ); - return KErrNone; + return err; } @@ -357,6 +373,8 @@ { LOGSTR1( "ATFL CATFileLog::ATFileLogThreadStarted()" ); + TInt err( KErrNone ); + // log the current time iFile << this->CurrentTime(); @@ -368,9 +386,9 @@ iFile << (TUint32)aThreadId; // ensure that any buffered data is written to the stream - iFile.CommitL(); + TRAP( err, iFile.CommitL() ); - return KErrNone; + return err; } @@ -381,22 +399,24 @@ // TInt RATFileLog::ATFileLogThreadEnded( TUint64 aThreadId ) { - LOGSTR1( "ATFL CATFileLog::ATFileLogThreadEnded()" ); - - // log the current time - iFile << this->CurrentTime(); - - // TDE - - // TDE - iFile << (TUint8)EThreadEnd; - // thread ID - iFile << (TUint32)aThreadId; - - // ensure that any buffered data is written to the stream - iFile.CommitL(); - - return KErrNone; + LOGSTR1( "ATFL CATFileLog::ATFileLogThreadEnded()" ); + + TInt err( KErrNone ); + + // log the current time + iFile << this->CurrentTime(); + + // TDE + + // TDE + iFile << (TUint8)EThreadEnd; + // thread ID + iFile << (TUint32)aThreadId; + + // ensure that any buffered data is written to the stream + TRAP( err, iFile.CommitL() ); + + return err; } @@ -410,6 +430,8 @@ { LOGSTR1( "ATFL CATFileLog::ATFileLogVersionsInfo()" ); + TInt err( KErrNone ); + // log the current time iFile << this->CurrentTime(); @@ -421,9 +443,9 @@ iFile << aChecksum; // ensure that any buffered data is written to the stream - iFile.CommitL(); + TRAP( err, iFile.CommitL() ); - return KErrNone; + return err; }