smsprotocols/smsstack/smsprot/Src/smspclass0stor.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
child 69 b982c3e940f3
--- a/smsprotocols/smsstack/smsprot/Src/smspclass0stor.cpp	Thu Aug 19 11:03:36 2010 +0300
+++ b/smsprotocols/smsstack/smsprot/Src/smspclass0stor.cpp	Tue Aug 31 16:23:08 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 "Eclipse Public License v1.0"
@@ -18,6 +18,12 @@
 /**
  @file
 */
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "smspclass0storTraces.h"
+#endif
+
 #include "smspclass0stor.h"
 #include "gsmubuf.h"
 #include "gsmunonieoperations.h"
@@ -51,7 +57,7 @@
 */
 CSmsPermanentFileStore* CSmsPermanentFileStore::NewL(RFs& aFs, const TDesC& aFileName, const TUid& aThirdUid)
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::NewL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_NEWL_1, "CSmsPermanentFileStore::NewL()");
 	CSmsPermanentFileStore*  self = new (ELeave) CSmsPermanentFileStore(aFs, aThirdUid);
 	CleanupStack::PushL(self);
 	self->ConstructL(aFileName);
@@ -62,7 +68,7 @@
 
 void CSmsPermanentFileStore::ConstructL(const TDesC& aFileName)
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::ConstructL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_CONSTRUCTL_1, "CSmsPermanentFileStore::ConstructL()");
 	iFileName = aFileName.AllocL();
 	}
 
@@ -109,7 +115,7 @@
 */
 void CSmsPermanentFileStore::CreateL()
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::CreateL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_CREATEL_1, "CSmsPermanentFileStore::CreateL()");
 	TUidType uidtype(KPermanentFileStoreLayoutUid,KSARStoreUid,iThirdUid);
 	iFileStore=CPermanentFileStore::ReplaceL(iFs, iFileName->Des(), EFileShareExclusive|EFileStream|EFileRead|EFileWrite);
 	iFileStore->SetTypeL(uidtype);
@@ -129,7 +135,7 @@
 */
 void CSmsPermanentFileStore::OpenL()
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::OpenL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_OPENL_1, "CSmsPermanentFileStore::OpenL()");
 	iFileStore=CPermanentFileStore::OpenL(iFs,iFileName->Des(),EFileShareExclusive|EFileStream|EFileRead|EFileWrite);
 	InternalizeEntryArrayL();
 	}
@@ -141,7 +147,7 @@
 */
 void CSmsPermanentFileStore::Close()
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::Close()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_CLOSE_1, "CSmsPermanentFileStore::Close()");
 	delete iFileStore;
 	iFileStore = NULL;
 	iEntryArray.Reset();
@@ -165,7 +171,7 @@
 	{
     // Ignore in code coverage - a previous CleanupEntries would need to have failed with KErrDiskFull
 	BULLSEYE_OFF
-	LOGSMSPROT1("CSmsPermanentFileStore::CleanupEntriesWithCompactL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_CLEANUPENTRIESWITHCOMPACTL_1, "CSmsPermanentFileStore::CleanupEntriesWithCompactL()");
 
 	iCompact = ETrue;
 	CleanupEntriesL(aEntryArray);
@@ -187,7 +193,7 @@
 */
 void CSmsPermanentFileStore::CleanupEntriesL(const CArrayFix<TSmsPreAllocatedFileStoreReassemblyEntry>& aEntryArray)
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::CleanupEntriesL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_CLEANUPENTRIESL_1, "CSmsPermanentFileStore::CleanupEntriesL()");
 
 	TInt reassemblyCount = iEntryArray.Count();
 	TInt index, index2;
@@ -257,7 +263,7 @@
 */
 void CSmsPermanentFileStore::InternalizeEntryArrayL()
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::InternalizeEntryArrayL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_INTERNALIZEENTRYARRAYL_1, "CSmsPermanentFileStore::InternalizeEntryArrayL()");
 
 	iEntryArray.Reset();
 	TStreamId headerid=iFileStore->Root();
@@ -280,8 +286,7 @@
 */
 void CSmsPermanentFileStore::ExternalizeEntryArrayL()
 	{
-	LOGSMSPROT4("CSmsPermanentFileStore::ExternalizeEntryArrayL(): this=0x%08X count=%d headerid=%d]",
-			 this, iEntryArray.Count(), iFileStore->Root().Value());
+	OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_EXTERNALIZEENTRYARRAYL_1, "CSmsPermanentFileStore::ExternalizeEntryArrayL(): this=0x%08X count=%d headerid=%u]",(TUint) this, iEntryArray.Count(), (TUint)iFileStore->Root().Value());
 
 	TStreamId headerid=iFileStore->Root();
 	RStoreWriteStream stream;
@@ -330,7 +335,7 @@
 */
 void CSmsPermanentFileStore::AddNewMessageL(TInt& aIndex, CSmsMessage& aSmsMessage,const TGsmSms& aGsmSms)
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::AddNewMessageL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_ADDNEWMESSAGEL_1, "CSmsPermanentFileStore::AddNewMessageL");
 
 	CArrayFix<TInt>* indexArray=new(ELeave) CArrayFixFlat<TInt>(KFlatArrayGranularity);
 	CleanupStack::PushL(indexArray);
@@ -371,7 +376,7 @@
 */
 void CSmsPermanentFileStore::UpdateExistingMessageL(TInt aIndex, const CSmsMessage& aSmsMessage,const CArrayFix<TInt>& aIndexArray,const CArrayFix<TGsmSms>& aSmsArray)
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::UpdateExistingMessageL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_UPDATEEXISTINGMESSAGEL_1, "CSmsPermanentFileStore::UpdateExistingMessageL()");
 	TStreamId  streamid = iEntryArray[aIndex].DataStreamId();
 	ExternalizeEntryL(streamid, aSmsMessage, aIndexArray, aSmsArray);
 	TSmsReassemblyEntry entry;
@@ -392,7 +397,7 @@
 void CSmsPermanentFileStore::MatchEntryToExistingMessage(const TReassemblyEntry& aEntry,
 													TInt& aIndex)
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::MatchEntryToExistingMessage()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_MATCHENTRYTOEXISTINGMESSAGE_1, "CSmsPermanentFileStore::MatchEntryToExistingMessage()");
 
 	aIndex = KErrNotFound;
 
@@ -418,7 +423,7 @@
 			}
 		}
 
-	LOGSMSPROT2("CSmsPermanentFileStore::MatchEntryToExistingMessage(): aIndex=%d", aIndex);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_MATCHENTRYTOEXISTINGMESSAGE_2, "CSmsPermanentFileStore::MatchEntryToExistingMessage(): aIndex=%d", aIndex);
 	}
 
 /*
@@ -431,7 +436,7 @@
 */
 void CSmsPermanentFileStore::UpdateLogServerIdL(TInt& aIndex, TLogId aLogServerId)
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::UpdateLogServerIdL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_UPDATELOGSERVERIDL_1, "CSmsPermanentFileStore::UpdateLogServerIdL");
 
 	TSmsReassemblyEntry entry;
 	entry = iEntryArray[aIndex];
@@ -453,7 +458,7 @@
 */
 void CSmsPermanentFileStore::SetPassedToClientL(TInt aIndex, TBool aBool)
 	{
-	LOGSMSPROT2("CSmsPermanentFileStore::SetPassedToClientL(): aIndex=%d", aIndex);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_SETPASSEDTOCLIENTL_1, "CSmsPermanentFileStore::SetPassedToClientL(): aIndex=%d", aIndex);
 
 	TSmsReassemblyEntry entry;
 	entry = iEntryArray[aIndex];
@@ -488,7 +493,7 @@
 */
 void CSmsPermanentFileStore::ChangeEntryL(TInt aIndex,const TSmsReassemblyEntry& aNewEntry)
 	{
-	LOGSMSPROT2("CSmsPermanentFileStore::ChangeEntryL(): aIndex=%d", aIndex);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_CHANGEENTRYL_1, "CSmsPermanentFileStore::ChangeEntryL(): aIndex=%d", aIndex);
 
 	iEntryArray[aIndex].SetIsDeleted(ETrue);
 	iEntryArray.InsertL(aIndex,aNewEntry);
@@ -520,7 +525,7 @@
 */
 void CSmsPermanentFileStore::ExternalizeEntryL(TStreamId& aStreamId,const CSmsMessage& aSmsMessage,const CArrayFix<TInt>& aIndexArray,const CArrayFix<TGsmSms>& aSmsArray)
 	{
-	LOGSMSPROT2("CSmsPermanentFileStore::ExternalizeEntryL Start [sid=%d]", aStreamId.Value());
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_EXTERNALIZEENTRYL_1, "CSmsPermanentFileStore::ExternalizeEntryL Start [sid=%d]", aStreamId.Value());
 
 	RStoreWriteStream writestream;
 	if (aStreamId==KNullStreamId)
@@ -544,7 +549,7 @@
 	writestream.CommitL();
 	CleanupStack::PopAndDestroy();
 
-	LOGSMSPROT2("CClass0PermanentFileStore::ExternalizeEntryL End [count=%d]", count);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_EXTERNALIZEENTRYL_2, "CClass0PermanentFileStore::ExternalizeEntryL End [count=%d]", count);
 	}
 
 /*
@@ -560,7 +565,7 @@
 void CSmsPermanentFileStore::InternalizeEntryL(const TInt aIndex, CSmsMessage& aSmsMessage, CArrayFix<TInt>& aIndexArray, CArrayFix<TGsmSms>& aSmsArray)
 	{
 	TSmsReassemblyEntry&  entry = iEntryArray[aIndex];
-	LOGSMSPROT2("CSmsPermanentFileStore::InternalizeEntryL Start [sid=%d]", entry.DataStreamId().Value());
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_INTERNALIZEENTRYL_1, "CSmsPermanentFileStore::InternalizeEntryL Start [sid=%d]", entry.DataStreamId().Value());
 	RStoreReadStream readstream;
 	readstream.OpenLC(*iFileStore, entry.DataStreamId());
 	readstream >> aSmsMessage;
@@ -589,7 +594,7 @@
 	aSmsMessage.SetStorage(entry.Storage());
 	aSmsMessage.SetLogServerId(entry.LogServerId());
 	aSmsMessage.SetTime(entry.Time());
-	LOGSMSPROT2("CSmsPermanentFileStore::InternalizeEntryL End [count=%d]", count);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_INTERNALIZEENTRYL_2, "CSmsPermanentFileStore::InternalizeEntryL End [count=%d]", count);
 	}
 
 /*
@@ -607,7 +612,7 @@
 */
 void CSmsPermanentFileStore::RemovePDUsL(TInt aIndex, TInt aStartPos, TInt aEndPos)
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::RemovePDUsL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_REMOVEPDUSL_1, "CSmsPermanentFileStore::RemovePDUsL");
 
 	CSmsBuffer*  buffer = CSmsBuffer::NewL();
 	CSmsMessage*  smsMessage = CSmsMessage::NewL(iFs, CSmsPDU::ESmsDeliver, buffer);
@@ -664,11 +669,11 @@
  */
 void CSmsPermanentFileStore::BeginTransactionL()
 	{
-    LOGSMSPROT4("CSmsPermanentFileStore::BeginTransactionL [this=0x%08X iInTransaction=%d iFileStore=0x%08X]", this, iInTransaction, iFileStore);
+    OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_BEGINTRANSACTIONL_1, "CSmsPermanentFileStore::BeginTransactionL [this=0x%08X iInTransaction=%d iFileStore=0x%08X]", (TUint)this, iInTransaction, (TUint)iFileStore);
 
 	if (iFileStore == NULL || iInTransaction)
 		{
-		LOGSMSPROT1("WARNING CSmsPermanentFileStore::BeginTransactionL leaving with KErrAccessDenied");
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_BEGINTRANSACTIONL_2, "WARNING CSmsPermanentFileStore::BeginTransactionL leaving with KErrAccessDenied");
 		User::Leave(KErrAccessDenied);
 		}
 
@@ -680,8 +685,7 @@
  */
 void CSmsPermanentFileStore::Revert()
 	{
-	LOGSMSPROT3("CSmsPermanentFileStore::Revert(): this=0x%08X, iInTransaction=%d",
-    		 this, iInTransaction);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_REVERT_1, "CSmsPermanentFileStore::Revert(): this=0x%08X, iInTransaction=%d",(TUint)this, iInTransaction);
 
 	iFileStore->Revert();
 	iInTransaction = EFalse;
@@ -693,11 +697,18 @@
  */
 void CSmsPermanentFileStore::DoCommitAndCompactL()
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::DoCommitAndCompactL()");
-
-	LOGSMSPROTTIMESTAMP();
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_DOCOMMITANDCOMPACTL_1, "CSmsPermanentFileStore::DoCommitAndCompactL()");
+
+#if (OST_TRACE_CATEGORY & OST_TRACE_CATEGORY_DEBUG) 
+    TBuf<40> timestamp;
+    SmsTimeStampL(timestamp);
+    OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS,CSMSPERMANENTFILESTORE_DOCOMMITANDCOMPACTL_2, "%S",timestamp);
+#endif
 	iFileStore->CommitL();
-	LOGSMSPROTTIMESTAMP();
+#if (OST_TRACE_CATEGORY & OST_TRACE_CATEGORY_DEBUG) 
+    SmsTimeStampL(timestamp);
+    OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS,CSMSPERMANENTFILESTORE_DOCOMMITANDCOMPACTL_3, "%S",timestamp);
+#endif
 
 	iCommitCount--;
 	if ((iCommitCount < 0) || (iCompact))
@@ -714,16 +725,15 @@
  */
 void CSmsPermanentFileStore::CommitTransactionL()
 	{
-	LOGSMSPROT4("CSmsPermanentFileStore::CommitTransactionL(): this=0x%08X iInTransaction=%d iFileStore=0x%08X",
-    		 this, iInTransaction, iFileStore);
+	OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_COMMITTRANSACTIONL_1, "CSmsPermanentFileStore::CommitTransactionL(): this=0x%08X iInTransaction=%d iFileStore=0x%08X",(TUint)this, iInTransaction, (TUint)iFileStore);
 
 	ExternalizeEntryArrayL();
 
-#ifdef _SMS_LOGGING_ENABLED
+#ifdef OST_TRACE_COMPLIER_IN_USE
 	TRAPD(err, DoCommitAndCompactL());
 	if (err != KErrNone)
 		{
-		LOGGSMU2("WARNING! could not CommitL/CompactL due to %d", err);
+		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_COMMITTRANSACTIONL_2, "WARNING! could not CommitL/CompactL due to %d", err);
 		User::Leave(err);
 		}
 #else
@@ -740,7 +750,7 @@
  */
 void CSmsPermanentFileStore::RemoveDeletedEntries()
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::RemoveDeletedEntries()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_REMOVEDELETEDENTRIES_1, "CSmsPermanentFileStore::RemoveDeletedEntries()");
 
 	TInt count=iEntryArray.Count();
 	while (count--)
@@ -764,7 +774,7 @@
  */
 void CSmsPermanentFileStore::ReinstateDeletedEntries()
 	{
-	LOGSMSPROT1("CSmsPermanentFileStore::ReinstateDeletedEntries()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPERMANENTFILESTORE_REINSTATEDELETEDENTRIES_1, "CSmsPermanentFileStore::ReinstateDeletedEntries()");
 
 	TInt count=iEntryArray.Count();
 	while (count--)
@@ -849,7 +859,7 @@
 */
 CPreallocatedFile* CPreallocatedFile::NewL(RFs& aFs, const TDesC& aFileName, TInt aMaxClass0Msg, TInt aMaxPDUSeg, TPreAllocatedFileVersion aVersion)
 	{
-	LOGSMSPROT1("CPreallocatedFile::NewL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_NEWL_1, "CPreallocatedFile::NewL()");
 	CPreallocatedFile*  self = new (ELeave) CPreallocatedFile(aFs, aMaxClass0Msg, aMaxPDUSeg, aVersion);
 	CleanupStack::PushL(self);
 	self->ConstructL(aFileName);
@@ -860,7 +870,7 @@
 
 void CPreallocatedFile::ConstructL(const TDesC& aFileName)
 	{
-	LOGSMSPROT1("CPreallocatedFile::ConstructL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_CONSTRUCTL_1, "CPreallocatedFile::ConstructL()");
 	iFileName = aFileName.AllocL();
 	}
 
@@ -914,7 +924,7 @@
 */
 TBool CPreallocatedFile::IsFileOK()
 	{
-	LOGSMSPROT1("CPreallocatedFile::IsFileOK()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_ISFILEOK_1, "CPreallocatedFile::IsFileOK()");
 
 	TEntry entry;
 	//  Check file exists
@@ -943,7 +953,7 @@
 */
 void CPreallocatedFile::CreateL()
 	{
-	LOGSMSPROT1("CPreallocatedFile::CreateL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_CREATEL_1, "CPreallocatedFile::CreateL");
 
 	User::LeaveIfError(iFile.Replace(iFs, iFileName->Des(), EFileWrite));
 	User::LeaveIfError(iFile.SetSize(iSizeOfFile));
@@ -1098,7 +1108,7 @@
 */
 void CPreallocatedFile::AddNewMessageL(TInt& aIndex, CSmsMessage& aSmsMessage,const TGsmSms& aGsmSms)
 	{
-	LOGSMSPROT1("CPreallocatedFile::AddNewMessageL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_ADDNEWMESSAGEL_1, "CPreallocatedFile::AddNewMessageL");
 	//Gets the next free slot where the message will be stored.
 	TInt nextFreeSlot = GetFreeContainer();
 	TInt pduIndex=aSmsMessage.IsDecoded()? 0: aSmsMessage.SmsPDU().ConcatenatedMessagePDUIndex();
@@ -1147,7 +1157,7 @@
 */
 void CPreallocatedFile::UpdateExistingMessageL(TInt aIndex, const CSmsMessage& aSmsMessage, TInt aPduIndex, const TGsmSms& aSms)
 	{
-	LOGSMSPROT1("CPreallocatedFile::UpdateExistingMessageL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_UPDATEEXISTINGMESSAGEL_1, "CPreallocatedFile::UpdateExistingMessageL()");
 	TInt preAllocatedStorageId = iEntryArray[aIndex].PreAllocatedStorageId();
 	if (preAllocatedStorageId == KErrNotFound)
 		{
@@ -1195,7 +1205,7 @@
 void CPreallocatedFile::MatchEntryToExistingMessage(const TReassemblyEntry& aEntry,
 													TInt& aIndex)
 	{
-	LOGSMSPROT1("CPreallocatedFile::MatchEntryToExistingMessage()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_MATCHENTRYTOEXISTINGMESSAGE_1, "CPreallocatedFile::MatchEntryToExistingMessage()");
 
 	aIndex = KErrNotFound;
 
@@ -1222,7 +1232,7 @@
 			}
 		}
 
-	LOGSMSPROT2("CPreallocatedFile::MatchEntryToExistingMessage(): aIndex=%d", aIndex);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_MATCHENTRYTOEXISTINGMESSAGE_2, "CPreallocatedFile::MatchEntryToExistingMessage(): aIndex=%d", aIndex);
 	}
 
 /*
@@ -1235,7 +1245,7 @@
 */
 void CPreallocatedFile::UpdateLogServerIdL(TInt& aIndex, TLogId aLogServerId)
 	{
-	LOGSMSPROT1("CPreallocatedFile::UpdateLogServerId");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_UPDATELOGSERVERIDL_1, "CPreallocatedFile::UpdateLogServerId");
 
 	TSmsPreAllocatedFileStoreReassemblyEntry entry;
 	entry = iEntryArray[aIndex];
@@ -1257,7 +1267,7 @@
 */
 void CPreallocatedFile::SetPassedToClientL(TInt aIndex, TBool aBool)
 	{
-	LOGSMSPROT2("CPreallocatedFile::SetPassedToClientL(): aIndex=%d", aIndex);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_SETPASSEDTOCLIENTL_1, "CPreallocatedFile::SetPassedToClientL(): aIndex=%d", aIndex);
 
 	TSmsPreAllocatedFileStoreReassemblyEntry entry;
 	entry = iEntryArray[aIndex];
@@ -1278,7 +1288,7 @@
 */
 void CPreallocatedFile::AddEntryL(TSmsPreAllocatedFileStoreReassemblyEntry& aEntry)
 	{
-	LOGSMSPROT1("CPreallocatedFile::AddEntryL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_ADDENTRYL_1, "CPreallocatedFile::AddEntryL");
 	iEntryArray.AppendL(aEntry);
 	iEntryArray[iEntryArray.Count()-1].SetIsAdded(ETrue);
 	}
@@ -1293,7 +1303,7 @@
 */
 void CPreallocatedFile::ChangeEntryL(TInt aIndex, const TSmsPreAllocatedFileStoreReassemblyEntry& aNewEntry)
 	{
-	LOGSMSPROT2("CPreallocatedFile::ChangeEntryL(): aIndex=%d", aIndex);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_CHANGEENTRYL_1, "CPreallocatedFile::ChangeEntryL(): aIndex=%d", aIndex);
 	iEntryArray[aIndex].SetIsDeleted(ETrue);
 	iEntryArray.InsertL(aIndex,aNewEntry);
 	iEntryArray[aIndex].SetIsAdded(ETrue);
@@ -1308,7 +1318,7 @@
 */
 void CPreallocatedFile::DeleteEntryL(TInt aIndex)
 	{
-	LOGSMSPROT2("CPreallocatedFile::DeleteEntryL(): aIndex=%d", aIndex);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_DELETEENTRYL_1, "CPreallocatedFile::DeleteEntryL(): aIndex=%d", aIndex);
 	if (iEntryArray[aIndex].PreAllocatedStorageId() != KErrNotFound)
 		{
 		ClearEntryL(iEntryArray[aIndex].PreAllocatedStorageId(), iEntryArray[aIndex].Count());
@@ -1338,7 +1348,7 @@
 */
 void CPreallocatedFile::ClearEntryL(TInt aStorageId, TInt aNumberOfPDUs)
 	{
-	LOGSMSPROT1("CPreallocatedFile::ClearEntryL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_CLEARENTRYL_1, "CPreallocatedFile::ClearEntryL");
 
 	//Read storage id.
 	TInt storageId;
@@ -1486,7 +1496,7 @@
 */
 void CPreallocatedFile::ExternalizeEntry(TInt aContainerId, const TGsmSmsSlotEntry& aSmsSlot, TInt aIndex, const TGsmSms& aGsmSms)
 	{
-	LOGSMSPROT3("CPreallocatedFile::ExternalizeEntry() 1: aContainerId=%d, aIndex=%d", aContainerId, aIndex);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_EXTERNALIZEENTRY_1, "CPreallocatedFile::ExternalizeEntry() 1: aContainerId=%d, aIndex=%d", aContainerId, aIndex);
 
 	// Container id must not be greater than max pdu segment.
 	TInt pos = iBeginOfDataSection + ((aContainerId - 1) * (KSizeOfGsmSmsSlotEntry + sizeof(TInt) + KSizeOfSmsGsmPDU));
@@ -1517,7 +1527,7 @@
 */
 void CPreallocatedFile::ExternalizeEntry(TInt aContainerId, TInt aIndex, const TGsmSms& aGsmSms)
 	{
-	LOGSMSPROT3("CPreallocatedFile::ExternalizeEntry() 2: aContainerId=%d, aIndex=%d", aContainerId, aIndex);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_EXTERNALIZEENTRY1_1, "CPreallocatedFile::ExternalizeEntry() 2: aContainerId=%d, aIndex=%d", aContainerId, aIndex);
 
 	// Container id must not be greater than max pdu segment.
 	TInt pos = iBeginOfDataSection + ((aContainerId - 1) * (KSizeOfGsmSmsSlotEntry + sizeof(TInt) + KSizeOfSmsGsmPDU));
@@ -1546,7 +1556,7 @@
 */
 void CPreallocatedFile::InternalizeEntryL(const TInt aIndex, CSmsMessage& aSmsMessage, CArrayFix<TInt>& aIndexArray, CArrayFix<TGsmSms>& aSmsArray)
 	{
-	LOGSMSPROT1("CPreallocatedFile::InternalizeEntryL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_INTERNALIZEENTRYL_1, "CPreallocatedFile::InternalizeEntryL");
 	TSmsPreAllocatedFileStoreReassemblyEntry&  entry = iEntryArray[aIndex];
 	//Set other properties of CSmsMessage
 	aSmsMessage.SetStorage(entry.Storage());
@@ -1558,7 +1568,7 @@
 	aSmsMessage.SetForwardToClient(entry.ForwardToClient());
 	aSmsMessage.SetToFromAddressL(entry.Description2());
 
-	LOGSMSPROT2("CPreallocatedFile::InternalizeEntryL Start [sid=%d]", entry.PreAllocatedStorageId());
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_INTERNALIZEENTRYL_2, "CPreallocatedFile::InternalizeEntryL Start [sid=%d]", entry.PreAllocatedStorageId());
 	if (entry.PreAllocatedStorageId()==KErrNotFound)
 		{
 		return;
@@ -1618,7 +1628,7 @@
 			}
 		}
 
-	LOGSMSPROT2("CPreallocatedFile::InternalizeEntryL End [noOfPDUsRead=%d]", noOfPDUsRead);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_INTERNALIZEENTRYL_3, "CPreallocatedFile::InternalizeEntryL End [noOfPDUsRead=%d]", noOfPDUsRead);
 	}
 
 /*
@@ -1636,14 +1646,14 @@
 */
 void CPreallocatedFile::RemovePDUsL(TInt aIndex, TInt aStartPos, TInt aEndPos)
 	{
-	LOGSMSPROT1("CPreallocatedFile::RemovePDUsL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_REMOVEPDUSL_1, "CPreallocatedFile::RemovePDUsL");
 
 	if ((aStartPos < 1) || (aEndPos > 256) || (aStartPos > aEndPos))
 		{
 		User::Leave(KErrArgument);
 		}
 
-	LOGSMSPROT2("CPreallocatedFile::RemovePDUsL Start [sid=%d]", iEntryArray[aIndex].PreAllocatedStorageId());
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_REMOVEPDUSL_2, "CPreallocatedFile::RemovePDUsL Start [sid=%d]", iEntryArray[aIndex].PreAllocatedStorageId());
 	if (iEntryArray[aIndex].PreAllocatedStorageId()==KErrNotFound)
 		{
 		return;
@@ -1881,11 +1891,11 @@
  */
 void CPreallocatedFile::BeginTransactionL()
 	{
-	LOGSMSPROT3("CPreallocatedFile::BeginTransactionL [this=0x%08X iInTransaction=%d]", this, iInTransaction);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_BEGINTRANSACTIONL_1, "CPreallocatedFile::BeginTransactionL [this=0x%08X iInTransaction=%d]", (TUint)this, iInTransaction);
 
 	if (iInTransaction)
 		{
-	    LOGGSMU1("WARNING CPreallocatedFile::BeginTransactionL leaving with KErrAccessDenied");
+	    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_BEGINTRANSACTIONL_2, "WARNING CPreallocatedFile::BeginTransactionL leaving with KErrAccessDenied");
 		User::Leave(KErrAccessDenied);
 		}
 
@@ -1897,8 +1907,7 @@
  */
 void CPreallocatedFile::CommitTransactionL()
 	{
-	LOGSMSPROT3("CPreallocatedFile::CommitTransactionL(): this=0x%08X iInTransaction=%d",
-				this, iInTransaction);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_COMMITTRANSACTIONL_1, "CPreallocatedFile::CommitTransactionL(): this=0x%08X iInTransaction=%d",(TUint)this, iInTransaction);
 
 	ExternalizeEntryArray();
 	//Commit
@@ -1913,8 +1922,7 @@
 */
 void CPreallocatedFile::Revert()
 	{
-	LOGSMSPROT3("CPreallocatedFile::Revert(): this=0x%08X, iInTransaction=%d",
-    		 this, iInTransaction);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_REVERT_1, "CPreallocatedFile::Revert(): this=0x%08X, iInTransaction=%d",(TUint)this, iInTransaction);
 
 	ReinstateEntries();
 	ExternalizeEntryArray();
@@ -1928,7 +1936,7 @@
  */
 void CPreallocatedFile::RemoveDeletedEntries()
 	{
-	LOGSMSPROT1("CPreallocatedFile::RemoveDeletedEntries()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_REMOVEDELETEDENTRIES_1, "CPreallocatedFile::RemoveDeletedEntries()");
 
 	TInt count=iEntryArray.Count();
 	while (count--)
@@ -1952,7 +1960,7 @@
  */
 void CPreallocatedFile::ReinstateDeletedEntries()
 	{
-	LOGSMSPROT1("CPreallocatedFile::ReinstateDeletedEntries()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_REINSTATEDELETEDENTRIES_1, "CPreallocatedFile::ReinstateDeletedEntries()");
 
 	TInt count=iEntryArray.Count();
 	while (count--)
@@ -1978,7 +1986,7 @@
  */
 void CPreallocatedFile::ReinstateEntries()
 	{
-	LOGSMSPROT1("CPreallocatedFile::ReinstateEntries()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_REINSTATEENTRIES_1, "CPreallocatedFile::ReinstateEntries()");
 
 	TInt containerId;
 	TInt storageId;
@@ -2014,7 +2022,7 @@
 */
 TInt CPreallocatedFile::GetOldestMessageEntryIndex()
 	{
-	LOGSMSPROT1("CPreallocatedFile::GetOldestMessageEntryIndex()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPREALLOCATEDFILE_GETOLDESTMESSAGEENTRYINDEX_1, "CPreallocatedFile::GetOldestMessageEntryIndex()");
 
 	TInt index = KErrNotFound;
 	TTime time;
@@ -2044,7 +2052,7 @@
 */
 CGuardTimer* CGuardTimer::NewL(CClass0SmsReassemblyStore& aClass0ReassemblyStore, TInt aGuardTimeout)
 	{
-	LOGSMSPROT1("CGuardTimer::NewL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGUARDTIMER_NEWL_1, "CGuardTimer::NewL()");
 
 	CGuardTimer* timer = new(ELeave) CGuardTimer(aClass0ReassemblyStore, aGuardTimeout);
 	CleanupStack::PushL(timer);
@@ -2077,7 +2085,7 @@
  */
 void CGuardTimer::EnableGuardTimer()
 	{
-	LOGSMSPROT1("CGuardTimer::EnableGuardTimer()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGUARDTIMER_ENABLEGUARDTIMER_1, "CGuardTimer::EnableGuardTimer()");
 	if (!IsActive())
 		{
 		TTime nextTimeOut;
@@ -2099,7 +2107,7 @@
  */
 void CGuardTimer::RunL()
 	{
-	LOGSMSPROT2("CGuardTimer::RunL [iStatus=%d]", iStatus.Int());
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGUARDTIMER_RUNL_1, "CGuardTimer::RunL [iStatus=%d]", iStatus.Int());
 	iClass0ReassemblyStore.ProcessTimeoutMessageL();
 	EnableGuardTimer();
 	} // CGuardTimer::RunL
@@ -2120,7 +2128,7 @@
 */
 CClass0SmsReassemblyStore* CClass0SmsReassemblyStore::NewL(RFs& aFs, MSmsComm& aSmsComm)
 	{
-	LOGSMSPROT1("CClass0SmsReassemblyStore::NewL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_NEWL_1, "CClass0SmsReassemblyStore::NewL()");
 
 	CClass0SmsReassemblyStore*  self = new (ELeave) CClass0SmsReassemblyStore(aFs, aSmsComm);
 	CleanupStack::PushL(self);
@@ -2188,7 +2196,7 @@
 */
 void CClass0SmsReassemblyStore::ReadConfigurableClass0SmsSettingsL(TInt& aMaxClass0Msg, TInt& aMaxPDUSeg, TInt& aGuardTimeOut)
 	{
-	LOGSMSPROT1("CClass0SmsReassemblyStore::ReadConfigurableClass0SmsSettingsL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_READCONFIGURABLECLASS0SMSSETTINGSL_1, "CClass0SmsReassemblyStore::ReadConfigurableClass0SmsSettingsL()");
 
 	aMaxClass0Msg = KMaxNumberOfClass0MessagesInReassemblyStore;
 	aMaxPDUSeg    = KNumberOfPDUSegmentsStoredInOODCondition;
@@ -2198,7 +2206,7 @@
 	TRAPD(ret, ini=CESockIniData::NewL(_L("smswap.sms.esk")));
 	if(ret!=KErrNone)
 		{
-		LOGSMSPROT2("CESockIniData::NewL() returned=%d", ret);
+		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_READCONFIGURABLECLASS0SMSSETTINGSL_2, "CESockIniData::NewL() returned=%d", ret);
 		}
 	else
 		{
@@ -2209,7 +2217,7 @@
 			{
 			if (var > 0)
 				{
-				LOGSMSPROT2("MaxClass0Messages [%d]", var);
+				OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_READCONFIGURABLECLASS0SMSSETTINGSL_3, "MaxClass0Messages [%d]", var);
 				aMaxClass0Msg = var;
 				}
 			}
@@ -2218,7 +2226,7 @@
 			{
 			if (var > 0)
 				{
-				LOGSMSPROT2("MaxClass0Messages [%d]", var);
+				OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_READCONFIGURABLECLASS0SMSSETTINGSL_4, "MaxClass0Messages [%d]", var);
 				aMaxPDUSeg = var;
 				}
 			}
@@ -2227,7 +2235,7 @@
 			{
 			if (var > 0)
 				{
-				LOGSMSPROT2("MaxClass0Messages [%d]", var);
+				OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_READCONFIGURABLECLASS0SMSSETTINGSL_5, "MaxClass0Messages [%d]", var);
 				aGuardTimeOut = var;
 				}
 			}
@@ -2235,8 +2243,7 @@
 		CleanupStack::PopAndDestroy(ini);
 		}
 
-	LOGSMSPROT4("CClass0SmsReassemblyStore::ReadConfigurableClass0SmsSettingsL(): aMaxClass0Msg=%d, aMaxPDUSeg=%d, aGuardTimeOut=%d",
-			    aMaxClass0Msg, aMaxPDUSeg, aGuardTimeOut);
+	OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_READCONFIGURABLECLASS0SMSSETTINGSL_6, "CClass0SmsReassemblyStore::ReadConfigurableClass0SmsSettingsL(): aMaxClass0Msg=%d, aMaxPDUSeg=%d, aGuardTimeOut=%d",aMaxClass0Msg, aMaxPDUSeg, aGuardTimeOut);
 	}
 
 /**
@@ -2247,7 +2254,7 @@
 */
 void CClass0SmsReassemblyStore::OpenStoreL()
 	{
-	LOGSMSPROT1("CClass0SmsReassemblyStore::OpenStoreL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_OPENSTOREL_1, "CClass0SmsReassemblyStore::OpenStoreL()");
 	TFileName pathName;
 	CReassemblyStoreUtility::PrivatePath(iFs, pathName);
 	//Create the directory if it is not created.
@@ -2274,7 +2281,7 @@
 */
 void CClass0SmsReassemblyStore::Close()
 	{
-	LOGSMSPROT1("CClass0SmsReassemblyStore::CloseStore()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_CLOSE_1, "CClass0SmsReassemblyStore::CloseStore()");
 	iGuardTimer->DisableGuardTimer();
 	iEntryArray.Reset();
 	iPreallocatedFile->Close();
@@ -2290,7 +2297,7 @@
 */
 void CClass0SmsReassemblyStore::PopulateEntryArrayL(CArrayFix<TReassemblyEntry>& aEntryArray)
 	{
-	LOGSMSPROT1("CClass0SmsReassemblyStore::PopulateEntryArrayL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_POPULATEENTRYARRAYL_1, "CClass0SmsReassemblyStore::PopulateEntryArrayL()");
 	aEntryArray.Reset();
 	//Populate Entries from Pre-allocated file.
 	for (TInt count = 0; count < iPreallocatedFile->Entries().Count(); count++)
@@ -2355,7 +2362,7 @@
 		}
 	else if (ret == KErrDiskFull)
 		{
-		LOGSMSPROT1("CleanReassemblyEntries() returns KErrDiskFull");
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_POPULATEENTRYARRAYL_2, "CleanReassemblyEntries() returns KErrDiskFull");
 		/*
 		In this case permanent store file contains incorrect information.
 		For example forwarded message might be still stored in this store.
@@ -2423,7 +2430,7 @@
 */
 void CClass0SmsReassemblyStore::SetDiskSpaceState(TSmsDiskSpaceMonitorStatus aDiskSpaceStatus)
 	{
-	LOGSMSPROT1("CClass0SmsReassemblyStore::SetDiskSpaceState()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_SETDISKSPACESTATE_1, "CClass0SmsReassemblyStore::SetDiskSpaceState()");
 	iDiskSpaceStatus = aDiskSpaceStatus;
 	}
 
@@ -2441,7 +2448,7 @@
 */
 void CClass0SmsReassemblyStore::AddNewMessageL(CSmsMessage& aSmsMessage,const TGsmSms& aGsmSms)
 	{
-	LOGSMSPROT1("CClass0SmsReassemblyStore::AddNewMessageL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_ADDNEWMESSAGEL_1, "CClass0SmsReassemblyStore::AddNewMessageL");
 
 	// Add entry in permanent store file
 	TInt index;
@@ -2499,7 +2506,7 @@
 */
 void CClass0SmsReassemblyStore::UpdateExistingMessageL(CSmsMessage& aSmsMessage, const TGsmSms& aGsmSms, TBool& aDuplicateMsgRef, TBool& aDuplicateSlot)
 	{
-	LOGSMSPROT1("CClass0SmsReassemblyStore::UpdateExistingMessageL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_UPDATEEXISTINGMESSAGEL_1, "CClass0SmsReassemblyStore::UpdateExistingMessageL()");
 
 	aDuplicateMsgRef = EFalse;
 	aDuplicateSlot   = EFalse;
@@ -2559,7 +2566,7 @@
 
 			if (slot.iIndex == newSlot.iIndex  && slot.iStore == newSlot.iStore)
 				{
-				LOGSMSPROT1("CSmsReassemblyStore::UpdateExistingMessageL(): Duplicate enumerated PDU.");
+				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_UPDATEEXISTINGMESSAGEL_2, "CSmsReassemblyStore::UpdateExistingMessageL(): Duplicate enumerated PDU.");
 
 				// It is a duplicate that was already stored on the SIM...
 				aDuplicateSlot = ETrue;
@@ -2574,7 +2581,7 @@
 		{
 		if (indexArray->At(index) == concatPDUIndex)
 			{
-			LOGSMSPROT1("CSmsReassemblyStore::UpdateExistingMessageL(): Duplicate concatenated PDU.");
+			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_UPDATEEXISTINGMESSAGEL_3, "CSmsReassemblyStore::UpdateExistingMessageL(): Duplicate concatenated PDU.");
 
 			// The PDU is already stored in the reassembly store.
 			aDuplicateMsgRef = ETrue;
@@ -3061,7 +3068,7 @@
 */
 void CClass0SmsReassemblyStore::ProcessTimeoutMessageL()
 	{
-	LOGSMSPROT1("CClass0SmsReassemblyStore::ProcessTimeoutMessageL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_PROCESSTIMEOUTMESSAGEL_1, "CClass0SmsReassemblyStore::ProcessTimeoutMessageL()");
 	TBool passedToClient=ETrue;
 	TInt count=iEntryArray.Count();
 
@@ -3185,12 +3192,12 @@
 */
 void CClass0SmsReassemblyStore::SetIncompleteMessageForwardedToClientL(const CSmsMessage& aSmsMessage)
 	{
-	LOGSMSPROT1("CClass0SmsReassemblyStore::SetIncompleteMessageForwardedToClientL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_SETINCOMPLETEMESSAGEFORWARDEDTOCLIENTL_1, "CClass0SmsReassemblyStore::SetIncompleteMessageForwardedToClientL()");
 	TInt index = KErrNotFound;
 
 	if (aSmsMessage.IsComplete())
 		{
-		LOGSMSPROT1("This function must be called when message is incomplete");
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_SETINCOMPLETEMESSAGEFORWARDEDTOCLIENTL_2, "This function must be called when message is incomplete");
 		User::Leave(KErrArgument);
 		}
 
@@ -3246,7 +3253,7 @@
 */
 TInt CClass0SmsReassemblyStore::CleanReassemblyEntries()
 	{
-	LOGSMSPROT1("CleanReassemblyEntries");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_CLEANREASSEMBLYENTRIES_1, "CleanReassemblyEntries");
 	const CArrayFix<TSmsPreAllocatedFileStoreReassemblyEntry>& preAllocatedFileEntryArray = iPreallocatedFile->Entries();
 	TInt ret=KErrNone;
 	TRAP(ret,	BeginTransactionLC();
@@ -3255,7 +3262,7 @@
 
 	if (ret == KErrDiskFull)
 		{
-		LOGSMSPROT1("CleanupEntriesL returns KErrDiskFull");
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_CLEANREASSEMBLYENTRIES_2, "CleanupEntriesL returns KErrDiskFull");
 		/*
 		Get access to reserve memory, call again to clean the entries with compact.
 		Compact needs to be called at this instance because permanent store
@@ -3267,7 +3274,7 @@
 		TRAP(ret,	BeginTransactionLC();
 					iPermanentFileStore->CleanupEntriesWithCompactL(preAllocatedFileEntryArray);
 					CommitTransactionL(););
-		LOGSMSPROT2("CleanupEntriesWithCompactL returns %d", ret);
+		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_CLEANREASSEMBLYENTRIES_3, "CleanupEntriesWithCompactL returns %d", ret);
 		iFs.ReleaseReserveAccess(KStoreDrive);
 		}
 	return ret;
@@ -3287,7 +3294,7 @@
 */
 void CClass0SmsReassemblyStore::GetSmsEntriesL(const TReassemblyEntry& aEntry, CSmsMessage& aSmsMessage, CArrayFix<TInt>& aIndexArray, CArrayFix<TGsmSms>& aSmsArray)
 	{
-	LOGSMSPROT1("CClass0SmsReassemblyStore::GetSmsEntriesL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_GETSMSENTRIESL_1, "CClass0SmsReassemblyStore::GetSmsEntriesL()");
 	TInt permanentStoreIndex=KErrNotFound;
 	iPermanentFileStore->MatchEntryToExistingMessage(aEntry, permanentStoreIndex);
 	if (permanentStoreIndex!=KErrNotFound)
@@ -3296,7 +3303,7 @@
 		}
 	else
 		{
-		LOGSMSPROT1("No PDUs in Permanent store file");
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_GETSMSENTRIESL_2, "No PDUs in Permanent store file");
 		}
 
 	TInt preAllocatedFileIndex=KErrNotFound;
@@ -3330,7 +3337,7 @@
 			{
 			//In this scenario a CSmsMessage object has to be created from the existing PDU in
 			//pre-allocated file & then serialized into aSmsMessage.
-			LOGSMSPROT2("Number of PDUs in Pre-allocated file %d", aIndexArray.Count());
+			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_GETSMSENTRIESL_3, "Number of PDUs in Pre-allocated file %d", aIndexArray.Count());
 			if (aIndexArray.Count() > 0)
 				{
 				CSmsBuffer* smsBuffer = CSmsBuffer::NewL();
@@ -3503,7 +3510,7 @@
  */
 void CClass0StoreCloseObject(TAny* aObj)
 	{
-	LOGGSMU2("WARNING! Hey, CClass0StoreCloseObject called by Untrapper! [0x%08x]", aObj);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0STORECLOSEOBJECT_1, "WARNING! Hey, CClass0StoreCloseObject called by Untrapper! [0x%08x]", (TUint)aObj);
 	((CClass0SmsReassemblyStore*)aObj)->Revert();
 	}
 
@@ -3516,11 +3523,11 @@
  */
 void CClass0SmsReassemblyStore::BeginTransactionLC()
 	{
-	LOGSMSPROT3("CClass0SmsReassemblyStore::BeginTransactionLC [this=0x%08X iInTransaction=%d]", this, iInTransaction);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_BEGINTRANSACTIONLC_1, "CClass0SmsReassemblyStore::BeginTransactionLC [this=0x%08X iInTransaction=%d]", (TUint)this, iInTransaction);
 
 	if (iInTransaction)
 		{
-	    LOGGSMU1("WARNING CClass0SmsReassemblyStore::BeginTransactionLC leaving with KErrAccessDenied");
+	    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_BEGINTRANSACTIONLC_2, "WARNING CClass0SmsReassemblyStore::BeginTransactionLC leaving with KErrAccessDenied");
 		User::Leave(KErrAccessDenied);
 		}
 
@@ -3536,8 +3543,7 @@
  */
 void CClass0SmsReassemblyStore::CommitTransactionL()
 	{
-	LOGSMSPROT3("CClass0SmsReassemblyStore::CommitTransactionL(): this=0x%08X iInTransaction=%d",
-				this, iInTransaction);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_COMMITTRANSACTIONL_1, "CClass0SmsReassemblyStore::CommitTransactionL(): this=0x%08X iInTransaction=%d",(TUint)this, iInTransaction);
 
 	//Commit permanent store file
 	iPermanentFileStore->CommitTransactionL();
@@ -3552,8 +3558,7 @@
  */
 void CClass0SmsReassemblyStore::Revert()
 	{
-	LOGSMSPROT3("CClass0SmsReassemblyStore::Revert(): this=0x%08X, iInTransaction=%d",
-    		 this, iInTransaction);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLASS0SMSREASSEMBLYSTORE_REVERT_1, "CClass0SmsReassemblyStore::Revert(): this=0x%08X, iInTransaction=%d",(TUint)this, iInTransaction);
 
 	iPreallocatedFile->Revert();
 	iPermanentFileStore->Revert();