201033
authorhgs
Mon, 23 Aug 2010 13:32:17 +0300
changeset 39 1a8af2cd6858
parent 34 1c05ae5a7e41
child 42 2e2a89493e2b
201033
imagehandlingutilities/thumbnailmanager/plugins/audio/group/thumbnailaudioprovider.mmp
imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailaudioprovider.cpp
imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailimagedecoderv3.cpp
imagehandlingutilities/thumbnailmanager/plugins/image/group/thumbnailimageprovider.mmp
imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimagedecoder.cpp
imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimagedecoderv2.cpp
imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimageprovider.cpp
imagehandlingutilities/thumbnailmanager/plugins/video/group/thumbnailvideoprovider.mmp
imagehandlingutilities/thumbnailmanager/plugins/video/src/thumbnailvideoprovider.cpp
imagehandlingutilities/thumbnailmanager/thumbagdaemon/group/thumbagdaemon.mmp
imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagaudioobserver.cpp
imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagcameraobserver.cpp
imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagdaemon.cpp
imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagimageobserver.cpp
imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagprocessor.cpp
imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagvideoobserver.cpp
imagehandlingutilities/thumbnailmanager/thumbnailclient/group/thumbnailmanager.mmp
imagehandlingutilities/thumbnailmanager/thumbnailclient/inc/thumbnailrequestactive.h
imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnaildataimpl.cpp
imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailmanagerimpl.cpp
imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestactive.cpp
imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestqueue.cpp
imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailsession.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/group/thumbnailserver.mmp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnaildecodetask.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnaildiskunmountobserver.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailfetchedchecker.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailgeneratetask.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailmdsquerytask.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailmemorycardobserver.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailscaletask.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserversession.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailstore.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtask.cpp
imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtaskprocessor.cpp
imagehandlingutilities/thumbnailmanager/tmcommon/src/tmactivitymanager.cpp
imagehandlingutilities/thumbnailmanager/tmcommon/src/tmformatobserver.cpp
imagehandlingutilities/thumbnailmanager/tmcommon/src/tmshutdownobserver.cpp
imagehandlingutilities/thumbnailmanager/tmcommon/src/tmsrproptertyobserver.cpp
imagehandlingutilities/thumbnailmanager/tmiadrestart/group/tmiadrestart.mmp
imagehandlingutilities/thumbnailmanager/tmiadrestart/src/tmiadrestart.cpp
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/group/thumbnailaudioprovider.mmp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/audio/group/thumbnailaudioprovider.mmp	Mon Aug 23 13:32:17 2010 +0300
@@ -36,7 +36,7 @@
 MW_LAYER_SYSTEMINCLUDE
 
 USERINCLUDE ../inc
-USERINCLUDE ../../../inc
+USERINCLUDE ../../../inc ../traces
 
 SYSTEMINCLUDE /epoc32/include/ecom
 SYSTEMINCLUDE /epoc32/include/icl
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailaudioprovider.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailaudioprovider.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -26,6 +26,11 @@
 #include <MetaDataUtility.h>
 #include <MetaDataFieldContainer.h>
 #include "thumbnailmanagerconstants.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailaudioproviderTraces.h"
+#endif
+
 
 
 #ifndef IMPLEMENTATION_PROXY_ENTRY
@@ -57,6 +62,7 @@
 CThumbnailAudioProvider::CThumbnailAudioProvider()
     {
     TN_DEBUG1( "CThumbnailAudioProvider::CThumbnailAudioProvider()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILAUDIOPROVIDER_CTHUMBNAILAUDIOPROVIDER, "CThumbnailAudioProvider::CThumbnailAudioProvider" );
     }
 
 
@@ -68,6 +74,8 @@
 CThumbnailAudioProvider::~CThumbnailAudioProvider()
     {
     TN_DEBUG1( "CThumbnailAudioProvider::~CThumbnailAudioProvider()" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILAUDIOPROVIDER_CTHUMBNAILAUDIOPROVIDER, "CThumbnailAudioProvider::~CThumbnailAudioProvider" );
+    
     delete iImageDecoderv3;
     iImageDecoderv3 = NULL;
     REComSession::DestroyedImplementation( iDtor_ID_Key );
@@ -84,6 +92,7 @@
     const TDisplayMode /*aDisplayMode*/, const CThumbnailManager::TThumbnailQualityPreference /*aQualityPreference*/  )
     {   
     TN_DEBUG1( "CThumbnailAudioProvider::GetThumbnailL() - rfile " );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILAUDIOPROVIDER_GETTHUMBNAILL, "CThumbnailAudioProvider::GetThumbnailL - rfile" );
     CMetaDataUtility* metaDataUtil = CMetaDataUtility::NewL();
     CleanupStack::PushL( metaDataUtil );
     
@@ -141,6 +150,7 @@
     const TDisplayMode /* aDisplayMode */, const CThumbnailManager::TThumbnailQualityPreference /*aQualityPreference*/ )
     {
     TN_DEBUG1( "CThumbnailAudioProvider::GetThumbnailL() - buffer" );
+	OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILAUDIOPROVIDER_GETTHUMBNAILL, "CThumbnailAudioProvider::GetThumbnailL - buffer" );
 	__ASSERT_DEBUG((EFalse), User::Panic(_L("CThumbnailAudioProvider::GetThumbnailL"), KErrNotSupported));
     }
 
@@ -152,6 +162,7 @@
 void CThumbnailAudioProvider::GetThumbnailL( RFs& /* aFs */, TDesC8& /*aBuffer */)
     {
     TN_DEBUG1( "CThumbnailAudioProvider::GetThumbnailL() - buffer no mime" );
+	OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILAUDIOPROVIDER_GETTHUMBNAILL, "CThumbnailAudioProvider::GetThumbnailL - buffer no mime" );
 	__ASSERT_DEBUG((EFalse), User::Panic(_L("CThumbnailAudioProvider::GetThumbnailL"), KErrNotSupported));
 	User::Leave( KErrNotSupported );
     }
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailimagedecoderv3.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailimagedecoderv3.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -25,6 +25,11 @@
 #include "thumbnailimagedecoderv3.h"
 #include "thumbnaillog.h"
 #include "thumbnailpanic.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailimagedecoderv3Traces.h"
+#endif
+
 
 
 // CImageDecoder supports up to 1/8 size reduction if EFullyScaleable is
@@ -68,6 +73,7 @@
     {
 
     TN_DEBUG1( "CCThumbnailImageDecoderv3::CreateL() called" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV3_CREATEL, "CThumbnailImageDecoderv3::CreateL" );
 
     iSize = aSize;
     iMimeType = aMimeType;
@@ -94,6 +100,7 @@
 void CThumbnailImageDecoderv3::DecodeL( const TDisplayMode aDisplayMode )
     {
     TN_DEBUG1( "CThumbnailImageDecoderv3::DecodeL() start" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV3_DECODEL, "CThumbnailImageDecoderv3::DecodeL - start" );
     
     // Create the bitmap
     if ( !iBitmap )
@@ -132,6 +139,7 @@
             }
         TN_DEBUG4( 
             "EFullyScaleable not set for image - loadSize=(%d,%d) reduction=1/%d ", loadSize.iWidth, loadSize.iHeight, reductionFactor );
+        OstTraceExt3( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODERV3_DECODEL, "CThumbnailImageDecoderv3::DecodeL;loadSize.iWidth=%d;loadSize.iHeight=%d;reductionFactor=%d", loadSize.iWidth, loadSize.iHeight, reductionFactor );
         }
 
     TInt err = iBitmap->Create( loadSize, aDisplayMode );
@@ -146,6 +154,7 @@
     SetActive();
     
     TN_DEBUG1( "CThumbnailImageDecoderv3::DecodeL() end" );
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODERV3_DECODEL, "CThumbnailImageDecoderv3::DecodeL - end" );
     }
 
 
@@ -224,6 +233,7 @@
     if ( decErr != KErrNone )
         {
         TN_DEBUG2( "CThumbnailImageDecoderv3::CreateDecoderL() - HW CExtJpegDecoder failed %d", decErr);
+        OstTrace1( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - HW CExtJpegDecoder failed;decErr=%d", decErr );
         
         LeaveIfCorruptL( decErr );
         
@@ -233,6 +243,7 @@
         if ( decErr != KErrNone )
             {                             
             TN_DEBUG2( "CThumbnailImageDecoderv3::CreateDecoderL() - SW CExtJpegDecoder failed %d", decErr);
+            OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - SW CExtJpegDecoder failed;decErr=%d", decErr );
             
             LeaveIfCorruptL( decErr );
             // don't force any mime type
@@ -241,20 +252,24 @@
                 {
                 Release();
                 TN_DEBUG2( "CThumbnailImageDecoderv3::CreateDecoderL() - CImageDecoder error %d", decErr );
+                OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - CImageDecoder error;decErr=%d", decErr );
                 
                 User::Leave( decErr );
                 }     
             
             TN_DEBUG1( "CThumbnailImageDecoderv3::CreateDecoderL() - CImageDecoder created" );
+            OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - CImageDecoder created" );
             }
         else
             {
             TN_DEBUG1( "CThumbnailImageDecoderv3::CreateDecoderL() - SW CExtJpegDecoder created" );
+            OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - SW CExtJpegDecoder created" );
             }               
         }
     else
         {
         TN_DEBUG1( "CThumbnailImageDecoderv3::CreateDecoderL() - HW CExtJpegDecoder created" );
+        OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - HW CExtJpegDecoder created" );
         }    
     }
 
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/group/thumbnailimageprovider.mmp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/image/group/thumbnailimageprovider.mmp	Mon Aug 23 13:32:17 2010 +0300
@@ -37,7 +37,7 @@
 MW_LAYER_SYSTEMINCLUDE
 
 USERINCLUDE ../inc
-USERINCLUDE ../../../inc
+USERINCLUDE ../../../inc ../traces
 
 SYSTEMINCLUDE /epoc32/include/ecom
 SYSTEMINCLUDE /epoc32/include/icl
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimagedecoder.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimagedecoder.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -27,6 +27,11 @@
 #include "thumbnailimagedecoder.h"
 #include "thumbnaillog.h"
 #include "thumbnailpanic.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailimagedecoderTraces.h"
+#endif
+
 
 const TUid KImageTypeSVGUid = 
     {
@@ -81,6 +86,7 @@
     TDataType& aMimeType, const TSize& aSize)
     {
     TN_DEBUG1( "CThumbnailImageDecoder::CreateL() start" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODER_CREATEL, "CThumbnailImageDecoder::CreateL - start" );
 
     iBuffer = NULL;
     iSize = aSize;
@@ -100,6 +106,7 @@
     iOriginalSize = info.iOverallSizeInPixels;
     
     TN_DEBUG1( "CThumbnailImageDecoder::CreateL() end" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODER_CREATEL, "CThumbnailImageDecoder::CreateL - end" );
     }
 
 
@@ -113,6 +120,7 @@
     TDataType& aMimeType, const TSize& aSize)
     {
     TN_DEBUG1( "CThumbnailImageDecoder::CreateL() start" );
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODER_CREATEL, "CThumbnailImageDecoder::CreateL - start" );
 
     iSize = aSize;
     iMimeType = aMimeType;
@@ -131,6 +139,7 @@
     iOriginalSize = info.iOverallSizeInPixels;
     
     TN_DEBUG1( "CThumbnailImageDecoder::CreateL() end" );
+    OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEDECODER_CREATEL, "CThumbnailImageDecoder::CreateL - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -141,6 +150,7 @@
 void CThumbnailImageDecoder::DecodeL( const TDisplayMode aDisplayMode, const CThumbnailManager::TThumbnailFlags aFlags)
     {
     TN_DEBUG1( "CThumbnailImageDecoder::DecodeL() start" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL - start" );
     
     // Create the bitmap
     if ( !iBitmap )
@@ -149,6 +159,7 @@
         }
     
     TN_DEBUG3( "CThumbnailImageDecoder::DecodeL() %d x %d", iSize.iWidth, iSize.iHeight );
+    OstTraceExt2( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL;iSize.iWidth=%d;iSize.iHeight=%d", iSize.iWidth, iSize.iHeight );
     if( iOriginalSize.iWidth < iOriginalSize.iHeight )
         {
         TInt height = iSize.iHeight;
@@ -156,6 +167,7 @@
         iSize.iWidth = height;
         iPortrait = ETrue;
         TN_DEBUG3( "CThumbnailImageDecoder::DecodeL() %d x %d", iSize.iWidth, iSize.iHeight );
+        OstTraceExt2( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL;iSize.iWidth=%d;iSize.iHeight=%d", iSize.iWidth, iSize.iHeight );
         }
     else
         {
@@ -163,6 +175,7 @@
         }
     
     TN_DEBUG3( "CThumbnailImageDecoder::DecodeL() iOriginalSize = %d x %d", iOriginalSize.iWidth, iOriginalSize.iHeight );
+    OstTraceExt2( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL;iOriginalSize.iWidth=%d;iOriginalSize.iHeight=%d", iOriginalSize.iWidth, iOriginalSize.iHeight );
 
     //Size in both x and y dimension must be non-zero, positive value
     TSize loadSize( iOriginalSize) ;
@@ -171,11 +184,13 @@
         {
         loadSize = iOriginalSize;
         TN_DEBUG1( "CThumbnailImageDecoder::DecodeL() LoadSize is OriginalSize" );
+        OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL - LoadSize is OriginalSize" );
         }
     else if((iFrameInfoFlags& TFrameInfo::EFullyScaleable || IsSvg()) && aFlags == !CThumbnailManager::ECropToAspectRatio)
         {
         loadSize = iSize;
         TN_DEBUG1( "CThumbnailImageDecoder::DecodeL() EFullyScaleable start" );
+        OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL - EFullyScaleable start" );
         const TReal32 srcAspect = static_cast < TReal32 > (
               iOriginalSize.iWidth ) / iOriginalSize.iHeight;
 
@@ -196,6 +211,7 @@
               }
         
         TN_DEBUG3( "CThumbnailImageDecoder::DecodeL() EFullyScaleable loadSize = %d x %d", loadSize.iWidth, loadSize.iHeight );
+        OstTraceExt2( TRACE_NORMAL, DUP6_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL - EFullyScaleable;loadSize.iWidth=%d;loadSize.iHeight=%d", loadSize.iWidth, loadSize.iHeight );
         }
     else 
         {
@@ -223,6 +239,7 @@
             }
         TN_DEBUG4( 
             "CThumbnailImageDecoder::DecodeL() - loadSize = (%d,%d) reduction = 1/%d ", loadSize.iWidth, loadSize.iHeight, reductionFactor );
+        OstTraceExt3( TRACE_NORMAL, DUP7_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL;loadSize.iWidth=%d;loadSize.iHeight=%d;reductionFactor=%d", loadSize.iWidth, loadSize.iHeight, reductionFactor );
         }
 
     TInt err = iBitmap->Create( loadSize, aDisplayMode );
@@ -238,6 +255,7 @@
     SetActive();
     
     TN_DEBUG1( "CThumbnailImageDecoder::DecodeL() end" );
+    OstTrace0( TRACE_NORMAL, DUP8_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL - end" );
     }
 
 
@@ -347,6 +365,7 @@
     aFlags )
     {
     TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() start" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - start" );
     
     TBool thumbFound( EFalse );
     
@@ -354,6 +373,7 @@
     if ( IsJpeg() && !( aFlags == CThumbnailManager::EOptimizeForQuality ))
         {
         TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() create exif decoder" );
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - create exif decoder" );
         TRAPD( err, CreateExifDecoderL( aFlags ));
         thumbFound = ( err == KErrNone );
         iEXIF = ETrue;
@@ -363,6 +383,7 @@
         {
         iEXIF = EFalse;
         TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() create normal decoder" );
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - create normal decoder" );
         
         delete iDecoder;
         iDecoder = NULL;
@@ -393,6 +414,7 @@
                         options, KImageTypeSVGUid, KNullUid, KNullUid );
                 
                 TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder created" );
+                OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder created" );
                 }
             else
                 {
@@ -401,11 +423,13 @@
                 if ( decErr != KErrNone )
                     {
                     TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - error 1" );
+                    OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - error 1" );
                     
                     User::Leave( decErr );
                     }
                 
                 TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder created" );
+                OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder created" );
                 }
             }
         else if ( !IsJpeg())
@@ -415,6 +439,7 @@
                 iDecoder = CImageDecoder::FileNewL( iFile, ContentAccess::EPeek, options );
                 
                 TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder created" );
+                OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder created" );
                 }
             else
                 {
@@ -423,6 +448,7 @@
                 if ( decErr != KErrNone )
                     {                        
                     TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder error %d", decErr );
+                    OstTrace1( TRACE_NORMAL, DUP7_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder error;decErr=%d", decErr );
                     LeaveIfCorruptL(decErr);
                     
                     // don't force any mime type
@@ -431,12 +457,14 @@
                     if ( decErr != KErrNone )
                         {                        
                         TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder no mime error %d", decErr );
+                        OstTrace1( TRACE_NORMAL, DUP8_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder no mime error;decErr=%d", decErr );
                         
                         User::Leave( decErr );
                         }
                     }
                 
                 TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder created" );
+                OstTrace0( TRACE_NORMAL, DUP9_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder created" );
                 }
             }
         else
@@ -449,6 +477,7 @@
                 if ( decErr != KErrNone )
                     {
                     TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - HW CExtJpegDecoder failed %d", decErr);
+                    OstTrace1( TRACE_NORMAL, DUP10_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL;decErr=%d - HW CExtJpegDecoder failed ", decErr );
                     LeaveIfCorruptL(decErr);
                     
                     TRAP( decErr, iDecoder = CExtJpegDecoder::FileNewL(
@@ -457,6 +486,7 @@
                     if ( decErr != KErrNone )
                         {
                         TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - SW CExtJpegDecoder failed %d", decErr);
+                        OstTrace1( TRACE_NORMAL, DUP11_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - SW CExtJpegDecoder failed;decErr=%d", decErr );
                         LeaveIfCorruptL(decErr);
                         
                         TRAP( decErr, iDecoder = CImageDecoder::FileNewL( iFile, ContentAccess::EPeek, options ));
@@ -464,19 +494,23 @@
                         if( decErr != KErrNone)
                             {
                             TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder failed %d", decErr);
+                            OstTrace1( TRACE_NORMAL, DUP12_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder failed ;decErr=%d", decErr );
                             User::Leave( decErr );
                             }
                         
                         TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder created" );
+                        OstTrace0( TRACE_NORMAL, DUP13_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder created" );
                         }
                     else
                         {
                         TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - SW CExtJpegDecoder created" );
+                        OstTrace0( TRACE_NORMAL, DUP14_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - SW CExtJpegDecoder created" );
                         }
                     }
                 else 
                     {
                     TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - HW CExtJpegDecoder created" );
+                    OstTrace0( TRACE_NORMAL, DUP15_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL" );
                     }
                 }
             else
@@ -487,6 +521,7 @@
                 if ( decErr != KErrNone )
                     {
                     TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - HW CExtJpegDecoder failed %d", decErr);
+                    OstTrace1( TRACE_NORMAL, DUP16_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - HW CExtJpegDecoder failed;decErr=%d", decErr );
                     LeaveIfCorruptL(decErr);
                     
                     TRAP( decErr, iDecoder = CExtJpegDecoder::DataNewL(
@@ -495,12 +530,14 @@
                     if ( decErr != KErrNone )
                         {                       
                         TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - SW CExtJpegDecoder failed %d", decErr);
+                        OstTrace1( TRACE_NORMAL, DUP17_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - SW CExtJpegDecoder failed;decErr=%d", decErr );
                         LeaveIfCorruptL(decErr);
                         TRAPD( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, iMimeType.Des8(), options) );
                         
                         if ( decErr != KErrNone )
                             {                        
                             TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder failed %d", decErr);
+                            OstTrace1( TRACE_NORMAL, DUP18_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder failed;decErr=%d", decErr );
                             LeaveIfCorruptL(decErr);
                             // don't force any mime type
                             TRAPD( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, options ) );
@@ -508,26 +545,31 @@
                             if ( decErr != KErrNone )
                                 {                                
                                 TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder no mime failed %d", decErr);
+                                OstTrace1( TRACE_NORMAL, DUP19_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder no mime failed;decErr=%d", decErr );
                                 User::Leave( decErr );
                                 }
                             }
                         
                         TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder created" );
+                        OstTrace0( TRACE_NORMAL, DUP20_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder created" );
                         }
                     else
                         {
                         TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - SW CExtJpegDecoder created" );
+                        OstTrace0( TRACE_NORMAL, DUP21_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - SW CExtJpegDecoder created" );
                         }               
                     }
                 else
                     {
                     TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - HW CExtJpegDecoder created" );
+                    OstTrace0( TRACE_NORMAL, DUP22_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - HW CExtJpegDecoder created" );
                     }               
                 }
             }
         }
     
     TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() end" );
+    OstTrace0( TRACE_NORMAL, DUP23_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - end" );
     }
 
 
@@ -539,6 +581,7 @@
     ::TThumbnailQualityPreference aFlags )
     {
     TN_DEBUG1( "CThumbnailImageDecoder::CreateExifDecoderL() start" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODER_CREATEEXIFDECODERL, "CThumbnailImageDecoder::CreateExifDecoderL - start" );
     
     // If the image is in jpeg format, try to get thumbnail from EXIF data.
     CExifRead* reader = NULL;
@@ -600,6 +643,7 @@
         }
 
     TN_DEBUG1( "CThumbnailImageDecoder::CreateExifDecoderL() end" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODER_CREATEEXIFDECODERL, "CThumbnailImageDecoder::CreateExifDecoderL - end" );
     }
 
 
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimagedecoderv2.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimagedecoderv2.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -26,6 +26,11 @@
 #include "thumbnaillog.h"
 #include "thumbnailpanic.h"
 #include "thumbnailmanagerconstants.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailimagedecoderv2Traces.h"
+#endif
+
 
 // ============================ MEMBER FUNCTIONS ===============================
 //------------------------------------------------------------------------
@@ -59,6 +64,7 @@
 void CThumbnailImageDecoderv2::CreateL(TDesC8& aBuffer, MThumbnailProviderObserver& aObserver)
     {
     TN_DEBUG1( "CThumbnailImageDecoderv2::CreateL() start" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV2_CREATEL, "CThumbnailImageDecoderv2::CreateL - start" );
 
     iBuffer = &aBuffer;
     iObserver = &aObserver;
@@ -66,6 +72,7 @@
     CreateDecoderL();
     
     TN_DEBUG1( "CThumbnailImageDecoderv2::CreateL() end" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODERV2_CREATEL, "CThumbnailImageDecoderv2::CreateL - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -76,6 +83,7 @@
 void CThumbnailImageDecoderv2::DecodeL( )
     {
     TN_DEBUG1( "CThumbnailImageDecoderv2::DecodeL() start" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV2_DECODEL, "CThumbnailImageDecoderv2::DecodeL - start" );
     
     // Create the bitmap
     if ( !iBitmap )
@@ -97,6 +105,7 @@
     SetActive();  
     
     TN_DEBUG1( "CThumbnailImageDecoderv2::DecodeL() end" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODERV2_DECODEL, "CThumbnailImageDecoderv2::DecodeL - end" );
     }
 
 
@@ -165,6 +174,7 @@
 void CThumbnailImageDecoderv2::CreateDecoderL()
     {
     TN_DEBUG1( "CThumbnailImageDecoderv2::CreateDecoderL() start" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - start" );
     
     delete iDecoder;
     iDecoder = NULL;
@@ -178,12 +188,14 @@
     if ( decErr != KErrNone )
         {
         TN_DEBUG2( "CThumbnailImageDecoderv2::CreateDecoderL() - HW CExtJpegDecoder failed = %d", decErr );
+        OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - HW CExtJpegDecoder failed;decErr=%d", decErr );
         TRAP( decErr, iDecoder = CExtJpegDecoder::DataNewL(
                 CExtJpegDecoder::ESwImplementation, iFs, *iBuffer, options ));
         
         if ( decErr != KErrNone )
             {
             TN_DEBUG2( "CThumbnailImageDecoderv2::CreateDecoderL() - SW CExtJpegDecoder failed %d", decErr);
+            OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - SW CExtJpegDecoder failed;decErr=%d", decErr );
             LeaveIfCorruptL( decErr );
             
             TRAP( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, KJpegMime(), options ) );
@@ -191,6 +203,7 @@
             if ( decErr != KErrNone )
                 {                  
                 TN_DEBUG2( "CThumbnailImageDecoderv2::CreateDecoderL() - CImageDecoder failed %d", decErr);
+                OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - CImageDecoder failed;decErr=%d", decErr );
                 LeaveIfCorruptL( decErr );
             
                 // don't force any mime type
@@ -198,23 +211,28 @@
                 if ( decErr != KErrNone )
                     {                    
                     TN_DEBUG2( "CThumbnailImageDecoderv2::CImageDecoder() - CImageDecoder no mime error %d", decErr  );
+                    OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - CImageDecoder no mime error;decErr=%d", decErr );
                     User::Leave( decErr );
                     }
                 }
             
             TN_DEBUG1( "CThumbnailImageDecoderv2::CreateDecoderL() - CImageDecoder created" );
+            OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - CImageDecoder created" );
             }
         else
             {
             TN_DEBUG1( "CThumbnailImageDecoderv2:CreateDecoderL() - SW CExtJpegDecoder created" );
+            OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - SW CExtJpegDecoder created" );
             }               
         }
     else
         {
         TN_DEBUG1( "CThumbnailImageDecoderv2::CreateDecoderL() - HW CExtJpegDecoder created" );
+        OstTrace0( TRACE_NORMAL, DUP7_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - HW CExtJpegDecoder created" );
         }
      
     TN_DEBUG1( "CThumbnailImageDecoderv2::CreateDecoderL() end" );
+    OstTrace0( TRACE_NORMAL, DUP8_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - end" );
     }
 
 // -----------------------------------------------------------------------------
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimageprovider.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimageprovider.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -25,6 +25,11 @@
 #include "thumbnailmanageruids.hrh"
 #include "thumbnaillog.h"
 #include "thumbnailmanagerconstants.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailimageproviderTraces.h"
+#endif
+
 
 #ifndef IMPLEMENTATION_PROXY_ENTRY
 typedef TAny* TProxyNewLPtr;
@@ -55,6 +60,7 @@
 CThumbnailImageProvider::CThumbnailImageProvider()
     {
     TN_DEBUG1( "CThumbnailImageProvider::CThumbnailImageProvider()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEPROVIDER_CTHUMBNAILIMAGEPROVIDER, "CThumbnailImageProvider::CThumbnailImageProvider" );
     }
 
 
@@ -66,6 +72,7 @@
 CThumbnailImageProvider::~CThumbnailImageProvider()
     {
     TN_DEBUG1( "CThumbnailImageProvider::~CThumbnailImageProvider()" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEPROVIDER_CTHUMBNAILIMAGEPROVIDER, "CThumbnailImageProvider::~CThumbnailImageProvider" );
     delete iImageDecoder;
     iImageDecoder = NULL;
     delete iImageDecoderv2;
@@ -84,6 +91,7 @@
     const TDisplayMode /*aDisplayMode*/, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference )
     {
     TN_DEBUG1( "CThumbnailImageProvider::GetThumbnailL() start" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEPROVIDER_GETTHUMBNAILL, "CThumbnailImageProvider::GetThumbnailL - start" );
 
     if ( !iImageDecoder )
         {
@@ -112,6 +120,7 @@
     iImageDecoder->DecodeL( iDisplayMode, iFlags );
     
     TN_DEBUG1( "CThumbnailImageProvider::GetThumbnailL() end" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEPROVIDER_GETTHUMBNAILL, "CThumbnailImageProvider::GetThumbnailL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -124,6 +133,7 @@
     const TDisplayMode /*aDisplayMode*/, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference )
     {
     TN_DEBUG1( "CThumbnailImageProvider::GetThumbnailL() start" );
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEPROVIDER_GETTHUMBNAILL, "CThumbnailImageProvider::GetThumbnailL - start" );
     
     if ( !iImageDecoder )
         {
@@ -152,6 +162,7 @@
     iImageDecoder->DecodeL( iDisplayMode, iFlags );
     
     TN_DEBUG1( "CThumbnailImageProvider::GetThumbnailL() end" );
+    OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEPROVIDER_GETTHUMBNAILL, "CThumbnailImageProvider::GetThumbnailL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -162,6 +173,7 @@
 void CThumbnailImageProvider::GetThumbnailL( RFs& aFs, TDesC8& aBuffer)
     {
     TN_DEBUG1( "CThumbnailImageProvider::GetThumbnailL() start" );
+    OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILIMAGEPROVIDER_GETTHUMBNAILL, "CThumbnailImageProvider::GetThumbnailL - start" );
 
     if ( !iImageDecoderv2 )
         {     
@@ -173,6 +185,7 @@
     iImageDecoderv2->DecodeL();
     
     TN_DEBUG1( "CThumbnailImageProvider::GetThumbnailL() end" );
+    OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILIMAGEPROVIDER_GETTHUMBNAILL, "CThumbnailImageProvider::GetThumbnailL - end" );
     }
 
 // ---------------------------------------------------------------------------
--- a/imagehandlingutilities/thumbnailmanager/plugins/video/group/thumbnailvideoprovider.mmp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/video/group/thumbnailvideoprovider.mmp	Mon Aug 23 13:32:17 2010 +0300
@@ -35,7 +35,7 @@
 MW_LAYER_SYSTEMINCLUDE
 
 USERINCLUDE ../inc
-USERINCLUDE ../../../inc
+USERINCLUDE ../../../inc ../traces
 
 SYSTEMINCLUDE /epoc32/include/ecom
 
--- a/imagehandlingutilities/thumbnailmanager/plugins/video/src/thumbnailvideoprovider.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/video/src/thumbnailvideoprovider.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -25,6 +25,11 @@
 #include "thumbnailmanageruids.hrh"
 #include "thumbnailmanagerconstants.h"
 #include "thumbnaillog.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailvideoproviderTraces.h"
+#endif
+
 
 #ifndef IMPLEMENTATION_PROXY_ENTRY
 typedef TAny* TProxyNewLPtr;
@@ -59,6 +64,7 @@
     iTimeout = EFalse;
     
     TN_DEBUG1( "CThumbnailVideoProvider::CThumbnailVideoProvider()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILVIDEOPROVIDER_CTHUMBNAILVIDEOPROVIDER, "CThumbnailVideoProvider::CThumbnailVideoProvider" );
     }
 
 
@@ -82,6 +88,7 @@
     iTimer.Close();
     
     TN_DEBUG1( "CThumbnailVideoProvider::~CThumbnailVideoProvider()" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILVIDEOPROVIDER_CTHUMBNAILVIDEOPROVIDER, "CThumbnailVideoProvider::~CThumbnailVideoProvider" );
     REComSession::DestroyedImplementation( iDtor_ID_Key );
     }
 // -----------------------------------------------------------------------------
@@ -117,6 +124,7 @@
         iTimeout = EFalse;
         
         TN_DEBUG1( "CThumbnailVideoProvider::RunL() - timeout" );
+        OstTrace0( TRACE_NORMAL, CTHUMBNAILVIDEOPROVIDER_RUNL, "CThumbnailVideoProvider::RunL - timeout" );
         }
     }
 
@@ -130,6 +138,7 @@
     const TDisplayMode /*aDisplayMode*/, const CThumbnailManager::TThumbnailQualityPreference /*aQualityPreference */)
     {
     TN_DEBUG1( "CThumbnailVideoProvider::GetThumbnailL() start" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILVIDEOPROVIDER_GETTHUMBNAILL, "CThumbnailVideoProvider::GetThumbnailL - start" );
 
     iFlags = aFlags;
 	//set default mode displaymode from global constants
@@ -152,6 +161,7 @@
         }
     
     TN_DEBUG1( "CThumbnailVideoProvider::GetThumbnailL() end" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILVIDEOPROVIDER_GETTHUMBNAILL, "CThumbnailVideoProvider::GetThumbnailL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -166,6 +176,7 @@
     const CThumbnailManager::TThumbnailQualityPreference /*aQualityPreference */)
     {
     TN_DEBUG1( "CThumbnailVideoProvider::GetThumbnailL() - nothing to do" );
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILVIDEOPROVIDER_GETTHUMBNAILL, "CThumbnailVideoProvider::GetThumbnailL - nothing to do" );
     }
 
 // ---------------------------------------------------------------------------
@@ -175,6 +186,7 @@
 void CThumbnailVideoProvider::GetThumbnailL( RFs& /*aFs*/, TDesC8& /*aBuffer*/)
     {
     TN_DEBUG1( "CThumbnailVideoProvider::GetThumbnailL() - nothing to do" );
+    OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILVIDEOPROVIDER_GETTHUMBNAILL, "CThumbnailVideoProvider::GetThumbnailL - nothing to do" );
     User::Leave( KErrNotSupported );
     }
 
@@ -204,6 +216,7 @@
     /*aInfo*/, TInt aError, CFbsBitmap* aThumb )
     {
     TN_DEBUG2( "CThumbnailVideoProvider::NotifyVideoClipThumbCompleted(aError=%d)", aError );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILVIDEOPROVIDER_NOTIFYVIDEOCLIPTHUMBCOMPLETED, "CThumbnailVideoProvider::NotifyVideoClipThumbCompleted;aError=%d", aError );
     
     iTimer.Cancel();
     iTimeout = EFalse;
@@ -226,6 +239,7 @@
     aInfo, TInt aError )
     {
     TN_DEBUG2( "CThumbnailVideoProvider::NotifyVideoClipInfoReady(aError=%d)", aError );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILVIDEOPROVIDER_NOTIFYVIDEOCLIPINFOREADY, "CThumbnailVideoProvider::NotifyVideoClipInfoReady;aError=%d", aError );
     
     if ( aError == KErrNone )
         {
@@ -237,6 +251,7 @@
         if ( err != KErrNone )
             {
             TN_DEBUG2( "CThumbnailVideoProvider::NotifyVideoClipInfoReady() -- GetThumbL() left with %d", err );
+            OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILVIDEOPROVIDER_NOTIFYVIDEOCLIPINFOREADY, "CThumbnailVideoProvider::NotifyVideoClipInfoReady - GetThumbL() left with;err=%d", err );
             
             iObserver->ThumbnailProviderReady( err, NULL, TSize(), EFalse, EFalse);
             
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/group/thumbagdaemon.mmp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/group/thumbagdaemon.mmp	Mon Aug 23 13:32:17 2010 +0300
@@ -60,7 +60,7 @@
 
 USERINCLUDE             ../inc
 USERINCLUDE             ../../inc
-USERINCLUDE             ../../tmcommon/inc
+USERINCLUDE             ../../tmcommon/inc ../traces ../../thumbnailserver/traces
 
 LIBRARY                 euser.lib
 LIBRARY         	mdeclient.lib
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagaudioobserver.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagaudioobserver.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -28,6 +28,10 @@
 #include "thumbnaillog.h"
 #include "thumbnailmanagerconstants.h"
 #include "thumbnailmanagerprivatecrkeys.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbagaudioobserverTraces.h"
+#endif
 
 
 // ---------------------------------------------------------------------------
@@ -37,6 +41,7 @@
 CThumbAGAudioObserver* CThumbAGAudioObserver::NewLC(CThumbAGProcessor* aProcessor)
     {
     TN_DEBUG1( "CThumbAGAudioObserver::NewLC() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_NEWLC, "CThumbAGAudioObserver::NewLC" );
     
 	CThumbAGAudioObserver* self = new (ELeave) CThumbAGAudioObserver(aProcessor);
 	CleanupStack::PushL( self );
@@ -74,6 +79,7 @@
 void CThumbAGAudioObserver::ConstructL()
 	{
 	TN_DEBUG1( "CThumbAGAudioObserver::ConstructL() - begin" );
+	OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_CONSTRUCTL, "CThumbAGAudioObserver::ConstructL - begin" );
 	
 #ifdef _DEBUG
     iAddCounter = 0;
@@ -83,6 +89,7 @@
     InitializeL();
     	
 	TN_DEBUG1( "CThumbAGAudioObserver::ConstructL() - end" );
+	OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_CONSTRUCTL, "CThumbAGAudioObserver::ConstructL - end" );
 	}
 
 // ---------------------------------------------------------------------------
@@ -92,9 +99,10 @@
 void CThumbAGAudioObserver::InitializeL()
     {
     TN_DEBUG1( "CThumbAGAudioObserver::InitializeL() - begin" );
-    
+    OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_INITIALIZEL, "CThumbAGAudioObserver::InitializeL - begin" );
    
         TN_DEBUG1( "CThumbAGAudioObserver::InitializeL() - create observers" );
+        OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_INITIALIZEL, "CThumbAGAudioObserver::InitializeL - create observers" );
         
         // create shutdown observer
         if(iMDSShutdownObserver)
@@ -119,6 +127,7 @@
             }
         
         TN_DEBUG1( "CThumbAGAudioObserver::InitializeL() - connect to MDS" );
+        OstTrace0( TRACE_FATAL, DUP2_CTHUMBAGAUDIOOBSERVER_INITIALIZEL, "CThumbAGAudioObserver::InitializeL - connect to MDS" );
         
         if(iMdESession)
             {
@@ -134,6 +143,7 @@
         iSessionError = EFalse;
       
         TN_DEBUG1( "CThumbAGAudioObserver::InitializeL() - end" );
+        OstTrace0( TRACE_FATAL, DUP3_CTHUMBAGAUDIOOBSERVER_INITIALIZEL, "CThumbAGAudioObserver::InitializeL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -143,17 +153,20 @@
 CThumbAGAudioObserver::~CThumbAGAudioObserver()
     {
     TN_DEBUG1( "CThumbAGAudioObserver::~CThumbAGAudioObserver() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_CTHUMBAGAUDIOOBSERVER, "CThumbAGAudioObserver::~CThumbAGAudioObserver - begin" );
     
     iShutdown = ETrue;    
     
     Shutdown();
     
     TN_DEBUG1( "CThumbAGAudioObserver::~CThumbAGAudioObserver() - end" );
+    OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_CTHUMBAGAUDIOOBSERVER, "CThumbAGAudioObserver::~CThumbAGAudioObserver - end" );
     }
 
 void CThumbAGAudioObserver::Shutdown()
     {
     TN_DEBUG1( "CThumbAGAudioObserver::Shutdown()" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_SHUTDOWN, "CThumbAGAudioObserver::Shutdown" );
     
     delete iMDSShutdownObserver;
     iMDSShutdownObserver = NULL;
@@ -185,6 +198,7 @@
 void CThumbAGAudioObserver::HandleSessionOpened( CMdESession& /* aSession */, TInt aError )
     {
     TN_DEBUG1( "CThumbAGAudioObserver::HandleSessionOpened");
+    OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_HANDLESESSIONOPENED, "CThumbAGAudioObserver::HandleSessionOpened" );
     
     if (aError == KErrNone)
         {
@@ -192,11 +206,13 @@
         if (err != KErrNone)
             {
             TN_DEBUG2( "CThumbAGAudioObserver::HandleSessionOpened, AddObserversL error == %d", err );
+            OstTrace1( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_HANDLESESSIONOPENED, "CThumbAGAudioObserver::HandleSessionOpened;err=%d", err );
             }
         }
     else
         {
         TN_DEBUG2( "CThumbAGAudioObserver::HandleSessionOpened error == %d", aError );
+        OstTrace1( TRACE_FATAL, DUP2_CTHUMBAGAUDIOOBSERVER_HANDLESESSIONOPENED, "CThumbAGAudioObserver::HandleSessionOpened;aError=%d", aError );
         }
     }
 
@@ -207,6 +223,7 @@
 void CThumbAGAudioObserver::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
     {
     TN_DEBUG2( "CThumbAGAudioObserver::HandleSessionError == %d", aError );
+    OstTrace1( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_HANDLESESSIONERROR, "CThumbAGAudioObserver::HandleSessionError;aError=%d", aError );
     if (aError != KErrNone && !iSessionError)
         {
         iSessionError = ETrue;
@@ -219,6 +236,7 @@
                                    TCallBack(ReconnectCallBack, this));
                 
                 TN_DEBUG1( "CThumbAGAudioObserver::HandleSessionError() - reconnect timer started" );
+                OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_HANDLESESSIONERROR, "CThumbAGAudioObserver::HandleSessionError - reconnect timer started" );
                 }
             }
 
@@ -234,6 +252,7 @@
                                                const RArray<TItemId>& aObjectIdArray )
     {
     TN_DEBUG1( "CThumbAGAudioObserver::HandleObjectNotification() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - begin" );
 
     // no processor or shutting down
     if ( iShutdown || !iProcessor)
@@ -245,11 +264,13 @@
     if (aType == ENotifyAdd)
         {
         TN_DEBUG2( "CThumbAGAudioObserver::HandleObjectNotification() - ENotifyAdd %d", aObjectIdArray.Count() );
+        OstTrace1( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - ENotifyAdd;aObjectIdArray.Count()=%d", aObjectIdArray.Count() );
         iAddCounter = aObjectIdArray.Count();
         }
     else if (aType == ENotifyModify)
         {
         TN_DEBUG2( "CThumbAGAudioObserver::HandleObjectNotification() - ENotifyModify %d", aObjectIdArray.Count() );
+        OstTrace1( TRACE_FATAL, DUP2_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - ENotifyModify;aObjectIdArray.Count()=%d", aObjectIdArray.Count() );
         iModCounter = aObjectIdArray.Count();
         }
 #endif
@@ -257,6 +278,7 @@
     if ( (aType == ENotifyAdd || aType == ENotifyModify ) && (aObjectIdArray.Count() > 0) )
         {
         TN_DEBUG1( "CThumbAGAudioObserver::HandleObjectNotification() - AddToQueueL" );
+        OstTrace0( TRACE_FATAL, DUP3_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - AddToQueueL" );
 
         // Add event to processing queue by type and enable force run        
         RPointerArray<HBufC> dummyArray;
@@ -264,20 +286,24 @@
         if (err != KErrNone)
             {
             TN_DEBUG1( "CThumbAGAudioObserver::HandleObjectNotification() - error adding to queue" );
+            OstTrace0( TRACE_FATAL, DUP4_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - error adding to queue" );
             }
         }
     else
         {
         TN_DEBUG1( "CThumbAGAudioObserver::HandleObjectNotification() - bad notification" );
+        OstTrace0( TRACE_FATAL, DUP5_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - bad notification" );
         }
     
 #ifdef _DEBUG
     TN_DEBUG3( "CThumbAGAudioObserver::IN-COUNTERS---------- Add = %d Modify = %d", iAddCounter, iModCounter );
+    OstTraceExt2( TRACE_FATAL, DUP6_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification;iAddCounter=%u;iModCounter=%u", iAddCounter, iModCounter );
     iModCounter = 0;
     iAddCounter = 0;
 #endif
 
     TN_DEBUG1( "CThumbAGAudioObserver::HandleObjectNotification() - end" );
+    OstTrace0( TRACE_FATAL, DUP7_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -287,10 +313,12 @@
 void CThumbAGAudioObserver::ShutdownNotification()
     {
     TN_DEBUG1( "CThumbAGAudioObserver::ShutdownNotification()" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_SHUTDOWNNOTIFICATION, "CThumbAGAudioObserver::ShutdownNotification" );
     
     if (!iShutdown)
         {
         TN_DEBUG1( "CThumbAGAudioObserver::ShutdownNotification() shutdown" );
+        OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_SHUTDOWNNOTIFICATION, "CThumbAGAudioObserver::ShutdownNotification - shutdown" );
         iShutdown = ETrue;
         }
     }
@@ -302,6 +330,7 @@
 void CThumbAGAudioObserver::AddObserversL()
     {
     TN_DEBUG1( "CThumbAGAudioObserver::AddObserversL() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_ADDOBSERVERSL, "CThumbAGAudioObserver::AddObserversL - begin" );
     
     CMdENamespaceDef& defaultNamespace = iMdESession->GetDefaultNamespaceDefL();
     CMdEObjectDef& audioDef = defaultNamespace.GetObjectDefL( MdeConstants::Audio::KAudioObject );
@@ -324,6 +353,7 @@
    CleanupStack::Pop( 4, addCondition );
      
     TN_DEBUG1( "CThumbAGAudioObserver::AddObserversL() - end" );
+    OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_ADDOBSERVERSL, "CThumbAGAudioObserver::AddObserversL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -333,6 +363,7 @@
 TInt CThumbAGAudioObserver::ReconnectCallBack(TAny* aAny)
     {
     TN_DEBUG1( "CThumbAGAudioObserver::ReconnectCallBack() - reinitialize");
+    OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_RECONNECTCALLBACK, "CThumbAGAudioObserver::ReconnectCallBack - reinitialize" );
     
     CThumbAGAudioObserver* self = static_cast<CThumbAGAudioObserver*>( aAny );
     
@@ -342,6 +373,7 @@
     TRAP_IGNORE( self->InitializeL() );
     
     TN_DEBUG1( "CThumbAGAudioObserver::ReconnectCallBack() - done");
+    OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_RECONNECTCALLBACK, "CThumbAGAudioObserver::ReconnectCallBack - done" );
     
     return KErrNone;
     }
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagcameraobserver.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagcameraobserver.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -28,6 +28,10 @@
 #include "thumbnaillog.h"
 #include "thumbnailmanagerconstants.h"
 #include "thumbnailmanagerprivatecrkeys.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbagcameraobserverTraces.h"
+#endif
 
 
 // ---------------------------------------------------------------------------
@@ -37,6 +41,7 @@
 CThumbAGCameraObserver* CThumbAGCameraObserver::NewLC(CThumbAGProcessor* aProcessor)
     {
     TN_DEBUG1( "CThumbAGCameraObserver::NewLC() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGCAMERAOBSERVER_NEWLC, "CThumbAGCameraObserver::NewLC - begin" );
     
 	CThumbAGCameraObserver* self = new (ELeave) CThumbAGCameraObserver(aProcessor);
 	CleanupStack::PushL( self );
@@ -51,6 +56,7 @@
 CThumbAGCameraObserver* CThumbAGCameraObserver::NewL(CThumbAGProcessor* aProcessor)
 	{
 	TN_DEBUG1( "CThumbAGCameraObserver::NewL() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGCAMERAOBSERVER_NEWL, "CThumbAGCameraObserver::NewL - begin" );
     
 	CThumbAGCameraObserver* self = CThumbAGCameraObserver::NewLC(aProcessor);
 	CleanupStack::Pop( self );
@@ -74,6 +80,7 @@
 void CThumbAGCameraObserver::ConstructL()
 	{
 	TN_DEBUG1( "CThumbAGCameraObserver::ConstructL() - begin" );
+	OstTrace0( TRACE_FATAL, CTHUMBAGCAMERAOBSERVER_CONSTRUCTL, "CThumbAGCameraObserver::ConstructL - begin" );
 	
 #ifdef _DEBUG
     iAddCounter = 0;
@@ -83,6 +90,7 @@
     InitializeL();
     	
 	TN_DEBUG1( "CThumbAGCameraObserver::ConstructL() - end" );
+	OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGCAMERAOBSERVER_CONSTRUCTL, "CThumbAGCameraObserver::ConstructL - end" );
 	}
 
 // ---------------------------------------------------------------------------
@@ -92,9 +100,11 @@
 void CThumbAGCameraObserver::InitializeL()
     {
     TN_DEBUG1( "CThumbAGCameraObserver::InitializeL() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGCAMERAOBSERVER_INITIALIZEL, "CThumbAGCameraObserver::InitializeL - begin" );
     
    
         TN_DEBUG1( "CThumbAGCameraObserver::InitializeL() - create observers" );
+        OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGCAMERAOBSERVER_INITIALIZEL, "CThumbAGCameraObserver::InitializeL - create observers" );
         
         // create shutdown observer
         if(iMDSShutdownObserver)
@@ -119,6 +129,7 @@
             }
         
         TN_DEBUG1( "CThumbAGCameraObserver::InitializeL() - connect to MDS" );
+        OstTrace0( TRACE_FATAL, DUP2_CTHUMBAGCAMERAOBSERVER_INITIALIZEL, "CThumbAGCameraObserver::InitializeL - connect to MDS" );
         
         if(iMdESession)
             {
@@ -134,6 +145,7 @@
         iSessionError = EFalse;
       
         TN_DEBUG1( "CThumbAGCameraObserver::InitializeL() - end" );
+        OstTrace0( TRACE_FATAL, DUP3_CTHUMBAGCAMERAOBSERVER_INITIALIZEL, "CThumbAGCameraObserver::InitializeL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -143,6 +155,7 @@
 CThumbAGCameraObserver::~CThumbAGCameraObserver()
     {
     TN_DEBUG1( "CThumbAGCameraObserver::~CThumbAGCameraObserver() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGCAMERAOBSERVER_CTHUMBAGCAMERAOBSERVER, "CThumbAGCameraObserver::~CThumbAGCameraObserver - begin" );
     
     iShutdown = ETrue;    
     
@@ -170,6 +183,7 @@
         }
     
     TN_DEBUG1( "CThumbAGCameraObserver::~CThumbAGCameraObserver() - end" );
+    OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGCAMERAOBSERVER_CTHUMBAGCAMERAOBSERVER, "CThumbAGCameraObserver::~CThumbAGCameraObserver - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -179,6 +193,7 @@
 void CThumbAGCameraObserver::HandleSessionOpened( CMdESession& /* aSession */, TInt aError )
     {
     TN_DEBUG1( "CThumbAGCameraObserver::HandleSessionOpened");
+    OstTrace0( TRACE_FATAL, CTHUMBAGCAMERAOBSERVER_HANDLESESSIONOPENED, "CThumbAGCameraObserver::HandleSessionOpened" );
     
     if (aError == KErrNone)
         {
@@ -186,11 +201,13 @@
         if (err != KErrNone)
             {
             TN_DEBUG2( "CThumbAGCameraObserver::HandleSessionOpened, AddObserversL error == %d", err );
+            OstTrace1( TRACE_FATAL, DUP1_CTHUMBAGCAMERAOBSERVER_HANDLESESSIONOPENED, "CThumbAGCameraObserver::HandleSessionOpened - AddObserversL error;err=%d", err );
             }
         }
     else
         {
         TN_DEBUG2( "CThumbAGCameraObserver::HandleSessionOpened error == %d", aError );
+        OstTrace1( TRACE_FATAL, DUP2_CTHUMBAGCAMERAOBSERVER_HANDLESESSIONOPENED, "CThumbAGCameraObserver::HandleSessionOpened;aError=%d", aError );
         }
     }
 
@@ -201,6 +218,7 @@
 void CThumbAGCameraObserver::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
     {
     TN_DEBUG2( "CThumbAGCameraObserver::HandleSessionError == %d", aError );
+    OstTrace1( TRACE_FATAL, CTHUMBAGCAMERAOBSERVER_HANDLESESSIONERROR, "CThumbAGCameraObserver::HandleSessionError;aError=%d", aError );
     if (aError != KErrNone && !iSessionError)
         {
         iSessionError = ETrue;
@@ -213,6 +231,7 @@
                                    TCallBack(ReconnectCallBack, this));
                 
                 TN_DEBUG1( "CThumbAGCameraObserver::HandleSessionError() - reconnect timer started" );
+                OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGCAMERAOBSERVER_HANDLESESSIONERROR, "CThumbAGCameraObserver::HandleSessionError - reconnect timer started" );
                 }
             }
 
@@ -228,6 +247,7 @@
                                                const RArray<TItemId>& aObjectIdArray )
     {
     TN_DEBUG1( "CThumbAGCameraObserver::HandleObjectNotification() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGCAMERAOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGCameraObserver::HandleObjectNotification - begin" );
 
     // no processor or shutting down
     if ( iShutdown || !iProcessor)
@@ -239,11 +259,13 @@
     if (aType == ENotifyAdd)
         {
         TN_DEBUG2( "CThumbAGCameraObserver::HandleObjectNotification() - ENotifyAdd %d", aObjectIdArray.Count() );
+        OstTrace1( TRACE_FATAL, DUP1_CTHUMBAGCAMERAOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGCameraObserver::HandleObjectNotification - ENotifyAdd;aObjectIdArray.Count()=%d", aObjectIdArray.Count() );
         iAddCounter = aObjectIdArray.Count();
         }
     else if (aType == ENotifyModify)
         {
         TN_DEBUG2( "CThumbAGCameraObserver::HandleObjectNotification() - ENotifyModify %d", aObjectIdArray.Count() );
+        OstTrace1( TRACE_FATAL, DUP2_CTHUMBAGCAMERAOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGCameraObserver::HandleObjectNotification - ENotifyModify;aObjectIdArray.Count=%d", aObjectIdArray.Count() );
         iModCounter = aObjectIdArray.Count();
         }
 #endif
@@ -251,6 +273,7 @@
     if ( (aType == ENotifyAdd || aType == ENotifyModify ) && (aObjectIdArray.Count() > 0) )
         {
         TN_DEBUG1( "CThumbAGCameraObserver::HandleObjectNotification() - AddToQueueL" );
+        OstTrace0( TRACE_FATAL, DUP3_CTHUMBAGCAMERAOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGCameraObserver::HandleObjectNotification - AddToQueueL" );
 
         // Add event to processing queue by type and enable force run        
         RPointerArray<HBufC> dummyArray;
@@ -258,20 +281,24 @@
         if (err != KErrNone)
             {
             TN_DEBUG1( "CThumbAGCameraObserver::HandleObjectNotification() - error adding to queue" );
+            OstTrace0( TRACE_FATAL, DUP4_CTHUMBAGCAMERAOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGCameraObserver::HandleObjectNotification - error adding to queue" );
             }
         }
     else
         {
         TN_DEBUG1( "CThumbAGCameraObserver::HandleObjectNotification() - bad notification" );
+        OstTrace0( TRACE_FATAL, DUP5_CTHUMBAGCAMERAOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGCameraObserver::HandleObjectNotification - bad notification" );
         }
     
 #ifdef _DEBUG
     TN_DEBUG3( "CThumbAGCameraObserver::IN-COUNTERS---------- Add = %d Modify = %d", iAddCounter, iModCounter );
+    OstTraceExt2( TRACE_FATAL, DUP6_CTHUMBAGCAMERAOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGCameraObserver::HandleObjectNotification;iAddCounter=%u;iModCounter=%u", iAddCounter, iModCounter );
     iModCounter = 0;
     iAddCounter = 0;
 #endif
 
     TN_DEBUG1( "CThumbAGCameraObserver::HandleObjectNotification() - end" );
+    OstTrace0( TRACE_FATAL, DUP7_CTHUMBAGCAMERAOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGCameraObserver::HandleObjectNotification - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -281,10 +308,12 @@
 void CThumbAGCameraObserver::ShutdownNotification()
     {
     TN_DEBUG1( "CThumbAGCameraObserver::ShutdownNotification()" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGCAMERAOBSERVER_SHUTDOWNNOTIFICATION, "CThumbAGCameraObserver::ShutdownNotification" );
     
     if (!iShutdown)
         {
         TN_DEBUG1( "CThumbAGCameraObserver::ShutdownNotification() shutdown" );
+        OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGCAMERAOBSERVER_SHUTDOWNNOTIFICATION, "CThumbAGCameraObserver::ShutdownNotification - shutdown" );
         iShutdown = ETrue;
         }
     }
@@ -296,6 +325,7 @@
 void CThumbAGCameraObserver::AddObserversL()
     {
     TN_DEBUG1( "CThumbAGCameraObserver::AddObserversL() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGCAMERAOBSERVER_ADDOBSERVERSL, "CThumbAGCameraObserver::AddObserversL - begin" );
     
     CMdENamespaceDef& defaultNamespace = iMdESession->GetDefaultNamespaceDefL();
     CMdEObjectDef& objectDef = defaultNamespace.GetObjectDefL( MdeConstants::Object::KBaseObject );
@@ -319,6 +349,7 @@
     CleanupStack::Pop( 4, addCondition );  
      
     TN_DEBUG1( "CThumbAGCameraObserver::AddObserversL() - end" );
+    OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGCAMERAOBSERVER_ADDOBSERVERSL, "CThumbAGCameraObserver::AddObserversL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -328,6 +359,7 @@
 TInt CThumbAGCameraObserver::ReconnectCallBack(TAny* aAny)
     {
     TN_DEBUG1( "CThumbAGCameraObserver::ReconnectCallBack() - reinitialize");
+    OstTrace0( TRACE_FATAL, CTHUMBAGCAMERAOBSERVER_RECONNECTCALLBACK, "CThumbAGCameraObserver::ReconnectCallBack - reinitialize" );
     
     CThumbAGCameraObserver* self = static_cast<CThumbAGCameraObserver*>( aAny );
     
@@ -337,6 +369,7 @@
     TRAP_IGNORE( self->InitializeL() );
     
     TN_DEBUG1( "CThumbAGCameraObserver::ReconnectCallBack() - done");
+    OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGCAMERAOBSERVER_RECONNECTCALLBACK, "CThumbAGCameraObserver::ReconnectCallBack - done" );
     
     return KErrNone;
     }
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagdaemon.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagdaemon.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -28,6 +28,10 @@
 #include "thumbnaillog.h"
 #include "thumbnailmanagerconstants.h"
 #include "thumbnailmanagerprivatecrkeys.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbagdaemonTraces.h"
+#endif
 
 
 // ---------------------------------------------------------------------------
@@ -37,6 +41,7 @@
 CThumbAGDaemon* CThumbAGDaemon::NewLC()
     {
     TN_DEBUG1( "CThumbAGDaemon::NewLC() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGDAEMON_NEWLC, "CThumbAGDaemon::NewLC - begin" );
     
 	CThumbAGDaemon* self = new (ELeave) CThumbAGDaemon();
 	CleanupStack::PushL( self );
@@ -51,6 +56,7 @@
 CThumbAGDaemon* CThumbAGDaemon::NewL()
 	{
 	TN_DEBUG1( "CThumbAGDaemon::NewL() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGDAEMON_NEWL, "CThumbAGDaemon::NewL" );
     
 	CThumbAGDaemon* self = CThumbAGDaemon::NewLC();
 	CleanupStack::Pop( self );
@@ -75,6 +81,7 @@
 void CThumbAGDaemon::ConstructL()
 	{
 	TN_DEBUG1( "CThumbAGDaemon::ConstructL() - begin" );
+	OstTrace0( TRACE_FATAL, CTHUMBAGDAEMON_CONSTRUCTL, "CThumbAGDaemon::ConstructL - begin" );
 	
 	StartL( KTAGDaemonName );
 	
@@ -86,6 +93,7 @@
     InitializeL();
     	
 	TN_DEBUG1( "CThumbAGDaemon::ConstructL() - end" );
+	OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGDAEMON_CONSTRUCTL, "CThumbAGDaemon::ConstructL - end" );
 	}
 
 // ---------------------------------------------------------------------------
@@ -95,10 +103,12 @@
 void CThumbAGDaemon::InitializeL()
     {
     TN_DEBUG1( "CThumbAGDaemon::InitializeL() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGDAEMON_INITIALIZEL, "CThumbAGDaemon::InitializeL - begin" );
     
     if (DaemonEnabledL())
         {
         TN_DEBUG1( "CThumbAGDaemon::InitializeL() - create observers" );
+        OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGDAEMON_INITIALIZEL, "CThumbAGDaemon::InitializeL - create observers" );
         
         // create shutdown observer
         if(iMDSShutdownObserver)
@@ -169,6 +179,7 @@
         User::Leave(KErrNone);
         }
         TN_DEBUG1( "CThumbAGDaemon::InitializeL() - end" );
+        OstTrace0( TRACE_FATAL, DUP2_CTHUMBAGDAEMON_INITIALIZEL, "CThumbAGDaemon::InitializeL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -178,6 +189,7 @@
 CThumbAGDaemon::~CThumbAGDaemon()
     {
     TN_DEBUG1( "CThumbAGDaemon::~CThumbAGDaemon() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGDAEMON_CTHUMBAGDAEMON, "CThumbAGDaemon::~CThumbAGDaemon - begin" );
     
     iShutdown = ETrue;
     
@@ -228,6 +240,7 @@
         }
     
     TN_DEBUG1( "CThumbAGDaemon::~CThumbAGDaemon() - end" );
+    OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGDAEMON_CTHUMBAGDAEMON, "CThumbAGDaemon::~CThumbAGDaemon - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -251,6 +264,7 @@
 void CThumbAGDaemon::ThreadFunctionL()
     {
 	TN_DEBUG1( "CThumbAGDaemon::ThreadFunctionL() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGDAEMON_THREADFUNCTIONL, "CThumbAGDaemon::ThreadFunctionL - begin" );
     
     User::LeaveIfError( User::RenameThread( KTAGDaemonName ) );
 
@@ -276,6 +290,7 @@
         }
     
     TN_DEBUG1( "CThumbAGDaemon::ThreadFunctionL() - end" );
+	OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGDAEMON_THREADFUNCTIONL, "CThumbAGDaemon::ThreadFunctionL - end" );
 	}
 
 // -----------------------------------------------------------------------------
@@ -285,6 +300,7 @@
 void CThumbAGDaemon::HandleSessionOpened( CMdESession& /* aSession */, TInt aError )
     {
     TN_DEBUG1( "CThumbAGDaemon::HandleSessionOpened");
+    OstTrace0( TRACE_FATAL, CTHUMBAGDAEMON_HANDLESESSIONOPENED, "CThumbAGDaemon::HandleSessionOpened" );
     
     if (aError == KErrNone)
         {
@@ -294,11 +310,13 @@
         if (err != KErrNone)
             {
             TN_DEBUG2( "CThumbAGDaemon::HandleSessionOpened, AddObserversL error == %d", err );
+            OstTrace1( TRACE_FATAL, DUP1_CTHUMBAGDAEMON_HANDLESESSIONOPENED, "CThumbAGDaemon::HandleSessionOpened;err=%d", err );
             }
         }
     else
         {
         TN_DEBUG2( "CThumbAGDaemon::HandleSessionOpened error == %d", aError );
+        OstTrace1( TRACE_FATAL, DUP2_CTHUMBAGDAEMON_HANDLESESSIONOPENED, "CThumbAGDaemon::HandleSessionOpened;aError=%d", aError );
         }
     }
 
@@ -309,6 +327,7 @@
 void CThumbAGDaemon::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
     {
     TN_DEBUG2( "CThumbAGDaemon::HandleSessionError == %d", aError );
+    OstTrace1( TRACE_FATAL, CTHUMBAGDAEMON_HANDLESESSIONERROR, "CThumbAGDaemon::HandleSessionError;aError=%d", aError );
     if (aError != KErrNone && !iShutdown && !iSessionError)
         {
         iSessionError = ETrue;
@@ -339,6 +358,7 @@
                                TCallBack(ReconnectCallBack, this));
             
             TN_DEBUG1( "CThumbAGDaemon::HandleSessionError() - reconnect timer started" );
+            OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGDAEMON_HANDLESESSIONERROR, "CThumbAGDaemon::HandleSessionError - reconnect timer started" );
             }
 
         }   
@@ -356,6 +376,7 @@
         const RPointerArray<HBufC>& aObjectUriArray)
     {
     TN_DEBUG1( "CThumbAGDaemon::HandleUriObjectNotification() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGDAEMON_HANDLEURIOBJECTNOTIFICATION, "CThumbAGDaemon::HandleUriObjectNotification - begin" );
     
     if(!iProcessor || iShutdown)
         {
@@ -365,6 +386,7 @@
     if(aType == ENotifyRemove)
         {
         TN_DEBUG1( "CThumbAGDaemon::HandleUriObjectNotification() - removed");
+        OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGDAEMON_HANDLEURIOBJECTNOTIFICATION, "CThumbAGDaemon::HandleUriObjectNotification - removed" );
         TInt err(0);
         TRAP(err, iProcessor->AddToQueueL(aType, EGenerationItemTypeAny, aObjectIdArray, aObjectUriArray, EFalse));
         __ASSERT_DEBUG((err==KErrNone), User::Panic(_L("CThumbAGDaemon::HandleUriObjectNotification()"), err));
@@ -372,6 +394,7 @@
         err = KErrNone;
         }
     TN_DEBUG1( "CThumbAGDaemon::HandleUriObjectNotification() - end" );
+    OstTrace0( TRACE_FATAL, DUP2_CTHUMBAGDAEMON_HANDLEURIOBJECTNOTIFICATION, "CThumbAGDaemon::HandleUriObjectNotification - end" );
     }
 #endif
 
@@ -384,6 +407,7 @@
                                                const RArray<TItemId>& aObjectIdArray )
     {
     TN_DEBUG1( "CThumbAGDaemon::HandleObjectNotification() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGDAEMON_HANDLEOBJECTNOTIFICATION, "CThumbAGDaemon::HandleObjectNotification - begin" );
 
     // no processor or shutting down
     if (!iProcessor || iShutdown)
@@ -395,6 +419,7 @@
     if (aType == ENotifyRemove)
         {
         TN_DEBUG2( "CThumbAGDaemon::HandleObjectNotification() - ENotifyRemove %d", aObjectIdArray.Count() );
+        OstTrace1( TRACE_FATAL, DUP1_CTHUMBAGDAEMON_HANDLEOBJECTNOTIFICATION, "CThumbAGDaemon::HandleObjectNotification - ENotifyRemove;aObjectIdArray.Count()=%d", aObjectIdArray.Count() );
         iDelCounter = aObjectIdArray.Count();
         }
 #endif
@@ -402,6 +427,7 @@
     if ( aType == ENotifyRemove && aObjectIdArray.Count() > 0 )
         {
         TN_DEBUG1( "CThumbAGDaemon::HandleObjectNotification() - AddToQueueL" );
+		OstTrace0( TRACE_FATAL, DUP2_CTHUMBAGDAEMON_HANDLEOBJECTNOTIFICATION, "CThumbAGDaemon::HandleObjectNotification - AddToQueueL" );
 		
         // If delete event, remove IDs from Modify and Add queues
         iProcessor->RemoveFromQueues( aObjectIdArray, EFalse);
@@ -412,19 +438,23 @@
         if (err != KErrNone)
             {
             TN_DEBUG1( "CThumbAGDaemon::HandleObjectNotification() - error adding to queue" );
+            OstTrace0( TRACE_FATAL, DUP3_CTHUMBAGDAEMON_HANDLEOBJECTNOTIFICATION, "CThumbAGDaemon::HandleObjectNotification - error adding to queue" );
             }
         }
     else
         {
         TN_DEBUG1( "CThumbAGDaemon::HandleObjectNotification() - bad notification" );
+        OstTrace0( TRACE_FATAL, DUP4_CTHUMBAGDAEMON_HANDLEOBJECTNOTIFICATION, "CThumbAGDaemon::HandleObjectNotification - bad notification" );
         }
     
 #ifdef _DEBUG
     TN_DEBUG2( "CThumbAGDaemon::IN-COUNTERS---------- Delete = %d", iDelCounter );
+    OstTrace1( TRACE_FATAL, DUP5_CTHUMBAGDAEMON_HANDLEOBJECTNOTIFICATION, "CThumbAGDaemon::IN-COUNTERS---------- Delete;iDelCounter=%u", iDelCounter );
     iDelCounter = 0;
 #endif
 
     TN_DEBUG1( "CThumbAGDaemon::HandleObjectNotification() - end" );
+    OstTrace0( TRACE_FATAL, DUP6_CTHUMBAGDAEMON_HANDLEOBJECTNOTIFICATION, "CThumbAGDaemon::HandleObjectNotification - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -435,6 +465,7 @@
                TBool aPresent, const RArray<TItemId>& aObjectIdArray)
     {
     TN_DEBUG3( "CThumbAGDaemon::HandleObjectPresentNotification() - aPresent == %d count == %d", aPresent, aObjectIdArray.Count() );
+    OstTraceExt2( TRACE_FATAL, CTHUMBAGDAEMON_HANDLEOBJECTPRESENTNOTIFICATION, "CThumbAGDaemon::HandleObjectPresentNotification;aPresent=%d;aObjectIdArray.Count()=%d", aPresent, aObjectIdArray.Count() );
     
     // no processor or shutting down
     if (!iProcessor || iShutdown)
@@ -454,11 +485,13 @@
             TRAP(err, iProcessor->AddToQueueL(ENotifyAdd, EGenerationItemTypeUnknown, aObjectIdArray, dummyArray, ETrue));
            
             TN_DEBUG2( "CThumbAGDaemon::HandleObjectPresentNotification() - ENotifyAdd unknown items %d", aObjectIdArray.Count() );     
+            OstTrace1( TRACE_FATAL, DUP1_CTHUMBAGDAEMON_HANDLEOBJECTPRESENTNOTIFICATION, "CThumbAGDaemon::HandleObjectPresentNotification - ENotifyAdd unknown items;aObjectIdArray.Count()=%d", aObjectIdArray.Count() );
            #ifdef _DEBUG
            iAddCounter = aObjectIdArray.Count();
            if (err != KErrNone)
                {
                TN_DEBUG1( "CThumbAGDaemon::HandleObjectPresentNotification() - error adding to queue" );
+               OstTrace0( TRACE_FATAL, DUP2_CTHUMBAGDAEMON_HANDLEOBJECTPRESENTNOTIFICATION, "CThumbAGDaemon::HandleObjectPresentNotification - error adding to queue" );
                }
            #endif
            }
@@ -466,6 +499,7 @@
     else
         {
         TN_DEBUG1( "CThumbAGDaemon::HandleObjectPresentNotification() - handle not present" );
+        OstTrace0( TRACE_FATAL, DUP3_CTHUMBAGDAEMON_HANDLEOBJECTPRESENTNOTIFICATION, "CThumbAGDaemon::HandleObjectPresentNotification - handle not present" );
 
         #ifdef _DEBUG    
         if( iAddCounter < aObjectIdArray.Count() )
@@ -486,11 +520,13 @@
     
     #ifdef _DEBUG
     TN_DEBUG3( "CThumbAGDaemon::IN-COUNTERS---------- Add = %d Delete = %d", iAddCounter, iDelCounter );
+    OstTraceExt2( TRACE_FATAL, DUP4_CTHUMBAGDAEMON_HANDLEOBJECTPRESENTNOTIFICATION, "CThumbAGDaemon::::IN-COUNTERS---------- Add, Delete;iAddCounter=%u;iDelCounter=%u", iAddCounter, iDelCounter );
     iDelCounter = 0;
 	iAddCounter = 0;
     #endif
     
     TN_DEBUG1( "CThumbAGDaemon::HandleObjectPresentNotification() - end" );
+    OstTrace0( TRACE_FATAL, DUP5_CTHUMBAGDAEMON_HANDLEOBJECTPRESENTNOTIFICATION, "CThumbAGDaemon::HandleObjectPresentNotification - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -500,6 +536,7 @@
 void CThumbAGDaemon::ShutdownNotification()
     {
     TN_DEBUG1( "CThumbAGDaemon::ShutdownNotification()" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGDAEMON_SHUTDOWNNOTIFICATION, "CThumbAGDaemon::ShutdownNotification" );
     
     if (!iShutdown)
         {
@@ -515,7 +552,7 @@
 void CThumbAGDaemon::AddObserversL()
     {
     TN_DEBUG1( "CThumbAGDaemon::AddObserversL() - begin" );
-    
+    OstTrace0( TRACE_FATAL, CTHUMBAGDAEMON_ADDOBSERVERSL, "CThumbAGDaemon::AddObserversL - begin" );
  
 #ifdef MDS_URI_OBSERVER
     // remove observer with uri
@@ -526,6 +563,7 @@
     iMdESession->AddObjectPresentObserverL( *this );
     
     TN_DEBUG1( "CThumbAGDaemon::AddObserversL() - end" );
+    OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGDAEMON_ADDOBSERVERSL, "CThumbAGDaemon::AddObserversL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -535,6 +573,7 @@
 TBool CThumbAGDaemon::DaemonEnabledL()
     {
     TN_DEBUG1( "CThumbAGDaemon::DaemonEnabledL() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGDAEMON_DAEMONENABLEDL, "CThumbAGDaemon::DaemonEnabledL - begin" );
     CRepository* rep = CRepository::NewL( TUid::Uid( THUMBNAIL_CENREP_UID ));
     
     // get value
@@ -545,6 +584,7 @@
     rep = NULL;
     
     TN_DEBUG3( "CThumbAGDaemon::DaemonEnabledL() - val == %d, ret == %d", val, ret );
+    OstTraceExt2( TRACE_FATAL, DUP1_CTHUMBAGDAEMON_DAEMONENABLEDL, "CThumbAGDaemon::DaemonEnabledL;val=%u;ret=%d", val, ret );
     return val;
     }
 
@@ -555,6 +595,7 @@
 TInt CThumbAGDaemon::ReconnectCallBack(TAny* aAny)
     {
     TN_DEBUG1( "CThumbAGDaemon::ReconnectCallBack() - reinitialize");
+    OstTrace0( TRACE_FATAL, CTHUMBAGDAEMON_RECONNECTCALLBACK, "CThumbAGDaemon::ReconnectCallBack - reinitialize" );
     
     CThumbAGDaemon* self = static_cast<CThumbAGDaemon*>( aAny );
     
@@ -564,6 +605,7 @@
     TRAP_IGNORE( self->InitializeL() );
     
     TN_DEBUG1( "CThumbAGDaemon::ReconnectCallBack() - done");
+    OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGDAEMON_RECONNECTCALLBACK, "CThumbAGDaemon::ReconnectCallBack - done" );
     
     return KErrNone;
     }
@@ -575,6 +617,7 @@
 TInt E32Main()
     {    
     TN_DEBUG1( "CThumbAGDaemon::E32Main() - begin" );
+    OstTrace0( TRACE_FATAL, _E32MAIN, "::E32Main - begin" );
 
     __UHEAP_MARK;
 
@@ -591,6 +634,7 @@
     if ( result != KErrNone )
         {
         TN_DEBUG1( "CThumbAGDaemon::E32Main() - error" );
+        OstTrace0( TRACE_FATAL, DUP1__E32MAIN, "::E32Main - error" );
         
         // Signal the client that server creation failed
         RProcess::Rendezvous( result );
@@ -599,6 +643,7 @@
     __UHEAP_MARKEND;
 
     TN_DEBUG1( "CThumbAGDaemon::E32Main() - end" );
+    OstTrace0( TRACE_FATAL, DUP2__E32MAIN, "::E32Main - end" );
     
     return result;
     }
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagimageobserver.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagimageobserver.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -28,6 +28,10 @@
 #include "thumbnaillog.h"
 #include "thumbnailmanagerconstants.h"
 #include "thumbnailmanagerprivatecrkeys.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbagimageobserverTraces.h"
+#endif
 
 
 // ---------------------------------------------------------------------------
@@ -37,6 +41,7 @@
 CThumbAGImageObserver* CThumbAGImageObserver::NewLC(CThumbAGProcessor* aProcessor)
     {
     TN_DEBUG1( "CThumbAGImageObserver::NewLC() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGIMAGEOBSERVER_NEWLC, "CThumbAGImageObserver::NewLC - begin" );
     
 	CThumbAGImageObserver* self = new (ELeave) CThumbAGImageObserver(aProcessor);
 	CleanupStack::PushL( self );
@@ -51,6 +56,7 @@
 CThumbAGImageObserver* CThumbAGImageObserver::NewL(CThumbAGProcessor* aProcessor)
 	{
 	TN_DEBUG1( "CThumbAGImageObserver::NewL() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGIMAGEOBSERVER_NEWL, "CThumbAGImageObserver::NewL - begin" );
     
 	CThumbAGImageObserver* self = CThumbAGImageObserver::NewLC(aProcessor);
 	CleanupStack::Pop( self );
@@ -74,6 +80,7 @@
 void CThumbAGImageObserver::ConstructL()
 	{
 	TN_DEBUG1( "CThumbAGImageObserver::ConstructL() - begin" );
+	OstTrace0( TRACE_FATAL, CTHUMBAGIMAGEOBSERVER_CONSTRUCTL, "CThumbAGImageObserver::ConstructL - begin" );
 	
 #ifdef _DEBUG
     iAddCounter = 0;
@@ -83,6 +90,7 @@
     InitializeL();
     	
 	TN_DEBUG1( "CThumbAGImageObserver::ConstructL() - end" );
+	OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGIMAGEOBSERVER_CONSTRUCTL, "CThumbAGImageObserver::ConstructL - end" );
 	}
 
 // ---------------------------------------------------------------------------
@@ -92,9 +100,10 @@
 void CThumbAGImageObserver::InitializeL()
     {
     TN_DEBUG1( "CThumbAGImageObserver::InitializeL() - begin" );
-    
+    OstTrace0( TRACE_FATAL, CTHUMBAGIMAGEOBSERVER_INITIALIZEL, "CThumbAGImageObserver::InitializeL - begin" );
    
         TN_DEBUG1( "CThumbAGImageObserver::InitializeL() - create observers" );
+        OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGIMAGEOBSERVER_INITIALIZEL, "CThumbAGImageObserver::InitializeL - create observers" );
         
         // create shutdown observer
         if(iMDSShutdownObserver)
@@ -119,6 +128,7 @@
             }
         
         TN_DEBUG1( "CThumbAGImageObserver::InitializeL() - connect to MDS" );
+        OstTrace0( TRACE_FATAL, DUP2_CTHUMBAGIMAGEOBSERVER_INITIALIZEL, "CThumbAGImageObserver::InitializeL - connect to MDS" );
         
         if(iMdESession)
             {
@@ -134,6 +144,7 @@
         iSessionError = EFalse;
       
         TN_DEBUG1( "CThumbAGImageObserver::InitializeL() - end" );
+        OstTrace0( TRACE_FATAL, DUP3_CTHUMBAGIMAGEOBSERVER_INITIALIZEL, "CThumbAGImageObserver::InitializeL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -143,6 +154,7 @@
 CThumbAGImageObserver::~CThumbAGImageObserver()
     {
     TN_DEBUG1( "CThumbAGImageObserver::~CThumbAGImageObserver() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGIMAGEOBSERVER_CTHUMBAGIMAGEOBSERVER, "CThumbAGImageObserver::~CThumbAGImageObserver - begin" );
     
     iShutdown = ETrue;    
     
@@ -170,6 +182,7 @@
         }
     
     TN_DEBUG1( "CThumbAGImageObserver::~CThumbAGImageObserver() - end" );
+    OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGIMAGEOBSERVER_CTHUMBAGIMAGEOBSERVER, "CThumbAGImageObserver::~CThumbAGImageObserver - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -179,6 +192,7 @@
 void CThumbAGImageObserver::HandleSessionOpened( CMdESession& /* aSession */, TInt aError )
     {
     TN_DEBUG1( "CThumbAGImageObserver::HandleSessionOpened");
+    OstTrace0( TRACE_FATAL, CTHUMBAGIMAGEOBSERVER_HANDLESESSIONOPENED, "CThumbAGImageObserver::HandleSessionOpened" );
     
     if (aError == KErrNone)
         {
@@ -186,11 +200,13 @@
         if (err != KErrNone)
             {
             TN_DEBUG2( "CThumbAGImageObserver::HandleSessionOpened, AddObserversL error == %d", err );
+            OstTrace1( TRACE_FATAL, DUP1_CTHUMBAGIMAGEOBSERVER_HANDLESESSIONOPENED, "CThumbAGImageObserver::HandleSessionOpened, AddObserversL error;err=%d", err );
             }
         }
     else
         {
         TN_DEBUG2( "CThumbAGImageObserver::HandleSessionOpened error == %d", aError );
+        OstTrace1( TRACE_FATAL, DUP2_CTHUMBAGIMAGEOBSERVER_HANDLESESSIONOPENED, "CThumbAGImageObserver::HandleSessionOpened;aError=%d", aError );
         }
     }
 
@@ -201,6 +217,7 @@
 void CThumbAGImageObserver::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
     {
     TN_DEBUG2( "CThumbAGImageObserver::HandleSessionError == %d", aError );
+    OstTrace1( TRACE_FATAL, CTHUMBAGIMAGEOBSERVER_HANDLESESSIONERROR, "CThumbAGImageObserver::HandleSessionError;aError=%d", aError );
     if (aError != KErrNone && !iSessionError)
         {
         iSessionError = ETrue;
@@ -213,6 +230,7 @@
                                    TCallBack(ReconnectCallBack, this));
                 
                 TN_DEBUG1( "CThumbAGImageObserver::HandleSessionError() - reconnect timer started" );
+                OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGIMAGEOBSERVER_HANDLESESSIONERROR, "CThumbAGImageObserver::HandleSessionError - reconnect timer started" );
                 }
             }
 
@@ -228,6 +246,7 @@
                                                const RArray<TItemId>& aObjectIdArray )
     {
     TN_DEBUG1( "CThumbAGImageObserver::HandleObjectNotification() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGIMAGEOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGImageObserver::HandleObjectNotification - begin" );
 
     // no processor or shutting down
     if (iShutdown || !iProcessor)
@@ -239,11 +258,13 @@
     if (aType == ENotifyAdd)
         {
         TN_DEBUG2( "CThumbAGImageObserver::HandleObjectNotification() - ENotifyAdd %d", aObjectIdArray.Count() );
+        OstTrace1( TRACE_FATAL, DUP1_CTHUMBAGIMAGEOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGImageObserver::HandleObjectNotification - ENotifyAdd;aObjectIdArray.Count()=%d", aObjectIdArray.Count() );
         iAddCounter = aObjectIdArray.Count();
         }
     else if (aType == ENotifyModify)
         {
         TN_DEBUG2( "CThumbAGImageObserver::HandleObjectNotification() - ENotifyModify %d", aObjectIdArray.Count() );
+        OstTrace1( TRACE_FATAL, DUP2_CTHUMBAGIMAGEOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGImageObserver::HandleObjectNotification - ENotifyModify;aObjectIdArray.Count()=%d", aObjectIdArray.Count() );
         iModCounter = aObjectIdArray.Count();
         }
 #endif
@@ -251,6 +272,7 @@
     if ( (aType == ENotifyAdd || aType == ENotifyModify) && aObjectIdArray.Count() > 0 )
         {
         TN_DEBUG1( "CThumbAGImageObserver::HandleObjectNotification() - AddToQueueL" );
+		OstTrace0( TRACE_FATAL, DUP3_CTHUMBAGIMAGEOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGImageObserver::HandleObjectNotification - AddToQueueL" );
 		
         // Add event to processing queue by type and enable force run        
         RPointerArray<HBufC> dummyArray;
@@ -258,21 +280,25 @@
         if (err != KErrNone)
             {
             TN_DEBUG1( "CThumbAGImageObserver::HandleObjectNotification() - error adding to queue" );
+            OstTrace0( TRACE_FATAL, DUP4_CTHUMBAGIMAGEOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGImageObserver::HandleObjectNotification - error adding to queue" );
             }
         }
     else
         {
         TN_DEBUG1( "CThumbAGImageObserver::HandleObjectNotification() - bad notification" );
+        OstTrace0( TRACE_FATAL, DUP5_CTHUMBAGIMAGEOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGImageObserver::HandleObjectNotification - bad notification" );
         }
     
 #ifdef _DEBUG
     TN_DEBUG3( "CThumbAGImageObserver::IN-COUNTERS---------- Add = %d Modify = %d", iAddCounter, iModCounter );
+    OstTraceExt2( TRACE_FATAL, DUP6_CTHUMBAGIMAGEOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGImageObserver::HIN-COUNTERS---------- Add, Modify;iAddCounter=%u;iModCounter=%u", iAddCounter, iModCounter );
     iModCounter = 0;
     iAddCounter = 0;
     
 #endif
 
     TN_DEBUG1( "CThumbAGImageObserver::HandleObjectNotification() - end" );
+    OstTrace0( TRACE_FATAL, DUP7_CTHUMBAGIMAGEOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGImageObserver::HandleObjectNotification - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -282,6 +308,7 @@
 void CThumbAGImageObserver::AddObserversL()
     {
     TN_DEBUG1( "CThumbAGImageObserver::AddObserversL() - begin" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGIMAGEOBSERVER_ADDOBSERVERSL, "CThumbAGImageObserver::AddObserversL - begin" );
     
     CMdENamespaceDef& defaultNamespace = iMdESession->GetDefaultNamespaceDefL();
     CMdEObjectDef& objectDef = defaultNamespace.GetObjectDefL( MdeConstants::Object::KBaseObject );
@@ -313,6 +340,7 @@
     CleanupStack::Pop( 6, addCondition );
 
     TN_DEBUG1( "CThumbAGImageObserver::AddObserversL() - end" );
+    OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGIMAGEOBSERVER_ADDOBSERVERSL, "CThumbAGImageObserver::AddObserversL - end" );
     }
 
 
@@ -323,10 +351,12 @@
 void CThumbAGImageObserver::ShutdownNotification()
     {
     TN_DEBUG1( "CThumbAGImageObserver::ShutdownNotification()" );
+    OstTrace0( TRACE_FATAL, CTHUMBAGIMAGEOBSERVER_SHUTDOWNNOTIFICATION, "CThumbAGImageObserver::ShutdownNotification" );
     
     if (!iShutdown)
         {
         TN_DEBUG1( "CThumbAGImageObserver::ShutdownNotification() shutdown" );
+        OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGIMAGEOBSERVER_SHUTDOWNNOTIFICATION, "CThumbAGImageObserver::ShutdownNotification - shutdown" );
         iShutdown = ETrue;
         }
     }
@@ -338,6 +368,7 @@
 TInt CThumbAGImageObserver::ReconnectCallBack(TAny* aAny)
     {
     TN_DEBUG1( "CThumbAGImageObserver::ReconnectCallBack() - reinitialize");
+    OstTrace0( TRACE_FATAL, CTHUMBAGIMAGEOBSERVER_RECONNECTCALLBACK, "CThumbAGImageObserver::ReconnectCallBack - reinitialize" );
     
     CThumbAGImageObserver* self = static_cast<CThumbAGImageObserver*>( aAny );
     
@@ -347,6 +378,7 @@
     TRAP_IGNORE( self->InitializeL() );
     
     TN_DEBUG1( "CThumbAGImageObserver::ReconnectCallBack() - done");
+    OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGIMAGEOBSERVER_RECONNECTCALLBACK, "CThumbAGImageObserver::ReconnectCallBack - done" );
     
     return KErrNone;
     }
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagprocessor.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagprocessor.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -30,6 +30,10 @@
 #include "thumbnaillog.h"
 #include "thumbnailmanagerconstants.h"
 #include "thumbnailmanagerprivatecrkeys.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbagprocessorTraces.h"
+#endif
 
 // ---------------------------------------------------------------------------
 // CThumbAGProcessor::NewL()
@@ -38,6 +42,7 @@
 CThumbAGProcessor* CThumbAGProcessor::NewL()
     {
     TN_DEBUG1( "CThumbAGProcessor::NewL() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_NEWL, "CThumbAGProcessor::NewL - begin" );
     
     CThumbAGProcessor* self = new( ELeave )CThumbAGProcessor();
     CleanupStack::PushL( self );
@@ -54,6 +59,7 @@
         iPHHarvestingItemsLeftTemp(0)
     {
     TN_DEBUG1( "CThumbAGProcessor::CThumbAGProcessor() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_CTHUMBAGPROCESSOR, "CThumbAGProcessor::CThumbAGProcessor- begin" );
     
     CActiveScheduler::Add( this );
     }
@@ -65,6 +71,7 @@
 void CThumbAGProcessor::ConstructL()
     {
     TN_DEBUG1( "CThumbAGProcessor::ConstructL() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_CONSTRUCTL, "CThumbAGProcessor::ConstructL - begin" );
     
     iShutdown = EFalse;
     
@@ -106,6 +113,7 @@
     iForegroundGenerationObserver = CTMRPropertyObserver::NewL( *this, KTAGDPSNotification, KForceBackgroundGeneration, ETrue );  
     
     TN_DEBUG1( "CThumbAGProcessor::ConstructL() - end" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_CONSTRUCTL, "CThumbAGProcessor::ConstructL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -115,6 +123,7 @@
 CThumbAGProcessor::~CThumbAGProcessor()
     {
     TN_DEBUG1( "CThumbAGProcessor::~CThumbAGProcessor() - begin" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_CTHUMBAGPROCESSOR, "CThumbAGProcessor::~CThumbAGProcessor - begin" );
     
     Shutdown();
     
@@ -206,6 +215,7 @@
     iQueryQueue.Close();
     
     TN_DEBUG1( "CThumbAGProcessor::~CThumbAGProcessor() - end" );
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_CTHUMBAGPROCESSOR, "CThumbAGProcessor::~CThumbAGProcessor - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -215,6 +225,7 @@
 void CThumbAGProcessor::Shutdown()
     {
     TN_DEBUG1( "CThumbAGProcessor::Shutdown()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_SHUTDOWN, "CThumbAGProcessor::Shutdown" );
     iShutdown = ETrue;
     UpdatePSValues(EFalse, EFalse);
     }
@@ -239,6 +250,7 @@
         if(&aQuery == iQueryPlaceholders)
             {
             TN_DEBUG2( "CThumbAGProcessor::HandleQueryNewResults - iQueryPlaceholders, %d new", aNewItemCount);
+            OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_HANDLEQUERYNEWRESULTS, "CThumbAGProcessor::HandleQueryNewResults - iQueryPlaceholders;aNewItemCount=%d", aNewItemCount );
             
             for(TInt i = aFirstNewItemIndex; i < iQueryPlaceholders->Count(); i++)
                 {    
@@ -252,6 +264,7 @@
                 if(!object->Placeholder())
                     {
                     TN_DEBUG2( "CThumbAGProcessor::HandleQueryNewResults %d not placeholder", object->Id());
+                    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_HANDLEQUERYNEWRESULTS, "CThumbAGProcessor::HandleQueryNewResults - not placeholder;object->Id()=%u", object->Id() );
                     continue;
                     }
                
@@ -268,6 +281,7 @@
         else if(&aQuery == iQueryAllItems)
             {
             TN_DEBUG2( "CThumbAGProcessor::HandleQueryNewResults - QueryAllItems, %d new", aNewItemCount);
+            OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_HANDLEQUERYNEWRESULTS, "CThumbAGProcessor::HandleQueryNewResults - QueryAllItems;aNewItemCount=%d", aNewItemCount );
             
             for(TInt i = aFirstNewItemIndex; i < iQueryAllItems->Count(); i++)
                 {    
@@ -294,6 +308,7 @@
     else
         {
         TN_DEBUG1( "CThumbAGProcessor::HandleQueryNewResults - error, no new items");
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_HANDLEQUERYNEWRESULTS, "CThumbAGProcessor::HandleQueryNewResults - error, no new items" );
         }
     }
 
@@ -304,6 +319,7 @@
 void CThumbAGProcessor::HandleQueryCompleted( CMdEQuery& aQuery, const TInt aError )
     {
     TN_DEBUG3( "CThumbAGProcessor::HandleQueryCompleted, aError == %d Count== %d", aError, aQuery.Count());
+    OstTraceExt2( TRACE_NORMAL, CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted;aError=%d;aQuery.Count()=%d", aError, aQuery.Count() );
     
     if(iShutdown)
         {
@@ -313,6 +329,7 @@
     if(&aQuery == iQueryPlaceholders)
         {
         TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted - iQueryPlaceholders completed");
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - iQueryPlaceholders completed" );
         
         //free query
         delete iQueryPlaceholders;
@@ -327,9 +344,11 @@
     else if(&aQuery == iQueryAllItems)
         {
         TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted - QueryAllItems completed");
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - QueryAllItems completed" );
 
 #ifdef _DEBUG
 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted IN-COUNTERS---------- Amount: %d, Add",iQueryAllItems->Count());
+OstTrace1( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted IN-COUNTERS---------- Amount;iQueryAllItems->Count()=%d", iQueryAllItems->Count() );
 #endif
        
         //free query
@@ -339,6 +358,7 @@
     else if(&aQuery == iQuery ) 
         {
         TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted - Query completed");
+        OstTrace0( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - Query completed" );
         
         if(iQueryActive)
             {
@@ -354,6 +374,7 @@
             if(iProcessingCount != iQueryQueue.Count() )
                 {
                 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted() some result items missing");
+                OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - some result items missing" );
                 
                 RArray<TItemId> queryQueueDelta;
                 
@@ -375,6 +396,7 @@
                          if(!found)
                              {
                              TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() %d missing from query results", iQueryQueue[queryItem] );
+                             OstTrace1( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted;iQueryQueue[queryItem]=%d", iQueryQueue[queryItem] );
                              
                              // ignore if fails
                              queryQueueDelta.InsertInOrder(iQueryQueue[queryItem], CompareId);
@@ -382,6 +404,7 @@
                          }
                      
                      TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() missing items found %d", queryQueueDelta.Count()); 
+                     OstTrace1( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - missing items found;queryQueueDelta.Count()=%d", queryQueueDelta.Count() );
                      //cleanup from previous queue it item is not found from MDS
                      while(queryQueueDelta.Count())
                          {
@@ -392,6 +415,7 @@
                          if(itemIndex >= 0)
                              {
                              TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() remove %d from iQueryQueue", queryQueueDelta[0]);
+                             OstTrace1( TRACE_NORMAL, DUP8_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - remove from iQueryQueue;queryQueueDelta[0]=%d", queryQueueDelta[0] );
                              iQueryQueue.Remove( itemIndex );
                              
                              //remove from procesing queue
@@ -403,12 +427,14 @@
                                  if( iUnknown )
                                      {
                                      TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() mark %d as EGenerationItemTypeNotFound in iGenerationQueue", queryQueueDelta[0]);
+                                     OstTrace1( TRACE_NORMAL, DUP9_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - mark as EGenerationItemTypeNotFound in iGenerationQueue;queryQueueDelta[0]=%d", queryQueueDelta[0] );
                                      //mark to be removed, cleanup is done below
                                      iGenerationQueue[itemIndex].iItemType = EGenerationItemTypeNotFound;
                                      }
                                  else
                                      {
                                      TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() remove %d from iGenerationQueue", queryQueueDelta[0]);
+                                     OstTrace1( TRACE_NORMAL, DUP10_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - remove from iGenerationQueue;queryQueueDelta[0]=%d", queryQueueDelta[0] );
                                      iGenerationQueue.Remove( itemIndex );
                                      }
                                  }
@@ -440,6 +466,7 @@
                             if(iGenerationQueue[itemIndex].iItemType == EGenerationItemTypeNotFound)
                                 {
                                 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() remove EGenerationItemTypeNotFound %d item from iGenerationQueue", item.iItemId);
+                                OstTrace1( TRACE_NORMAL, DUP11_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - remove EGenerationItemTypeNotFound item from iGenerationQueue;item.iItemId=%u", item.iItemId );
                                 iGenerationQueue.Remove(itemIndex);
                                 continue;
                                 }
@@ -449,6 +476,7 @@
                                 if(item.iItemType == EGenerationItemTypeUnknown )
                                   {
                                   TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() remove unknown item %d", item.iItemId);
+                                  OstTrace1( TRACE_NORMAL, DUP12_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - remove unknown item;item.iItemId=%u", item.iItemId );
                                   iGenerationQueue.Remove(itemIndex);
                                   continue;
                                   }
@@ -476,11 +504,13 @@
             //Delete and cancel query, do not return items back to original queue
             DeleteAndCancelQuery( EFalse );
             TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted() Query FAILED!"); 
+            OstTrace0( TRACE_NORMAL, DUP13_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - Query FAILED!" );
             }
         }
     else
         {
         TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted() - NO QUERY ACTIVE"); 
+        OstTrace0( TRACE_NORMAL, DUP14_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - NO QUERY ACTIVE" );
         __ASSERT_DEBUG((EFalse), User::Panic(_L("CThumbAGProcessor::HandleQueryCompleted()"), -1));
         }
     
@@ -495,6 +525,7 @@
                                                TThumbnailRequestId /*aId*/)
     {
     TN_DEBUG1( "CThumbAGProcessor::ThumbnailPreviewReady()");
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_THUMBNAILPREVIEWREADY, "CThumbAGProcessor::ThumbnailPreviewReady" );
     // No implementation required
     }
 
@@ -506,6 +537,7 @@
                                         TThumbnailRequestId /*aId*/ )
     {
     TN_DEBUG2( "CThumbAGProcessor::ThumbnailReady() aError == %d", aError );
+    OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_THUMBNAILREADY, "CThumbAGProcessor::ThumbnailReady;aError=%d", aError );
     
     iActiveCount--;
     
@@ -513,6 +545,7 @@
     if( aError == KErrServerTerminated )
         {
         TN_DEBUG1( "CThumbAGProcessor::ThumbnailReady() - **** THUMBNAIL SERVER DIED ****" );
+		OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_THUMBNAILREADY, "CThumbAGProcessor::ThumbnailReady - **** THUMBNAIL SERVER DIED ****" );
 		
         iSessionDied = ETrue;
         
@@ -524,13 +557,14 @@
         //reset PS idle so that RunL() can startup reopen TNM session and proceed
         TInt ret = RProperty::Set(KServerIdle, KIdle, ETrue);
         TN_DEBUG2( "CThumbAGProcessor::ThumbnailReady() set Idle ret = %d", ret );
-        
+        OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_THUMBNAILREADY, "CThumbAGProcessor::ThumbnailReady - set Idle ret;ret=%d", ret );
         return;
         }
     
     ActivateAO();
 	
     TN_DEBUG1( "CThumbAGProcessor::ThumbnailReady() - end" );
+    OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_THUMBNAILREADY, "CThumbAGProcessor::ThumbnailReady - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -543,6 +577,7 @@
     if (aRequestType == ERequestDeleteThumbnails)
         {
         TN_DEBUG1( "CThumbAGProcessor::ThumbnailRequestReady() - delete" );
+        OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_THUMBNAILREQUESTREADY, "CThumbAGProcessor::ThumbnailRequestReady - delete" );
     
         iActiveCount--;
         
@@ -557,6 +592,7 @@
 void CThumbAGProcessor::SetMdESessionL( CMdESession* aMdESession )
     {
     TN_DEBUG1( "CThumbAGProcessor::SetMdESession() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_SETMDESESSIONL, "CThumbAGProcessor::SetMdESessionL - begin" );
     
     iMdESession = aMdESession;
     
@@ -566,6 +602,7 @@
     if (err != KErrNone)
         {
         TN_DEBUG2( "CThumbAGProcessor::SetMdESession() GetDefaultNamespaceDefL() err = %d", err );
+        OstTrace1( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_SETMDESESSIONL, "CThumbAGProcessor::SetMdESessionL;err=%d", err );
         __ASSERT_DEBUG((iDefNamespace), User::Panic(_L("CThumbAGProcessor::SetMdESession() !iDefNamespace "), KErrBadHandle));
         }
     else
@@ -595,7 +632,7 @@
                                     TBool /*aPresent*/ )
     {
     TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - begin" );
-    
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - begin" );
 
     // update queues
     if (aType == ENotifyAdd)
@@ -621,10 +658,12 @@
     else if (aType == ENotifyModify)
         {
         TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - ENotifyModify" );
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - ENotifyModify" );
         
         if(iPHHarvesting)
             {        
             TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - PH  harvesting active, treat like add" );
+            OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - PH  harvesting active, treat like add" );
             for (int i=0; i<aIDArray.Count(); i++)
                 {
                 TThumbnailGenerationItem item;
@@ -636,12 +675,13 @@
                 if (itemIndex >= 0)
                     {
                     TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - set as non-placeholder");
+                    OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - set as non-placeholder" );
                     iGenerationQueue[itemIndex].iPlaceholder = EFalse;
                     }
                 else
                     {
                     TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append");
-
+                    OstTrace0( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - append" );
                      item.iPlaceholder = EFalse;
                      SetGenerationItemAction( item, aItemType );
                      AppendProcessingQueue( item );
@@ -651,6 +691,7 @@
         else
             {
             TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - PH  harvesting finished, check is real modify!" );
+            OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - PH  harvesting finished, check is real modify!" );
             
             TInt itemIndex(KErrNotFound);
             
@@ -667,11 +708,13 @@
                     if( iGenerationQueue[itemIndex].iPlaceholder )
                         {
                         TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - placeholder modify");
+                        OstTrace0( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - placeholder modify" );
                         iGenerationQueue[itemIndex].iPlaceholder = EFalse;
                         }
                     else
                         {
                         TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - real modify");
+                        OstTrace0( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - real modify" );
                         iGenerationQueue[itemIndex].iItemAction = EGenerationItemActionModify;
                         SetForceRun( ETrue );
                         }
@@ -679,6 +722,7 @@
                 else
                     {
                     TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append");
+                    OstTrace0( TRACE_NORMAL, DUP8_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - append" );
                     SetGenerationItemAction( item, aItemType);
                     item.iPlaceholder = EFalse;
                     AppendProcessingQueue( item );
@@ -689,6 +733,7 @@
         else if (aType == ENotifyRemove && aItemType == EGenerationItemTypeAny)
             {
             TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - ENotifyRemove, remove IDs from all queues");
+            OstTrace0( TRACE_NORMAL, DUP9_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - ENotifyRemove, remove IDs from all queues" );
             
             for (int i=0; i<aIDArray.Count(); i++)
                 {
@@ -717,6 +762,7 @@
                 else
                     {
                     TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append");
+                    OstTrace0( TRACE_NORMAL, DUP10_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - append" );
                     item.iItemAction = EGenerationItemActionDelete;
                     delete item.iUri;
                     item.iUri = NULL;
@@ -734,12 +780,14 @@
                     }
                 
                 TN_DEBUG2( "CThumbAGProcessor::AddToQueueL() - %S", aObjectUriArray[i]); 
+                OstTraceExt1( TRACE_NORMAL, DUP11_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL;aObjectUriArray[i]=%S", *aObjectUriArray[i] );
                 }
             }
 #ifdef _DEBUG
         else
             {
 	        TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() -  should not come here" );
+	        OstTrace0( TRACE_NORMAL, DUP12_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL -  should not come here" );
 	        __ASSERT_DEBUG((EFalse), User::Panic(_L("CThumbAGProcessor::AddToQueueL()"), KErrArgument));
 	        User::Leave( KErrArgument );
             }
@@ -748,6 +796,7 @@
     ActivateAO(); 
     
     TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - end" );
+    OstTrace0( TRACE_NORMAL, DUP13_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -757,6 +806,7 @@
 void CThumbAGProcessor::CreateThumbnailsL( const CMdEObject* aObject )
     {
     TN_DEBUG1( "CThumbAGProcessor::CreateThumbnailsL() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL - begin" );
     
     __ASSERT_DEBUG((iTMSession), User::Panic(_L("CThumbAGProcessor::CreateThumbnailsL() !iTMSession "), KErrBadHandle));
     __ASSERT_DEBUG((iDefNamespace), User::Panic(_L("CThumbAGProcessor::CreateThumbnailsL() !iDefNamespace "), KErrBadHandle));
@@ -795,9 +845,11 @@
             {
             //generate both if needed
             TN_DEBUG1( "CThumbAGProcessor::CreateThumbnailsL() EOptimizeForQuality ");
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL - EOptimizeForQuality" );
             iTMSession->SetQualityPreferenceL( CThumbnailManager::EOptimizeForQuality );
             
             TN_DEBUG2( "CThumbAGProcessor::CreateThumbnailsL() - 2nd round add remove from queue", aObject->Id() );
+            OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL - 2nd round add remove from queue;aObject->Id()=%u", aObject->Id() );
                         
             TThumbnailGenerationItem item;
             item.iItemId = aObject->Id();
@@ -816,10 +868,12 @@
             {
             //1st round
             TN_DEBUG1( "CThumbAGProcessor::CreateThumbnailsL() EOptimizeForQualityWithPreview");
+            OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL - EOptimizeForQualityWithPreview" );
             iTMSession->SetQualityPreferenceL( CThumbnailManager::EOptimizeForQualityWithPreview );
             
             // add item to 2nd round queue 
             TN_DEBUG2( "CThumbAGProcessor::CreateThumbnailsL() - 1st round add/modify, append to 2nd round queue", aObject->Id() );
+            OstTrace1( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL - 1st round add/modify, append to 2nd round queue;aObject->Id()=%u", aObject->Id() );
             
             TThumbnailGenerationItem item;
             item.iItemId = aObject->Id();
@@ -850,6 +904,7 @@
         if ( err != KErrNone )
             {
             TN_DEBUG2( "CThumbAGProcessor::CreateThumbnailsL, iTMSession error == %d", err );
+            OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL" );
             
             iSessionDied = ETrue;
             ActivateAO();
@@ -865,6 +920,7 @@
         }
         
     TN_DEBUG1( "CThumbAGProcessor::CreateThumbnailsL() - end" );
+    OstTrace0( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -874,6 +930,7 @@
 void CThumbAGProcessor::QueryL(/*RArray<TItemId>& aIDArray*/TThumbnailGenerationItemAction aAction  )
     {
     TN_DEBUG1( "CThumbAGProcessor::QueryL() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_QUERYL, "CThumbAGProcessor::QueryL - begin" );
     
     __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::QueryL() !iMdeSession "), KErrBadHandle));
     __ASSERT_DEBUG((iDefNamespace), User::Panic(_L("CThumbAGProcessor::QueryL() !iDefNamespace "), KErrBadHandle));
@@ -900,7 +957,7 @@
     TInt maxCount = iGenerationQueue.Count();
         
     TN_DEBUG3( "CThumbAGProcessor::QueryL() - fill begin iGenerationQueue == %d, iQueryQueue == %d", iGenerationQueue.Count(), iQueryQueue.Count() );
-    
+    OstTraceExt2( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_QUERYL, "CThumbAGProcessor::QueryL -  - fill begin iGenerationQueue, iQueryQueue;iGenerationQueue.Count()=%d;iQueryQueue.Count()=%d", iGenerationQueue.Count(), iQueryQueue.Count() );
     
     TInt itemCount(0);
     for(TInt i=0; itemCount < KMaxQueryItems && i < maxCount; i++)
@@ -941,6 +998,7 @@
         if( itemIndex >= 0 )
             {
             TN_DEBUG2( "CThumbAGProcessor::QueryL() - fill %d", iGenerationQueue[itemIndex].iItemId );        
+            OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_QUERYL, "CThumbAGProcessor::QueryL - fill;iGenerationQueue[itemIndex].iItemId=%u", iGenerationQueue[itemIndex].iItemId );
             iQueryQueue.InsertInOrder(iGenerationQueue[itemIndex].iItemId, CompareId);
             itemCount++;
             }
@@ -949,12 +1007,14 @@
     if(!itemCount)
         {
         TN_DEBUG1( "CThumbAGProcessor::QueryL() - empty query, cancel?!");
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_QUERYL, "CThumbAGProcessor::QueryL - empty query, cancel?!" );
         iQueryActive = EFalse;
         __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::QueryL() empty! "), KErrNotFound));
         return;
         }
     
     TN_DEBUG3( "CThumbAGProcessor::QueryL() - fill end iGenerationQueue == %d, iQueryQueue == %d", iGenerationQueue.Count(), iQueryQueue.Count() );
+    OstTraceExt2( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_QUERYL, "CThumbAGProcessor::QueryL;iGenerationQueue.Count()=%d;iQueryQueue.Count()=%d", iGenerationQueue.Count(), iQueryQueue.Count() );
     
     CMdEObjectDef& objDef = iDefNamespace->GetObjectDefL( MdeConstants::Object::KBaseObject );
     iQuery = iMdESession->NewObjectQueryL( *iDefNamespace, objDef, this );
@@ -1001,6 +1061,7 @@
 	    }
     
     TN_DEBUG1( "CThumbAGProcessor::QueryL() - end" );
+    OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_QUERYL, "CThumbAGProcessor::QueryL - end" );
     }
 
 
@@ -1012,6 +1073,7 @@
 void CThumbAGProcessor::QueryPlaceholdersL(TBool aPresent)
     {
     TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_QUERYPLACEHOLDERSL, "CThumbAGProcessor::QueryPlaceholdersL" );
     
     __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::QueryPlaceholdersL() !iMdeSession "), KErrBadHandle));
     __ASSERT_DEBUG((iDefNamespace), User::Panic(_L("CThumbAGProcessor::QueryPlaceholdersL() !iDefNamespace "), KErrBadHandle));
@@ -1026,6 +1088,7 @@
         if( !iQueryPlaceholders->IsComplete() )
             {
             TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL active- skip" );
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_QUERYPLACEHOLDERSL, "CThumbAGProcessor::QueryPlaceholdersL - skip" );
             return;
             }
         
@@ -1036,6 +1099,7 @@
         }
    
     TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL - start" );
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_QUERYPLACEHOLDERSL, "CThumbAGProcessor::QueryPlaceholdersL - start" );
 
     CMdEObjectDef& imageObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Image::KImageObject );
     CMdEObjectDef& videoObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Video::KVideoObject );
@@ -1072,6 +1136,7 @@
         }
 	
     TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL - end" );
+    OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_QUERYPLACEHOLDERSL, "CThumbAGProcessor::QueryPlaceholdersL - end" );
     }
 
 
@@ -1082,16 +1147,19 @@
 void CThumbAGProcessor::RunL()
     {
     TN_DEBUG1( "CThumbAGProcessor::RunL() - begin" );
+	OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - begin" );
 	
 	if(iShutdown)
 		{
         TN_DEBUG1( "CThumbAGProcessor::RunL() - shutdown" );
+		OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - shutdown" );
 		return;
 		}
     
     if (iSessionDied)
         {
         TN_DEBUG1( "CThumbAGProcessor::RunL() - iSessionDied" );
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - iSessionDied" );
         delete iTMSession;
         iTMSession = NULL;
         }
@@ -1099,6 +1167,7 @@
     if (iInit)
         {
         TN_DEBUG1( "CThumbAGProcessor::RunL() - Do Initialisation 1" );
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - Do Initialisation 1" );
         
         iInit = EFalse;
         iInit2 = ETrue;
@@ -1111,6 +1180,7 @@
 		//query all items after PH query
         iDoQueryAllItems = ETrue;
         TN_DEBUG1( "CThumbAGProcessor::RunL() - Initialisation 1 done" );
+        OstTrace0( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - Initialisation 1 done" );
         ActivateAO();
         return;
         }
@@ -1118,26 +1188,32 @@
     if(iInit2)
         {
         TN_DEBUG1( "CThumbAGProcessor::RunL() - Do Initialisation 2" );
+		OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - Do Initialisation 2" );
 		
         iInit2 = EFalse;
         TInt err(KErrNone);
         
 #ifdef  MDS_MODIFY_OBSERVER        
         TN_DEBUG1( "CThumbAGProcessor::RunL() do iHarvesterClient connect");
+        OstTrace0( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - do iHarvesterClient connect" );
         err = iHarvesterClient.Connect();
         TN_DEBUG2( "CThumbAGProcessor::RunL() iHarvesterClient connect err = %d", err);
+        OstTrace1( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - iHarvesterClient connect;err=%d", err );
         
         __ASSERT_DEBUG((err == KErrNone), User::Panic(_L("CThumbAGProcessor::RunL(), !iHarvesterClient "), err));
         
         if(  err == KErrNone )
             {
             TN_DEBUG1( "CThumbAGProcessor::RunL() add iHarvesterClient observer");
+            OstTrace0( TRACE_NORMAL, DUP8_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - add iHarvesterClient observer" );
             err = iHarvesterClient.AddHarvesterEventObserver( *this, EHEObserverTypeOverall | EHEObserverTypeMMC | EHEObserverTypePlaceholder, 20 );
             TN_DEBUG2( "CThumbAGProcessor::RunL() iHarvesterClient observer err = %d", err);
+            OstTrace1( TRACE_NORMAL, DUP9_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - iHarvesterClient observer;err=%d", err );
             
             if( !err )
                 {
                 TN_DEBUG1( "CThumbAGProcessor::RunL() add iHarvesterClient observer failed");
+                OstTrace0( TRACE_NORMAL, DUP10_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - add iHarvesterClient observer failed" );
                 // if we fail observer harvester, fake it
                 iHarvesterActivated = ETrue;
                 }
@@ -1146,8 +1222,10 @@
 #endif
  
         TN_DEBUG1( "CThumbAGProcessor::RunL() MMPXCollectionUtility");
+        OstTrace0( TRACE_NORMAL, DUP11_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - MMPXCollectionUtility");
         TRAP( err, iCollectionUtility = MMPXCollectionUtility::NewL( this, KMcModeIsolated ));
         TN_DEBUG2( "CThumbAGProcessor::RunL() create MMPXCollectionUtility err = %d", err);
+        OstTrace1( TRACE_NORMAL, DUP12_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - create MMPXCollectionUtility err;err=%d", err );
         __ASSERT_DEBUG((iCollectionUtility), User::Panic(_L("CThumbAGProcessor::RunL(), !iCollectionUtility "), err));
         
         __ASSERT_DEBUG((iActivityManager), User::Panic(_L("CThumbAGProcessor::RunL(), !iActivityManager "), KErrBadHandle));
@@ -1157,6 +1235,7 @@
             }
         
         TN_DEBUG1( "CThumbAGProcessor::RunL() - Initialisation 2 done" );
+        OstTrace0( TRACE_NORMAL, DUP13_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - Initialisation 2 done" );
         return;
         }
     
@@ -1164,6 +1243,7 @@
     if (!iTMSession)
         {
         TN_DEBUG1( "CThumbAGProcessor::RunL() - open TNM session");
+        OstTrace0( TRACE_NORMAL, DUP14_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL" );
         TRAPD( err, iTMSession = CThumbnailManager::NewL( *this ) );
 		
         if (err != KErrNone)
@@ -1171,6 +1251,7 @@
             iTMSession = NULL;
             ActivateAO();
             TN_DEBUG2( "CThumbAGProcessor::RunL() - Session restart failed, error == %d", err );
+            OstTrace1( TRACE_NORMAL, DUP15_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - Session restart failed, error;err=%d", err );
             }        
         else 
             {
@@ -1183,6 +1264,7 @@
     if(iActiveCount >= KMaxDaemonRequests)
         {
         TN_DEBUG1( "CThumbAGProcessor::RunL() - waiting for previous to complete, abort..." );
+        OstTrace0( TRACE_NORMAL, DUP16_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - waiting for previous to complete, abort..." );
         return;
         }
     
@@ -1191,17 +1273,20 @@
 	if( iForegroundRun )
 		{
       	TN_DEBUG1( "void CThumbAGProcessor::RunL() KForceBackgroundGeneration enabled");
+	  	OstTrace0( TRACE_NORMAL, DUP17_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - KForceBackgroundGeneration enabled" );
 	  	}
 	
     if( iForceRun )
         {
         TN_DEBUG1( "CThumbAGProcessor::RunL() - *** FORCED RUN ***");
+        OstTrace0( TRACE_NORMAL, DUP18_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - *** FORCED RUN ***" );
         }
 #endif
 	
   	if( (iForceRun || iForegroundRun ) && !iMountTimer->IsActive() )
       	{
         TN_DEBUG1( "void CThumbAGProcessor::RunL() skip idle detection!");
+      	OstTrace0( TRACE_NORMAL, DUP19_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - skip idle detection!" );
       	CancelTimeout();
      	}
   	else
@@ -1209,6 +1294,7 @@
         if( !iIdle || iHarvesting || iMPXHarvesting || iPeriodicTimer->IsActive() )
             {
             TN_DEBUG1( "void CThumbAGProcessor::RunL() device not idle");
+            OstTrace0( TRACE_NORMAL, DUP20_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - device not idle" );
             return;
             }
         else
@@ -1221,10 +1307,12 @@
                 {
             	//start inactivity timer and retry on after callback
             	TN_DEBUG1( "void CThumbAGProcessor::RunL() server not idle");
+                OstTrace0( TRACE_NORMAL, DUP21_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - server not idle" );
                 StartTimeout();
                 return;
                 }
             TN_DEBUG1( "void CThumbAGProcessor::RunL() device and server idle, process");
+            OstTrace0( TRACE_NORMAL, DUP22_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - device and server idle, process" );
             }
 	    }
     
@@ -1238,6 +1326,7 @@
         if(((iForceRun && iModify ) || (!iForceRun && !iModify )) && !iUnknownItemCount && !iMountTimer->IsActive())
             {
             TN_DEBUG1( "CThumbAGProcessor::RunL() - iQueryReady START" );
+            OstTrace0( TRACE_NORMAL, DUP23_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - iQueryReady START" );
             
             const CMdEObject* object = &iQuery->Result( iProcessingCount-1 );
             iProcessingCount--;
@@ -1255,6 +1344,7 @@
             
                 TRAP( err, CreateThumbnailsL( object ) );
                 TN_DEBUG2( "CThumbAGProcessor::RunL(), CreateThumbnailsL error == %d", err );
+                OstTrace1( TRACE_NORMAL, DUP24_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - CreateThumbnailsL error;err=%d", err );
                 __ASSERT_DEBUG((err==KErrNone), User::Panic(_L("CThumbAGProcessor::RunL(), CreateThumbnailsL() "), err));
                 }
             }
@@ -1263,6 +1353,7 @@
             {
 			//cancel query
             TN_DEBUG1( "CThumbAGProcessor::RunL() - cancel processing query" );
+            OstTrace0( TRACE_NORMAL, DUP25_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - cancel processing query" );
             DeleteAndCancelQuery( ETrue );
 	        ActivateAO();
             return;  
@@ -1272,6 +1363,7 @@
         if( iProcessingCount <= 0 )
             {
             TN_DEBUG1( "CThumbAGProcessor::RunL() - iQueryReady FINISH" );
+            OstTrace0( TRACE_NORMAL, DUP26_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - iQueryReady FINISH" );
             iQueryReady = EFalse;
             iQueryActive = EFalse;
             }
@@ -1291,11 +1383,13 @@
         else  
             {
             TN_DEBUG1( "CThumbAGProcessor::RunL() - waiting for query to complete, abort..." );
+            OstTrace0( TRACE_NORMAL, DUP27_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - waiting for query to complete, abort..." );
             }    
         }
     else if ( iUnknownItemCount > 0 )
         {
         TN_DEBUG1( "void CThumbAGProcessor::RunL() unknown items in queue");
+        OstTrace0( TRACE_NORMAL, DUP28_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - unknown items in queue" );
         
         i2ndRound = EFalse;
         iModify = EFalse;
@@ -1307,6 +1401,7 @@
     else if ( iDeleteItemCount > 0 )
        {
        TN_DEBUG1( "void CThumbAGProcessor::RunL() delete thumbnails");
+       OstTrace0( TRACE_NORMAL, DUP29_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - delete thumbnails" );
        // delete thumbs by URI
        __ASSERT_DEBUG((iTMSession), User::Panic(_L("CThumbAGProcessor::RunL() !iTMSession "), KErrBadHandle));
        if(iTMSession)
@@ -1327,12 +1422,14 @@
                    {
                    //URI is invalid
                    TN_DEBUG1( "void CThumbAGProcessor::RunL() unable to delete URI inbalid");
+                   OstTrace0( TRACE_NORMAL, DUP30_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - unable to delete URI inbalid" );
                    iGenerationQueue.Remove( itemIndex );
                    ActivateAO();
                    return;
                    }
 
                TN_DEBUG2( "void CThumbAGProcessor::RunL() delete %S",  iGenerationQueue[itemIndex].iUri);
+               OstTraceExt1( TRACE_NORMAL, DUP31_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL;iGenerationQueue[itemIndex].iUri=%S", *iGenerationQueue[itemIndex].iUri );
                CThumbnailObjectSource* source = NULL;                
                TRAPD(err,  source = CThumbnailObjectSource::NewL( *iGenerationQueue[itemIndex].iUri, KNullDesC));
                   
@@ -1355,6 +1452,7 @@
     else if ( iModifyItemCount > 0 )
         {
         TN_DEBUG1( "void CThumbAGProcessor::RunL() update thumbnails");
+        OstTrace0( TRACE_NORMAL, DUP32_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - update thumbnails" );
         
         i2ndRound = EFalse;
         
@@ -1367,6 +1465,7 @@
     else if ( iAddItemCount > 0 )
         {
         TN_DEBUG1( "void CThumbAGProcessor::RunL() update 1st round thumbnails");
+        OstTrace0( TRACE_NORMAL, DUP33_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - update 1st round thumbnails" );
         
         i2ndRound = EFalse;
         iUnknown = EFalse;
@@ -1378,6 +1477,7 @@
     else if( i2ndAddItemCount > 0)
         {
         TN_DEBUG1( "void CThumbAGProcessor::RunL() update 2nd round thumbnails");
+            OstTrace0( TRACE_NORMAL, DUP34_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - update 2nd round thumbnails" );
             
         // query for object info
         iQueryActive = ETrue;
@@ -1387,6 +1487,7 @@
         }
         
     TN_DEBUG1( "CThumbAGProcessor::RunL() - end" );
+    OstTrace0( TRACE_NORMAL, DUP35_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -1396,10 +1497,12 @@
 void CThumbAGProcessor::DeleteAndCancelQuery(TBool aRestoreItems)
     {
     TN_DEBUG2( "CThumbAGProcessor::DeleteAndCancelQuery(aRestoreItems = %d) in", aRestoreItems );
+    OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_DELETEANDCANCELQUERY, "CThumbAGProcessor::DeleteAndCancelQuery;aRestoreItems=%d", aRestoreItems );
     
     if(iQuery)
         {
         TN_DEBUG1( "CThumbAGProcessor::DeleteAndCancelQuery() - deleting query" );
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_DELETEANDCANCELQUERY, "CThumbAGProcessor::DeleteAndCancelQuery - deleting query" );
         iQuery->Cancel();
         delete iQuery;
         iQuery = NULL;
@@ -1429,6 +1532,7 @@
         }
 
     TN_DEBUG1( "CThumbAGProcessor::DeleteAndCancelQuery() out" );
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_DELETEANDCANCELQUERY, "CThumbAGProcessor::DeleteAndCancelQuery - out" );
     }
 
 // ---------------------------------------------------------------------------
@@ -1446,6 +1550,7 @@
          TInt aItemsLeft )
     {
     TN_DEBUG4( "CThumbAGProcessor::HarvestingUpdated -- start() aHEObserverType = %d, aHarvesterEventState = %d, aItemsLeft = %d", aHEObserverType, aHarvesterEventState, aItemsLeft );
+    OstTraceExt3( TRACE_NORMAL, CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated;aHEObserverType=%u;aHarvesterEventState=%u;aItemsLeft=%d", aHEObserverType, aHarvesterEventState, aItemsLeft );
     
 	if(iShutdown)
         {
@@ -1461,14 +1566,17 @@
     if( aHEObserverType == EHEObserverTypePlaceholder)
         {
         TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypePlaceholder");
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypePlaceholder" );
         }
     else if( aHEObserverType == EHEObserverTypeOverall)
         {
         TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypeOverall");
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypeOverall" );
         }
     else if( aHEObserverType == EHEObserverTypeMMC)
         {
         TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypeMMC");
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypeMMC" );
         }
     #endif
     
@@ -1500,10 +1608,12 @@
             if( iPHHarvesting )
                 {
                 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS placeholder harvesterin started");
+                OstTrace0( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MDS placeholder harvesterin starteds" );
                 }
             else
                 {
                 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS placeholder harvesting finished");
+                OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MDS placeholder harvesting finished" );
                 //query present placeholders
                 TRAP_IGNORE(QueryPlaceholdersL( EFalse ));
                 iDoQueryAllItems = EFalse;
@@ -1516,6 +1626,7 @@
           {
           //if items count increasing, restart mount timeout 
             TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- PH count increasing, restart mount timeout");
+            OstTrace0( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- PH count increasing, restart mount timeout" );
             
            if(iMountTimer->IsActive())
               {
@@ -1559,11 +1670,13 @@
             if( iHarvesting )
                 {
                 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS harvesting started");
+                OstTrace0( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MDS harvesting started" );
                 CancelTimeout();
                 }
             else
                 {
                 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS harvesting finished ");
+                OstTrace0( TRACE_NORMAL, DUP8_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MDS harvesting finished" );
                 // continue processing if needed
                 StartTimeout();
                 
@@ -1602,6 +1715,7 @@
             if( iMMCHarvesting )
                 {
                 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS MMC harvesterin started");
+                OstTrace0( TRACE_NORMAL, DUP9_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MDS MMC harvesterin started" );
                 UpdatePSValues(EFalse, ETrue);
                 iMMCHarvestingItemsLeftTemp = 0;
                 }
@@ -1613,6 +1727,7 @@
                     StartTimeout();
                     }
                 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS MMC harvesting finished ");
+                OstTrace0( TRACE_NORMAL, DUP10_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MDS MMC harvesting finished" );
                 }
             }
         
@@ -1620,6 +1735,7 @@
         if(iMMCHarvesting && aItemsLeft > iMMCHarvestingItemsLeftTemp)
             {
               TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MMC count increasing, restart mount timeout");
+              OstTrace0( TRACE_NORMAL, DUP11_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MMC count increasing, restart mount timeout" );
               
              if(iMountTimer->IsActive())
                 {
@@ -1633,6 +1749,7 @@
         }
    
     TN_DEBUG4( "CThumbAGProcessor::HarvestingUpdated -- end() iHarvesting == %d, iPHHarvesting == %d iMMCHarvesting == %d ", iHarvesting, iPHHarvesting, iMMCHarvesting);
+    OstTraceExt3( TRACE_NORMAL, DUP12_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated;iHarvesting=%u;iPHHarvesting=%u;iMMCHarvesting=%u", iHarvesting, iPHHarvesting, iMMCHarvesting );
     }
 
 // ---------------------------------------------------------------------------
@@ -1642,6 +1759,7 @@
 void CThumbAGProcessor::StartTimeout()
     {
     TN_DEBUG1( "CThumbAGProcessor::StartTimeout()");
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_STARTTIMEOUT, "CThumbAGProcessor::StartTimeout" );
     CancelTimeout();
     
     if(!iHarvesting && !iMPXHarvesting && !iPeriodicTimer->IsActive() && !iShutdown)
@@ -1658,6 +1776,7 @@
 void CThumbAGProcessor::CancelTimeout()
     {
     TN_DEBUG1( "CThumbAGProcessor::CancelTimeout()");
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_CANCELTIMEOUT, "CThumbAGProcessor::CancelTimeout" );
     if(iPeriodicTimer->IsActive())
         {
         iPeriodicTimer->Cancel();
@@ -1675,7 +1794,11 @@
 #endif
     {
     TN_DEBUG2( "CThumbAGrocessor::RunError() %d", aError);
-    
+#ifdef _DEBUG
+    OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_RUNERROR, "CThumbAGProcessor::RunError;aError=%d", aError );
+#else
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_RUNERROR, "CThumbAGProcessor::RunError");
+#endif    
     UpdatePSValues(EFalse, EFalse);
         
     iActiveCount--;
@@ -1697,6 +1820,7 @@
     if(iFormatting)
         {
         TN_DEBUG1( "CThumbAGProcessor::ActivateAO() - FORMATTING - DAEMON ON PAUSE");
+        OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_ACTIVATEAO, "CThumbAGProcessor::ActivateAO - FORMATTING - DAEMON ON PAUSE" );
         return;
         }
     
@@ -1704,6 +1828,7 @@
     if ( (iModifyItemCount > 0 || iDeleteItemCount > 0 ||  iUnknownItemCount > 0) && !iMountTimer->IsActive())
         {
         TN_DEBUG1( "CThumbAGProcessor::ActivateAO() -  forced run");
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_ACTIVATEAO, "CThumbAGProcessor::ActivateAO - iModifyItemCount > 0 || iUnknownItemCount > 0 || iDeleteItemCount > 0" );
         SetForceRun( ETrue );
         }
     else
@@ -1715,6 +1840,7 @@
     if( !IsActive() && !iShutdown && ((iActiveCount < KMaxDaemonRequests && !iQueryActive) || iForceRun ))
         {
         TN_DEBUG1( "CThumbAGProcessor::ActivateAO() - Activated");
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_ACTIVATEAO, "CThumbAGProcessor::ActivateAO - Activated" );
         SetActive();
         TRequestStatus* statusPtr = &iStatus;
         User::RequestComplete( statusPtr, KErrNone );
@@ -1730,6 +1856,7 @@
 TInt CThumbAGProcessor::PeriodicTimerCallBack(TAny* aAny)
     {
     TN_DEBUG1( "CThumbAGProcessor::PeriodicTimerCallBack()");
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_PERIODICTIMERCALLBACK, "CThumbAGProcessor::PeriodicTimerCallBack" );
     CThumbAGProcessor* self = static_cast<CThumbAGProcessor*>( aAny );
     
     self->CancelTimeout();
@@ -1759,22 +1886,31 @@
     // get cenrep values
     TInt ret = rep->Get( KAutoCreateImageGrid, imageGrid );
     TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateImageGrid %d", ret);
+    OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateImageGrid;ret=%d", ret );
     ret = rep->Get( KAutoCreateImageList, imageList );
     TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateImageList %d", ret);
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateImageList;ret=%d", ret );
     ret = rep->Get( KAutoCreateImageFullscreen, imageFull );
     TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateImageFullscreen %d", ret);
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL;ret=%d", ret );
     ret = rep->Get( KAutoCreateVideoGrid, videoGrid );
     TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateVideoGrid %d", ret);
+    OstTrace1( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateVideoGrid;ret=%d", ret );
     ret = rep->Get( KAutoCreateVideoList, videoList );
     TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateVideoList %d", ret);
+    OstTrace1( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateVideoList;ret=%d", ret );
     ret = rep->Get( KAutoCreateVideoFullscreen, videoFull );
     TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateVideoFullscreen %d", ret);
+    OstTrace1( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateVideoFullscreen;ret=%d", ret );
     ret = rep->Get( KAutoCreateAudioGrid, audioGrid );
     TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateAudioGrid %d", ret);
+    OstTrace1( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateAudioGrid;ret=%d", ret );
     ret = rep->Get( KAutoCreateAudioList, audioList );
     TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateAudioList %d", ret);
+    OstTrace1( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateAudioList;ret=%d", ret );
     ret = rep->Get( KAutoCreateAudioFullscreen, audioFull );
     TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateAudioFullscreen %d", ret);
+    OstTrace1( TRACE_NORMAL, DUP8_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateAudioFullscreen;ret=%d", ret );
     
     iAutoImage = EFalse;
     iAutoVideo = EFalse;
@@ -1808,6 +1944,11 @@
 #endif
     {
     TN_DEBUG2( "CThumbAGProcessor::RemoveFromQueues() aRemoveFromDelete == %d - begin", aRemoveFromDelete );
+#ifdef _DEBUG
+    OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_REMOVEFROMQUEUES, "CThumbAGProcessor::RemoveFromQueues - aRemoveFromDelete;aRemoveFromDelete=%d", aRemoveFromDelete );
+#else
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_REMOVEFROMQUEUES, "CThumbAGProcessor::RemoveFromQueues - aRemoveFromDelete" );
+#endif
     
     TInt itemIndex(KErrNotFound);
     
@@ -1816,6 +1957,7 @@
         TThumbnailGenerationItem item;
         item.iItemId = aIDArray[i];
         TN_DEBUG2( "CThumbAGProcessor::RemoveFromQueues() - %d", aIDArray[i]);
+        OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_REMOVEFROMQUEUES, "CThumbAGProcessor::RemoveFromQueues;aIDArray[i]=%u", aIDArray[i] );
 
         itemIndex = iGenerationQueue.FindInOrder(item, Compare);                        
         if(itemIndex >= 0)
@@ -1824,6 +1966,7 @@
             iGenerationQueue[itemIndex].iUri = NULL;
             iGenerationQueue.Remove(itemIndex);
             TN_DEBUG1( "CThumbAGProcessor::RemoveFromQueues() - iGenerationQueue" );
+            OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_REMOVEFROMQUEUES, "CThumbAGProcessor::RemoveFromQueues - iGenerationQueue" );
             }
                 
         itemIndex = iQueryQueue.FindInOrder(aIDArray[i], CompareId);                    
@@ -1831,12 +1974,14 @@
             {
             iQueryQueue.Remove(itemIndex);
             TN_DEBUG1( "CThumbAGProcessor::RemoveFromQueues() - iQueryQueue" );
+            OstTrace0( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_REMOVEFROMQUEUES, "CThumbAGProcessor::RemoveFromQueues - iQueryQueue" );
             }
         }
     
     ActivateAO();
     
     TN_DEBUG1( "CThumbAGProcessor::RemoveFromQueues() - end" );
+    OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_REMOVEFROMQUEUES, "CThumbAGProcessor::RemoveFromQueues - end" );
     }
 	
 // ---------------------------------------------------------------------------
@@ -1846,6 +1991,7 @@
 void CThumbAGProcessor::SetForceRun( const TBool aForceRun)
     {
     TN_DEBUG2( "CThumbAGProcessor::SetForceRun(%d) - end", aForceRun ); 
+    OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_SETFORCERUN, "CThumbAGProcessor::SetForceRun - end;aForceRun=%u", aForceRun );
 
     // enable forced run
     iForceRun = aForceRun;
@@ -1858,6 +2004,7 @@
 void CThumbAGProcessor::QueryAllItemsL()
     {
     TN_DEBUG1( "CThumbAGProcessor::QueryAllItemsL" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_QUERYALLITEMSL, "CThumbAGProcessor::QueryAllItemsL" );
     
     __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::QueryAllItemsL() !iMdeSession "), KErrBadHandle));
     
@@ -1871,6 +2018,7 @@
         if( !iQueryAllItems->IsComplete() )
             {
             TN_DEBUG1( "CThumbAGProcessor::QueryAllItemsL active- skip" );
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_QUERYALLITEMSL, "CThumbAGProcessor::QueryAllItemsL - active- skip" );
             return;
             }
         
@@ -1881,6 +2029,7 @@
         }
     
     TN_DEBUG1( "CThumbAGProcessor::QueryAllItemsL - start" );
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_QUERYALLITEMSL, "CThumbAGProcessor::QueryAllItemsL -start" );
     
     CMdEObjectDef& imageObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Image::KImageObject );
     CMdEObjectDef& videoObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Video::KVideoObject );
@@ -1908,6 +2057,7 @@
 	CleanupStack::Pop(3, &imageObjectCondition);
     
     TN_DEBUG1( "CThumbAGProcessor::QueryAllItemsL - end" );
+    OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_QUERYALLITEMSL, "CThumbAGProcessor::QueryAllItemsL" );
     }
 
 // -----------------------------------------------------------------------------
@@ -1926,6 +2076,7 @@
     TMPXMessageId generalId( *aMessage->Value<TMPXMessageId>( KMPXMessageGeneralId ) );
     
     TN_DEBUG2( "CThumbAGProcessor::HandleCollectionMessage KMPXMessageGeneralId=%d", generalId);
+    OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_HANDLECOLLECTIONMESSAGE, "CThumbAGProcessor::HandleCollectionMessage - KMPXMessageGeneralId;generalId=%u", generalId );
 
 	//we are interestead of only general system events
     if ( generalId == KMPXMessageGeneral )
@@ -1933,6 +2084,7 @@
         TInt event( *aMessage->Value<TInt>( KMPXMessageGeneralEvent ) );
         TInt op( *aMessage->Value<TInt>( KMPXMessageGeneralType ) );
         TN_DEBUG3( "CThumbAGProcessor::HandleCollectionMessage KMPXMessageGeneralEvent=%d", event, op);
+        OstTraceExt2( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_HANDLECOLLECTIONMESSAGE, "CThumbAGProcessor::HandleCollectionMessage - KMPXMessageGeneralEvent;event=%d;op=%d", event, op );
         if ( event == TMPXCollectionMessage::EBroadcastEvent )
             {
             switch( op )
@@ -1941,6 +2093,7 @@
                 case EMcMsgRefreshStart:
                 case EMcMsgUSBMTPStart:
                     TN_DEBUG1("CThumbAGProcessor::HandleCollectionMessage MPX refresh started" );
+                    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_HANDLECOLLECTIONMESSAGE, "CThumbAGProcessor::HandleCollectionMessage - MPX refresh started" );
                     iMPXHarvesting = ETrue;
                     CancelTimeout();
                     break;
@@ -1949,6 +2102,7 @@
                 case EMcMsgUSBMTPEnd:
                 case EMcMsgUSBMTPNotActive:
                     TN_DEBUG1("CThumbAGProcessor::HandleCollectionMessage MPX refresh finished/not active" );
+                    OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_HANDLECOLLECTIONMESSAGE, "CThumbAGProcessor::HandleCollectionMessage - MPX refresh finished/not active" );
                     iMPXHarvesting = EFalse;
                     StartTimeout();
                     break;
@@ -1967,6 +2121,7 @@
                 }
                 
             TN_DEBUG3( "CThumbAGProcessor::HandleCollectionMessage -- end() iHarvesting == %d, iMPXHarvesting == %d", iHarvesting, iMPXHarvesting);
+            OstTraceExt2( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_HANDLECOLLECTIONMESSAGE, "CThumbAGProcessor::HandleCollectionMessage - end;iHarvesting=%u;iMPXHarvesting=%u", iHarvesting, iMPXHarvesting );
             }
         }
     }
@@ -2012,6 +2167,7 @@
 void CThumbAGProcessor::ActivityChanged(const TBool aActive)
     {
     TN_DEBUG2( "void CThumbAGProcessor::ActivityChanged() aActive == %d", aActive);
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_ACTIVITYCHANGED, "CThumbAGProcessor::ActivityChanged" );
     if(aActive)
         {
         iIdle = EFalse;
@@ -2036,6 +2192,7 @@
 void CThumbAGProcessor::FormatNotification( TBool aFormat )
     {
     TN_DEBUG2( "CThumbAGProcessor::FormatNotification(%d)", aFormat );
+    OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_FORMATNOTIFICATION, "CThumbAGProcessor::FormatNotification;aFormat=%u", aFormat );
     
     iFormatting = aFormat;
     
@@ -2055,6 +2212,7 @@
 void CThumbAGProcessor::RPropertyNotification(const TInt aError, const TUid aKeyCategory, const TUint aPropertyKey, const TInt aValue)
     {
     TN_DEBUG5( "CThumbAGProcessor::RPropertyNotification() aError = %d, aPropertyKey = %d, aKeyCategory = %d, aValue = %d", aError, aPropertyKey, aKeyCategory, aValue );
+    OstTraceExt2( TRACE_NORMAL, CTHUMBAGPROCESSOR_RPROPERTYNOTIFICATION, "CThumbAGProcessor::RPropertyNotification;aPropertyKey=%u;aValue=%d", aPropertyKey, aValue );
     
     if(aPropertyKey == KForceBackgroundGeneration && aKeyCategory == KTAGDPSNotification )
         {
@@ -2094,6 +2252,7 @@
         if( ret != KErrNone )
             {
             TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() define KDaemonProcessing ret = %d", ret);
+            OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues - define KDaemonProcessing;ret=%d", ret );
             }
 
         ret = RProperty::Define(KTAGDPSNotification, KItemsleft, RProperty::EInt);
@@ -2101,6 +2260,7 @@
         if( ret != KErrNone )
             {
             TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() define KItemsleft ret = %d", ret);
+            OstTrace1( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues - define KItemsleft;ret=%d", ret );
             }
         }
     
@@ -2122,6 +2282,7 @@
            }
        
        TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() KItemsleft == %d", itemsLeft);
+       OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues;itemsLeft=%d", itemsLeft );
            
        //cancel 2nd round generarion when there is items in 1st round queues
        if(iAddItemCount && i2ndRound)
@@ -2142,26 +2303,32 @@
         if( daemonProcessing != iPreviousDaemonProcessing)
             {
             TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() update KDaemonProcessing == %d", daemonProcessing);
+            OstTrace1( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues - update KDaemonProcessing;daemonProcessing=%u", daemonProcessing );
             iPreviousDaemonProcessing = daemonProcessing;
             TInt ret = RProperty::Set(KTAGDPSNotification, KDaemonProcessing, daemonProcessing);
             
             if(ret != KErrNone )
                 {
                 TN_DEBUG3( "CThumbAGProcessor::UpdatePSValues() set KDaemonProcessing %d failed %d", daemonProcessing, ret);
+                OstTraceExt2( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues - set KDaemonProcessing;daemonProcessing=%u;ret=%d", daemonProcessing, ret );
                 }
             }
         
+        TInt ret = RProperty::Get(KTAGDPSNotification, KItemsleft, iPreviousItemsLeft );
         TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() iPreviousItemsLeft == %d", iPreviousItemsLeft);
+        OstTrace1( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues;iPreviousItemsLeft=%d", iPreviousItemsLeft );
         
         if( itemsLeft != iPreviousItemsLeft)
             {
             TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() Set KItemsleft == %d", itemsLeft);
+            OstTrace1( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues - Set KItemsleft;itemsLeft=%d", itemsLeft );
             iPreviousItemsLeft = itemsLeft;
             TInt ret = RProperty::Set(KTAGDPSNotification, KItemsleft, itemsLeft );
             
             if(ret != KErrNone )
                 {
                 TN_DEBUG3( "CThumbAGProcessor::UpdatePSValues() set KItemsleft %d failed %d", itemsLeft, ret);
+                OstTraceExt2( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues - set KItemsleft failed;itemsLeft=%d;ret=%d", itemsLeft, ret );
                 }
             }
         
@@ -2186,6 +2353,7 @@
 void CThumbAGProcessor::UpdateItemCounts()
     {
     TN_DEBUG1( "CThumbAGProcessor::UpdateItemCounts()");
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts" );
     iModifyItemCount = 0;
     iDeleteItemCount = 0;
     iAddItemCount = 0;
@@ -2247,24 +2415,43 @@
     
     TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iActiveCount = %d", 
             iActiveCount);
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts - iActiveCount;iActiveCount=%u", iActiveCount );
     TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iPreviousItemsLeft = %d", 
             iPreviousItemsLeft);
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iPreviousItemsLeft=%d", iPreviousItemsLeft );
     TN_DEBUG5( "CThumbAGProcessor::UpdateItemCounts() iHarvesting == %d, iMMCHarvesting == %d, iPHHarvesting == %d, iMPXHarvesting == %d", 
             iHarvesting, iMMCHarvesting, iPHHarvesting, iMPXHarvesting);
+    OstTraceExt4( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iHarvesting=%d;iMMCHarvesting=%d;iPHHarvesting=%d;iMPXHarvesting=%d", 
+            iHarvesting, iMMCHarvesting, iPHHarvesting, iMPXHarvesting );
+
     TN_DEBUG5( "CThumbAGProcessor::UpdateItemCounts() iIdle = %d, iForegroundRun = %d, timer = %d, iForceRun = %d", 
             iIdle, iForegroundRun, iPeriodicTimer->IsActive(), iForceRun);
+    OstTraceExt4( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iIdle=%d;iForegroundRun=%d;iPeriodicTimer->IsActive()=%d;iForceRun=%d", 
+            iIdle, iForegroundRun, iPeriodicTimer->IsActive(), iForceRun );
+			
     TN_DEBUG4( "CThumbAGProcessor::UpdateItemCounts() iModify = %d, iQueryReady = %d, iProcessingCount = %d", 
             iModify, iQueryReady, iProcessingCount);
+    OstTraceExt2( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iModify=%u;iQueryReady=%u", 
+            iModify, iQueryReady );
+    OstTrace1( TRACE_NORMAL, DUP12_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iProcessingCount=%u", iProcessingCount );
     TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iMountTimer = %d", iMountTimer->IsActive());
+    OstTrace1( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iMountTimer->IsActive()=%u", iMountTimer->IsActive() );
     TN_DEBUG3( "CThumbAGProcessor::UpdateItemCounts() iGenerationQueue = %d, iQueryQueue = %d", 
             iGenerationQueue.Count(), iQueryQueue.Count());
+    OstTraceExt2( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iGenerationQueue.Count()=%d;iQueryQueue.Count()=%d", iGenerationQueue.Count(), iQueryQueue.Count() );
     TN_DEBUG5( "CThumbAGProcessor::UpdateItemCounts() iAddItemCount=%d, i2ndAddItemCount=%d, iModifyItemCount=%d, iDeleteItemCount=%d",
             iAddItemCount, i2ndAddItemCount, iModifyItemCount, iDeleteItemCount );
+    OstTrace0( TRACE_NORMAL, DUP8_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts" );
     TN_DEBUG3( "CThumbAGProcessor::UpdateItemCounts() iUnknownItemCount=%d, iPlaceholderItemCount=%d",
             iUnknownItemCount, iPlaceholderItemCount);
+    OstTraceExt2( TRACE_NORMAL, DUP9_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iUnknownItemCount=%d;iPlaceholderItemCount=%d", iUnknownItemCount, iPlaceholderItemCount );
     TN_DEBUG4( "CThumbAGProcessor::UpdateItemCounts() iAudioItemCount=%d, iVideoItemCount=%d, iImageItemCount=%d",
             iAudioItemCount, iVideoItemCount, iImageItemCount);
+    OstTraceExt3( TRACE_NORMAL, DUP10_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iAudioItemCount=%u;iVideoItemCount=%d;iImageItemCount=%d", 
+            iAudioItemCount, iVideoItemCount, iImageItemCount );
+			
     TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iCameraItemCount=%d", iCameraItemCount);
+    OstTrace1( TRACE_NORMAL, DUP11_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iCameraItemCount=%d", iCameraItemCount );
     
     //compress queues when empty
     if(!iGenerationQueue.Count())
@@ -2286,6 +2473,7 @@
 TInt CThumbAGProcessor::MountTimerCallBack(TAny* aAny)
     {
     TN_DEBUG1( "CThumbAGProcessor::MountTimerCallBack()");
+    OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_MOUNTTIMERCALLBACK, "CThumbAGProcessor::MountTimerCallBack" );
     CThumbAGProcessor* self = static_cast<CThumbAGProcessor*>( aAny );
     
     self->iMountTimer->Cancel();
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagvideoobserver.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagvideoobserver.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -28,6 +28,11 @@
 #include "thumbnaillog.h"
 #include "thumbnailmanagerconstants.h"
 #include "thumbnailmanagerprivatecrkeys.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbagvideoobserverTraces.h"
+#endif
+
 
 
 // ---------------------------------------------------------------------------
@@ -51,6 +56,7 @@
 CThumbAGVideoObserver* CThumbAGVideoObserver::NewL(CThumbAGProcessor* aProcessor)
 	{
 	TN_DEBUG1( "CThumbAGVideoObserver::NewL() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGVIDEOOBSERVER_NEWL, "CThumbAGVideoObserver::NewL" );
     
 	CThumbAGVideoObserver* self = CThumbAGVideoObserver::NewLC(aProcessor);
 	CleanupStack::Pop( self );
@@ -74,6 +80,7 @@
 void CThumbAGVideoObserver::ConstructL()
 	{
 	TN_DEBUG1( "CThumbAGVideoObserver::ConstructL() - begin" );
+	OstTrace0( TRACE_NORMAL, CTHUMBAGVIDEOOBSERVER_CONSTRUCTL, "CThumbAGVideoObserver::ConstructL - begin" );
 	
 #ifdef _DEBUG
     iAddCounter = 0;
@@ -83,6 +90,7 @@
     InitializeL();
     	
 	TN_DEBUG1( "CThumbAGVideoObserver::ConstructL() - end" );
+	OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGVIDEOOBSERVER_CONSTRUCTL, "CThumbAGVideoObserver::ConstructL - end" );
 	}
 
 // ---------------------------------------------------------------------------
@@ -92,9 +100,11 @@
 void CThumbAGVideoObserver::InitializeL()
     {
     TN_DEBUG1( "CThumbAGVideoObserver::InitializeL() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGVIDEOOBSERVER_INITIALIZEL, "CThumbAGVideoObserver::InitializeL - begin" );
     
    
         TN_DEBUG1( "CThumbAGVideoObserver::InitializeL() - create observers" );
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGVIDEOOBSERVER_INITIALIZEL, "CThumbAGVideoObserver::InitializeL - create observers" );
         
         // create shutdown observer
         if(iMDSShutdownObserver)
@@ -119,6 +129,7 @@
             }
         
         TN_DEBUG1( "CThumbAGVideoObserver::InitializeL() - connect to MDS" );
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGVIDEOOBSERVER_INITIALIZEL, "CThumbAGVideoObserver::InitializeL - connect to MDS" );
         
         if(iMdESession)
             {
@@ -134,6 +145,7 @@
         iSessionError = EFalse;
       
         TN_DEBUG1( "CThumbAGVideoObserver::InitializeL() - end" );
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGVIDEOOBSERVER_INITIALIZEL, "CThumbAGVideoObserver::InitializeL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -143,6 +155,7 @@
 CThumbAGVideoObserver::~CThumbAGVideoObserver()
     {
     TN_DEBUG1( "CThumbAGVideoObserver::~CThumbAGVideoObserver() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGVIDEOOBSERVER_CTHUMBAGVIDEOOBSERVER, "CThumbAGVideoObserver::~CThumbAGVideoObserver - begin" );
     
     iShutdown = ETrue;    
     
@@ -167,6 +180,7 @@
         }
     
     TN_DEBUG1( "CThumbAGVideoObserver::~CThumbAGVideoObserver() - end" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGVIDEOOBSERVER_CTHUMBAGVIDEOOBSERVER, "CThumbAGVideoObserver::~CThumbAGVideoObserver - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -176,6 +190,7 @@
 void CThumbAGVideoObserver::HandleSessionOpened( CMdESession& /* aSession */, TInt aError )
     {
     TN_DEBUG1( "CThumbAGVideoObserver::HandleSessionOpened");
+    OstTrace0( TRACE_NORMAL, CTHUMBAGVIDEOOBSERVER_HANDLESESSIONOPENED, "CThumbAGVideoObserver::HandleSessionOpened" );
     
     if (aError == KErrNone)
         {
@@ -183,11 +198,13 @@
         if (err != KErrNone)
             {
             TN_DEBUG2( "CThumbAGVideoObserver::HandleSessionOpened, AddObserversL error == %d", err );
+            OstTrace1( TRACE_NORMAL, DUP1_CTHUMBAGVIDEOOBSERVER_HANDLESESSIONOPENED, "CThumbAGVideoObserver::HandleSessionOpened - AddObserversL;err=%d", err );
             }
         }
     else
         {
         TN_DEBUG2( "CThumbAGVideoObserver::HandleSessionOpened error == %d", aError );
+        OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGVIDEOOBSERVER_HANDLESESSIONOPENED, "CThumbAGVideoObserver::HandleSessionOpened;aError=%d", aError );
         }
     }
 
@@ -198,6 +215,7 @@
 void CThumbAGVideoObserver::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
     {
     TN_DEBUG2( "CThumbAGVideoObserver::HandleSessionError == %d", aError );
+    OstTrace1( TRACE_NORMAL, CTHUMBAGVIDEOOBSERVER_HANDLESESSIONERROR, "CThumbAGVideoObserver::HandleSessionError;aError=%d", aError );
     if (aError != KErrNone && !iSessionError)
         {
         iSessionError = ETrue;
@@ -210,6 +228,7 @@
                                    TCallBack(ReconnectCallBack, this));
                 
                 TN_DEBUG1( "CThumbAGVideoObserver::HandleSessionError() - reconnect timer started" );
+                OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGVIDEOOBSERVER_HANDLESESSIONERROR, "CThumbAGVideoObserver::HandleSessionError - reconnect timer started" );
                 }
             }
 
@@ -225,6 +244,7 @@
                                                const RArray<TItemId>& aObjectIdArray )
     {
     TN_DEBUG1( "CThumbAGVideoObserver::HandleObjectNotification() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGVIDEOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGVideoObserver::HandleObjectNotification - begin" );
 
     // no processor or shutting down
     if ( iShutdown || !iProcessor)
@@ -236,11 +256,13 @@
     if (aType == ENotifyAdd)
         {
         TN_DEBUG2( "CThumbAGVideoObserver::HandleObjectNotification() - ENotifyAdd %d", aObjectIdArray.Count() );
+        OstTrace1( TRACE_NORMAL, DUP1_CTHUMBAGVIDEOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGVideoObserver::HandleObjectNotification - ENotifyAdd;aObjectIdArray.Count()=%d", aObjectIdArray.Count() );
         iAddCounter = aObjectIdArray.Count();
         }
     else if (aType == ENotifyModify)
         {
         TN_DEBUG2( "CThumbAGVideoObserver::HandleObjectNotification() - ENotifyModify %d", aObjectIdArray.Count() );
+        OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGVIDEOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGVideoObserver::HandleObjectNotification - ENotifyModify;aObjectIdArray.Count()=%d", aObjectIdArray.Count() );
         iModCounter = aObjectIdArray.Count();
         }
 #endif
@@ -248,6 +270,7 @@
     if ( (aType == ENotifyAdd || aType == ENotifyModify ) && (aObjectIdArray.Count() > 0) )
         {
         TN_DEBUG1( "CThumbAGVideoObserver::HandleObjectNotification() - AddToQueueL" );
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGVIDEOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGVideoObserver::HandleObjectNotification - AddToQueueL" );
 
         // Add event to processing queue by type and enable force run        
         RPointerArray<HBufC> dummyArray;
@@ -255,20 +278,24 @@
         if (err != KErrNone)
             {
             TN_DEBUG1( "CThumbAGVideoObserver::HandleObjectNotification() - error adding to queue" );
+            OstTrace0( TRACE_NORMAL, DUP4_CTHUMBAGVIDEOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGVideoObserver::HandleObjectNotification - error adding to queue" );
             }
         }
     else
         {
         TN_DEBUG1( "CThumbAGVideoObserver::HandleObjectNotification() - bad notification" );
+        OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGVIDEOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGVideoObserver::HandleObjectNotification - bad notification" );
         }
     
 #ifdef _DEBUG
     TN_DEBUG3( "CThumbAGVideoObserver::IN-COUNTERS---------- Add = %d Modify = %d", iAddCounter, iModCounter );
+    OstTraceExt2( TRACE_NORMAL, DUP6_CTHUMBAGVIDEOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGVideoObserver::IN-COUNTERS---------- Add = %u Modify = %u", iAddCounter, iModCounter );
     iModCounter = 0;
     iAddCounter = 0;
 #endif
 
     TN_DEBUG1( "CThumbAGVideoObserver::HandleObjectNotification() - end" );
+    OstTrace0( TRACE_NORMAL, DUP7_CTHUMBAGVIDEOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGVideoObserver::HandleObjectNotification - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -278,10 +305,12 @@
 void CThumbAGVideoObserver::ShutdownNotification()
     {
     TN_DEBUG1( "CThumbAGVideoObserver::ShutdownNotification()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGVIDEOOBSERVER_SHUTDOWNNOTIFICATION, "CThumbAGVideoObserver::ShutdownNotification" );
     
     if (!iShutdown)
         {
         TN_DEBUG1( "CThumbAGVideoObserver::ShutdownNotification() shutdown" );
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGVIDEOOBSERVER_SHUTDOWNNOTIFICATION, "CThumbAGVideoObserver::ShutdownNotification - shutdown" );
         iShutdown = ETrue;
         }
     }
@@ -293,6 +322,7 @@
 void CThumbAGVideoObserver::AddObserversL()
     {
     TN_DEBUG1( "CThumbAGVideoObserver::AddObserversL() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBAGVIDEOOBSERVER_ADDOBSERVERSL, "CThumbAGVideoObserver::AddObserversL - begin" );
     
     CMdENamespaceDef& defaultNamespace = iMdESession->GetDefaultNamespaceDefL();
     CMdEObjectDef& objectDef = defaultNamespace.GetObjectDefL( MdeConstants::Object::KBaseObject );
@@ -324,6 +354,7 @@
 	CleanupStack::Pop( 6, addCondition );
      
     TN_DEBUG1( "CThumbAGVideoObserver::AddObserversL() - end" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGVIDEOOBSERVER_ADDOBSERVERSL, "CThumbAGVideoObserver::AddObserversL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -333,6 +364,7 @@
 TInt CThumbAGVideoObserver::ReconnectCallBack(TAny* aAny)
     {
     TN_DEBUG1( "CThumbAGVideoObserver::ReconnectCallBack() - reinitialize");
+    OstTrace0( TRACE_NORMAL, CTHUMBAGVIDEOOBSERVER_RECONNECTCALLBACK, "CThumbAGVideoObserver::ReconnectCallBack - reinitialize" );
     
     CThumbAGVideoObserver* self = static_cast<CThumbAGVideoObserver*>( aAny );
     
@@ -342,6 +374,7 @@
     TRAP_IGNORE( self->InitializeL() );
     
     TN_DEBUG1( "CThumbAGVideoObserver::ReconnectCallBack() - done");
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGVIDEOOBSERVER_RECONNECTCALLBACK, "CThumbAGVideoObserver::ReconnectCallBack - done" );
     
     return KErrNone;
     }
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/group/thumbnailmanager.mmp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/group/thumbnailmanager.mmp	Mon Aug 23 13:32:17 2010 +0300
@@ -42,7 +42,7 @@
 MW_LAYER_SYSTEMINCLUDE
 
 USERINCLUDE             ../inc
-USERINCLUDE             ../../inc
+USERINCLUDE             ../../inc ../traces
 
 LIBRARY                 fbscli.lib
 LIBRARY                 euser.lib
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/inc/thumbnailrequestactive.h	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/inc/thumbnailrequestactive.h	Mon Aug 23 13:32:17 2010 +0300
@@ -95,7 +95,7 @@
      *                    ThumbnailReady callback.
      * @param aTargetUri         Target URI to which the imported thumbnail is linked.
      */
-    void GetThumbnailL( const RFile64& aFile, TThumbnailId aThumbnailId,
+    void GetThumbnailL( const RFile64& aFile, TThumbnailId aThumbnailId, const TDesC8& aMimeType,
         CThumbnailManager::TThumbnailFlags aFlags, CThumbnailManager::TThumbnailQualityPreference
         aQualityPreference, const TSize& aSize, const TDisplayMode aDisplayMode,
         const TInt aPriority, TAny* aClientData, TBool aGeneratePersistentSizesOnly, const TDesC& aTargetUri = KNullDesC,
@@ -117,7 +117,7 @@
      *                    ThumbnailReady callback.
      * @param aTargetUri         Target URI to which the imported thumbnail is linked.
      */
-    void GetThumbnailL( TThumbnailId aThumbnailId, const TDesC& aPath,
+    void GetThumbnailL( TThumbnailId aThumbnailId, const TDesC& aPath, const TDesC8& aMimeType,
         CThumbnailManager::TThumbnailFlags aFlags, CThumbnailManager::TThumbnailQualityPreference
         aQualityPreference, const TSize& aSize, const TDisplayMode aDisplayMode,
         const TInt aPriority, TAny* aClientData, TBool aGeneratePersistentSizesOnly, const TDesC& aTargetUri = KNullDesC,
@@ -142,7 +142,7 @@
      * @param aThumbnailSize Relative thumbnail size
      */
     void GetThumbnailL( const TDesC& aPath, TThumbnailId aThumbnailId,
-        CThumbnailManager::TThumbnailFlags aFlags, 
+        const TDesC8& aMimeType, CThumbnailManager::TThumbnailFlags aFlags, 
         CThumbnailManager::TThumbnailQualityPreference aQualityPreference, 
         const TSize& aSize, const TDisplayMode aDisplayMode, const TInt aPriority, 
         TAny* aClientData, TBool aGeneratePersistentSizesOnly, 
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnaildataimpl.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnaildataimpl.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -19,6 +19,10 @@
 #include <fbs.h>
 
 #include "thumbnaildataimpl.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnaildataimplTraces.h"
+#endif
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -29,6 +33,7 @@
 //
 CThumbnailDataImpl::CThumbnailDataImpl()
     {
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILDATAIMPL_CTHUMBNAILDATAIMPL, "CThumbnailDataImpl::CThumbnailDataImpl" );
     // No implementation required
     }
 
@@ -40,6 +45,7 @@
 //
 CThumbnailDataImpl::~CThumbnailDataImpl()
     {
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILDATAIMPL_CTHUMBNAILDATAIMPL, "CThumbnailDataImpl::~CThumbnailDataImpl" );
     delete iBitmap;
     iBitmap = NULL;
     iClientData = NULL;
@@ -53,6 +59,7 @@
 //
 CFbsBitmap* CThumbnailDataImpl::Bitmap()
     {
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILDATAIMPL_BITMAP, "CThumbnailDataImpl::Bitmap" );
     return iBitmap;
     }
 
@@ -64,6 +71,7 @@
 //
 CFbsBitmap* CThumbnailDataImpl::DetachBitmap()
     {
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILDATAIMPL_DETACHBITMAP, "CThumbnailDataImpl::DetachBitmap" );
     CFbsBitmap* ret = iBitmap;
     iBitmap = NULL; // client owns it now
     return ret;
@@ -77,6 +85,7 @@
 //
 TAny* CThumbnailDataImpl::ClientData()
     {
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILDATAIMPL_CLIENTDATA, "CThumbnailDataImpl::ClientData" );
     return iClientData;
     }
 
@@ -88,6 +97,7 @@
 //
 void CThumbnailDataImpl::Set( CFbsBitmap* aBitmap, TAny* aClientData )
     {
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILDATAIMPL_SET, "CThumbnailDataImpl::Set" );
     delete iBitmap;
     iBitmap = aBitmap;
     iClientData = aClientData;
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailmanagerimpl.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailmanagerimpl.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -33,6 +33,10 @@
 #include "thumbnailpanic.h"
 
 #include "thumbnaildata.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailmanagerimplTraces.h"
+#endif
 
 
 const TInt KThumbnailMimeTypeListGranularity = 8;
@@ -48,6 +52,7 @@
 CThumbnailManagerImpl::~CThumbnailManagerImpl()
     {
     TN_DEBUG1( "CThumbnailManagerImpl::~CThumbnailManagerImpl() - start" );
+	OstTrace0( TRACE_NORMAL, CTHUMBNAILMANAGERIMPL_CTHUMBNAILMANAGERIMPL, "CThumbnailManagerImpl::~CThumbnailManagerImpl - start" );
 	
     delete iRequestQueue;  
     iRequestQueue = NULL;
@@ -62,9 +67,11 @@
         if( --sessionCount == 0 )
             {
 		    TN_DEBUG1( "CThumbnailManagerImpl::~CThumbnailManagerImpl() - Disconnect FBS" );
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILMANAGERIMPL_CTHUMBNAILMANAGERIMPL, "CThumbnailManagerImpl::~CThumbnailManagerImpl - Disconnect FBS" );
             iFbsSession.Disconnect();
             }
 	    TN_DEBUG2( "CThumbnailManagerImpl::~CThumbnailManagerImpl() - update sessionCount == %d to TLS", sessionCount );
+        OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILMANAGERIMPL_CTHUMBNAILMANAGERIMPL, "CThumbnailManagerImpl::~CThumbnailManagerImpl - update sessionCount == %d to TLS", sessionCount );
         Dll::SetTls( (TAny*)sessionCount );
         }
 
@@ -72,6 +79,7 @@
     iMimeTypeList = NULL;
 	
 	TN_DEBUG1( "CThumbnailManagerImpl::~CThumbnailManagerImpl() - end" );
+    OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILMANAGERIMPL_CTHUMBNAILMANAGERIMPL, "CThumbnailManagerImpl::~CThumbnailManagerImpl - end" );
     }
 
 
@@ -102,6 +110,7 @@
     {
     // No implementation required
     TN_DEBUG1( "CThumbnailManagerImpl::CThumbnailManagerImpl()" );
+    OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILMANAGERIMPL_CTHUMBNAILMANAGERIMPL, "CThumbnailManagerImpl::CThumbnailManagerImpl" );
     }
 
 
@@ -113,6 +122,7 @@
 void CThumbnailManagerImpl::ConstructL()
     {
     TN_DEBUG1( "CThumbnailManagerImpl::ConstructL - start");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILMANAGERIMPL_CONSTRUCTL, "CThumbnailManagerImpl::ConstructL - start" );
     
     User::LeaveIfError( iSession.Connect());
     User::LeaveIfError( iFs.Connect());
@@ -125,6 +135,7 @@
         User::LeaveIfError( iFbsSession.Connect()); 
         Dll::SetTls( (TAny*)1 ); 
         TN_DEBUG2( "CThumbnailManagerImpl::ConstructL() - update sessionCount == %d to TLS", 1 );
+        OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILMANAGERIMPL_CONSTRUCTL, "CThumbnailManagerImpl::ConstructL - update sessionCount == %d to TLS", 1 );
         }
     else
         {
@@ -134,12 +145,14 @@
             // Increase the reference count in TLS
             Dll::SetTls( (TAny*)sessionCount );
             TN_DEBUG2( "CThumbnailManagerImpl::ConstructL() - update sessionCount == %d to TLS", sessionCount );
+            OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILMANAGERIMPL_CONSTRUCTL, "CThumbnailManagerImpl::ConstructL - update sessionCount == %d to TLS", sessionCount );
             } 
         else
             {
             // Fbs connection was available in the beginning, no need to
             // increase the reference count
             TN_DEBUG1( "CThumbnailManagerImpl::ConstructL - no need to update sessionCount");
+            OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILMANAGERIMPL_CONSTRUCTL, "CThumbnailManagerImpl::ConstructL - no need to update sessionCount" );
             }
         }
     
@@ -147,6 +160,7 @@
     iRequestQueue = CThumbnailRequestQueue::NewL();
     
     TN_DEBUG1( "CThumbnailManagerImpl::ConstructL - end");
+    OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILMANAGERIMPL_CONSTRUCTL, "CThumbnailManagerImpl::ConstructL - end" );
     }
 
 
@@ -161,6 +175,7 @@
     {
     iRequestId++;
     TN_DEBUG4( "CThumbnailManagerImpl::GetThumbnailL() URI==%S, iThumbnailSize==%d, req %d", &aObjectSource.Uri(), iThumbnailSize, iRequestId );
+    OstTraceExt3( TRACE_NORMAL, CTHUMBNAILMANAGERIMPL_GETTHUMBNAILL, "CThumbnailManagerImpl::GetThumbnailL;aObjectSource.Uri()=%S;iThumbnailSize=%d;iRequestId=%d", aObjectSource.Uri(), iThumbnailSize, iRequestId );
     
     __ASSERT_DEBUG(( iRequestId > 0 ), ThumbnailPanic( EThumbnailWrongId ));
 
@@ -172,21 +187,21 @@
     
     if(aObjectSource.Id() > 0)
         {
-        getThumbnailActive->GetThumbnailL( aObjectSource.Uri(), aObjectSource.Id(), iFlags,
-            iQualityPreference, iSize, iDisplayMode, priority, aClientData, aGeneratePersistentSizesOnly,
-            KNullDesC, iThumbnailSize);
+        getThumbnailActive->GetThumbnailL( aObjectSource.Uri(), aObjectSource.Id(), 
+            aObjectSource.MimeType(),iFlags, iQualityPreference, iSize, iDisplayMode, 
+            priority, aClientData, aGeneratePersistentSizesOnly, KNullDesC, iThumbnailSize);
         }
     else if ( aObjectSource.Uri().Length())
         {
-        getThumbnailActive->GetThumbnailL( aObjectSource.Uri(), aObjectSource.Id(), iFlags,
-            iQualityPreference, iSize, iDisplayMode, priority, aClientData, aGeneratePersistentSizesOnly,
-            KNullDesC, iThumbnailSize );
+        getThumbnailActive->GetThumbnailL( aObjectSource.Uri(), aObjectSource.Id(),
+            aObjectSource.MimeType(), iFlags, iQualityPreference, iSize, iDisplayMode, 
+            priority, aClientData, aGeneratePersistentSizesOnly, KNullDesC, iThumbnailSize );
         }
     else
         {
-        getThumbnailActive->GetThumbnailL( aObjectSource.FileHandle(), aObjectSource.Id(), iFlags,
-            iQualityPreference, iSize, iDisplayMode, priority, aClientData, aGeneratePersistentSizesOnly,
-            KNullDesC, iThumbnailSize );
+        getThumbnailActive->GetThumbnailL( aObjectSource.FileHandle(), aObjectSource.Id(), 
+            aObjectSource.MimeType(), iFlags, iQualityPreference, iSize, iDisplayMode, 
+            priority, aClientData, aGeneratePersistentSizesOnly, KNullDesC, iThumbnailSize );
         }
     
     iRequestQueue->AddRequestL( getThumbnailActive );
@@ -195,6 +210,7 @@
     iRequestQueue->Process();
     
     TN_DEBUG2( "CThumbnailManagerImpl::GetThumbnailL() - request ID: %d", iRequestId );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILMANAGERIMPL_GETTHUMBNAILL, "CThumbnailManagerImpl::GetThumbnailL;iRequestId=%u", iRequestId );
     
     return iRequestId;
     }
@@ -222,6 +238,7 @@
     {
     iRequestId++;
     TN_DEBUG4( "CThumbnailManagerImpl::GetThumbnailL() aThumbnailId==%d, iThumbnailSize==%d, req %d", aThumbnailId, iThumbnailSize, iRequestId );
+    OstTraceExt3( TRACE_NORMAL, DUP2_CTHUMBNAILMANAGERIMPL_GETTHUMBNAILL, "CThumbnailManagerImpl::GetThumbnailL;aThumbnailId=%u;iThumbnailSize=%u;iRequestId=%u", aThumbnailId, iThumbnailSize, iRequestId );
 
     __ASSERT_DEBUG(( iRequestId > 0 ), ThumbnailPanic( EThumbnailWrongId ));
 
@@ -231,9 +248,9 @@
         ( iFs, iSession, iObserver, iRequestObserver, iRequestId, priority, iRequestQueue );
     CleanupStack::PushL( getThumbnailActive );
     
-    getThumbnailActive->GetThumbnailL( KNullDesC, aThumbnailId, iFlags,
-                       iQualityPreference, iSize, iDisplayMode, priority, aClientData,
-                       EFalse, KNullDesC, iThumbnailSize );
+    getThumbnailActive->GetThumbnailL( KNullDesC, aThumbnailId, KNullDesC8,
+            iFlags, iQualityPreference, iSize, iDisplayMode, priority, aClientData,
+            EFalse, KNullDesC, iThumbnailSize );
     
     iRequestQueue->AddRequestL( getThumbnailActive );
     CleanupStack::Pop( getThumbnailActive );
@@ -241,6 +258,7 @@
     iRequestQueue->Process();
     
     TN_DEBUG2( "CThumbnailManagerImpl::GetThumbnailL() - request ID: %d", iRequestId );
+    OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILMANAGERIMPL_GETTHUMBNAILL, "CThumbnailManagerImpl::GetThumbnailL;iRequestId=%u", iRequestId );
     
     return iRequestId;
     }
@@ -267,15 +285,15 @@
 
     if ( aObjectSource.Uri().Length())
         {
-        getThumbnailActive->GetThumbnailL( aObjectSource.Uri(), aObjectSource.Id(), iFlags,
-            iQualityPreference, iSize, iDisplayMode, priority, aClientData,
-            EFalse, aTargetUri, iThumbnailSize );
+        getThumbnailActive->GetThumbnailL( aObjectSource.Uri(), aObjectSource.Id(), 
+            aObjectSource.MimeType(), iFlags, iQualityPreference, iSize, iDisplayMode, 
+            priority, aClientData, EFalse, aTargetUri, iThumbnailSize );
         }
     else
         {
         getThumbnailActive->GetThumbnailL( aObjectSource.FileHandle(), aObjectSource.Id(), 
-            iFlags, iQualityPreference, iSize, iDisplayMode, priority, aClientData,
-            EFalse, aTargetUri, iThumbnailSize );
+            aObjectSource.MimeType(), iFlags, iQualityPreference, iSize, iDisplayMode,
+            priority, aClientData, EFalse, aTargetUri, iThumbnailSize );
         }
     
     iRequestQueue->AddRequestL( getThumbnailActive );
@@ -284,6 +302,7 @@
     iRequestQueue->Process();
     
     TN_DEBUG2( "CThumbnailManagerImpl::ImportThumbnailL() - request ID: %d", iRequestId );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILMANAGERIMPL_IMPORTTHUMBNAILL, "CThumbnailManagerImpl::ImportThumbnailL;iRequestId=%u", iRequestId );
     
     return iRequestId;
     }
@@ -338,6 +357,7 @@
     iRequestQueue->Process();
     
     TN_DEBUG2( "CThumbnailManagerImpl::SetThumbnailL() - request ID: %d", iRequestId );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILMANAGERIMPL_SETTHUMBNAILL, "CThumbnailManagerImpl::SetThumbnailL;iRequestId=%u", iRequestId );
     
     return iRequestId;
     }
@@ -352,6 +372,7 @@
 	{
 	TRAPD(err,
 		TN_DEBUG2( "CThumbnailManagerImpl::CreateThumbnails() aObjectSource==%S ", &aObjectSource.Uri() );
+		OstTraceExt1( TRACE_NORMAL, CTHUMBNAILMANAGERIMPL_CREATETHUMBNAILS, "CThumbnailManagerImpl::CreateThumbnails;aObjectSource.Uri()=%S", aObjectSource.Uri() );
 		iRequestId++;
 
 		__ASSERT_DEBUG(( iRequestId > 0 ), ThumbnailPanic( EThumbnailWrongId ));
@@ -374,9 +395,9 @@
 		else if( !aObjectSource.Buffer() )
 			{        
 			getThumbnailActive->GetThumbnailL( aObjectSource.Id(), 
-						 aObjectSource.Uri(), iFlags, iQualityPreference, iSize,
-						 iDisplayMode, priority, NULL, ETrue, aObjectSource.Uri(), 
-						 EUnknownThumbnailSize);      
+						 aObjectSource.Uri(), aObjectSource.MimeType(), iFlags, 
+						 iQualityPreference, iSize, iDisplayMode, priority, NULL, 
+						 ETrue, aObjectSource.Uri(), EUnknownThumbnailSize);      
 			}
 		else
 			{
@@ -394,6 +415,7 @@
 		iRequestQueue->Process();
 		
 		TN_DEBUG2( "CThumbnailManagerImpl::CreateThumbnails() - request ID: %d", iRequestId );
+		OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILMANAGERIMPL_CREATETHUMBNAILS, "CThumbnailManagerImpl::CreateThumbnails;iRequestId=%u", iRequestId );
 	);
 	
 	if( err != KErrNone)
@@ -517,6 +539,7 @@
 	TRAP_IGNORE(
 		iRequestId++;
 		TN_DEBUG2( "CThumbnailManagerImpl::DeleteThumbnails() URI==%S ", &aObjectSource.Uri() );
+		OstTraceExt1( TRACE_NORMAL, CTHUMBNAILMANAGERIMPL_DELETETHUMBNAILS, "CThumbnailManagerImpl::DeleteThumbnails;aObjectSource.Uri()=%S", aObjectSource.Uri() );
 
 		__ASSERT_DEBUG(( iRequestId > 0 ), ThumbnailPanic( EThumbnailWrongId ));
 		
@@ -560,6 +583,7 @@
 	TRAP_IGNORE(
 		iRequestId++;
 		TN_DEBUG2( "CThumbnailManagerImpl::DeleteThumbnails() aItemId==%d ", aItemId );
+		OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILMANAGERIMPL_DELETETHUMBNAILS, "CThumbnailManagerImpl::DeleteThumbnails;aItemId=%u", aItemId );
 		
 		__ASSERT_DEBUG(( iRequestId > 0 ), ThumbnailPanic( EThumbnailWrongId ));
 		
@@ -590,6 +614,7 @@
     __ASSERT_DEBUG(( iRequestId > 0 ), ThumbnailPanic( EThumbnailWrongId ));
     
     TN_DEBUG2( "CThumbnailManagerImpl::CancelRequest() - request ID: %d", aId );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILMANAGERIMPL_CANCELREQUEST, "CThumbnailManagerImpl::CancelRequest;aId=%u", aId );
     
     return iRequestQueue->CancelRequest(aId);
     }
@@ -608,6 +633,7 @@
     TInt priority = ValidatePriority(aNewPriority);
     
     TN_DEBUG2( "CThumbnailManagerImpl::ChangePriority() - request ID: %d", aId );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILMANAGERIMPL_CHANGEPRIORITY, "CThumbnailManagerImpl::ChangePriority;aId=%u", aId );
     
     return iRequestQueue->ChangePriority(aId, priority);
     }
@@ -646,6 +672,7 @@
     {
     iRequestId++;
     TN_DEBUG4( "CThumbnailManagerImpl::UpdateThumbnailsL() URI==%S, aItemId==%d, req %d", &aPath, aItemId, iRequestId); 
+    OstTraceExt3( TRACE_NORMAL, CTHUMBNAILMANAGERIMPL_UPDATETHUMBNAILSL, "CThumbnailManagerImpl::UpdateThumbnailsL;aPath=%S;aItemId=%d;iRequestId=%d", aPath, aItemId, iRequestId );
     
     __ASSERT_DEBUG(( iRequestId > 0 ), ThumbnailPanic( EThumbnailWrongId ));
     
@@ -674,6 +701,7 @@
     {
     iRequestId++;
     TN_DEBUG3( "CThumbnailManagerImpl::RenameThumbnailsL() URI==%S, req %d", &aCurrentPath, iRequestId); 
+     OstTraceExt1( TRACE_NORMAL, CTHUMBNAILMANAGERIMPL_RENAMETHUMBNAILSL, "CThumbnailManagerImpl::RenameThumbnailsL;aCurrentPath=%S", aCurrentPath );
     
     __ASSERT_DEBUG(( iRequestId > 0 ), ThumbnailPanic( EThumbnailWrongId ));
     
@@ -729,11 +757,13 @@
     if (aPriority < CActive::EPriorityIdle)
         {
         TN_DEBUG2( "CThumbnailManagerImpl::ValidatePriority() - priority %d too low for CActive", aPriority );
+        OstTrace1( TRACE_NORMAL, CTHUMBNAILMANAGERIMPL_VALIDATEPRIORITY, "CThumbnailManagerImpl::ValidatePriority  - priority too low for CActive;aPriority=%d", aPriority );
         return CActive::EPriorityIdle;
         }
     else if (aPriority > CActive::EPriorityHigh)
         {
         TN_DEBUG2( "CThumbnailManagerImpl::ValidatePriority() - priority %d too high for CActive", aPriority );
+        OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILMANAGERIMPL_VALIDATEPRIORITY, "CThumbnailManagerImpl::ValidatePriority - priority too high for CActive;aPriority=%d", aPriority );
         return CActive::EPriorityHigh;
         }
     else
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestactive.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestactive.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -31,6 +31,11 @@
 #include "thumbnaillog.h"
 
 #include "thumbnailmanagerimpl.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailrequestactiveTraces.h"
+#endif
+
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -100,6 +105,7 @@
     {
     CActiveScheduler::Add( this );
     TN_DEBUG2( "CThumbnaiRequestActive::CThumbnailRequestActive() AO's priority = %d", Priority());
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_CTHUMBNAILREQUESTACTIVE, "CThumbnailRequestActive::CThumbnailRequestActive - AO's priority;Priority()=%d", Priority() );
     
     iBitmap = NULL;
     iRequestCompleted = EFalse;
@@ -132,6 +138,7 @@
 void CThumbnailRequestActive::StartL()
     {
     TN_DEBUG3( "CThumbnailRequestActive::StartL(0x%08x) reqid = %d", this, iRequestId );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_STARTL, "CThumbnailRequestActive::StartL;iRequestId=%u", iRequestId );
     
     iRequestActive = ETrue;
 
@@ -140,6 +147,8 @@
     stop.UniversalTime();
     TN_DEBUG3( "CThumbnailRequestActive::StartL() req id = %d, queuing time %d ms",
                iParams.iRequestId, (TInt)stop.MicroSecondsFrom(iStartExecTime).Int64()/1000 );
+    OstTraceExt2( TRACE_NORMAL, DUP1_CTHUMBNAILREQUESTACTIVE_STARTL, "CThumbnailRequestActive::StartL - req id = %d, queuing time %d ms",
+               iParams.iRequestId, (TInt)stop.MicroSecondsFrom(iStartExecTime).Int64()/1000 );
 #endif
     
     switch (iRequestType)
@@ -157,11 +166,13 @@
                 iParams.iOriginalControlFlags != EThumbnailGeneratePersistentSizesOnly)
                 {
                 TN_DEBUG1( "CThumbnaiRequestActive::StartL()- custom size request" );
+                OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILREQUESTACTIVE_STARTL, "CThumbnailRequestActive::StartL - custom size request" );
                   
                 iFile.Close();
                 User::LeaveIfError( iFile.Open( iFs, iPath, EFileShareReadersOrWriters ) );  
                 
                 TN_DEBUG2( "CThumbnailRequestActive::StartL() - file handle opened for %S", &iPath );
+                OstTraceExt1( TRACE_NORMAL, DUP3_CTHUMBNAILREQUESTACTIVE_STARTL, "CThumbnailRequestActive::StartL;iPath=%S", iPath );
                 
                 CleanupClosePushL( iFile );
                 
@@ -204,6 +215,7 @@
             User::LeaveIfError( iFile.Open( iFs, iTargetUri, EFileShareReadersOrWriters ) );  
             
             TN_DEBUG2( "CThumbnailRequestActive::StartL() - file handle opened for %S", &iTargetUri );
+            OstTraceExt1( TRACE_NORMAL, DUP4_CTHUMBNAILREQUESTACTIVE_STARTL, "CThumbnailRequestActive::StartL - file handle opened;iTargetUri=%S", iTargetUri );
             
             CleanupClosePushL( iFile );
             
@@ -244,6 +256,7 @@
             User::LeaveIfError( iFile.Open( iFs, iParams.iFileName, EFileShareReadersOrWriters ) );  
             
             TN_DEBUG2( "CThumbnailRequestActive::StartL() - file handle opened for %S", &iParams.iFileName );
+            OstTraceExt1( TRACE_NORMAL, DUP5_CTHUMBNAILREQUESTACTIVE_STARTL, "CThumbnailRequestActive::StartL;iParams.iFileName=%S", iParams.iFileName );
             
             CleanupClosePushL( iFile );
             
@@ -280,6 +293,7 @@
 void CThumbnailRequestActive::RunL()
     {
     TN_DEBUG2( "CThumbnailRequestActive::RunL() - request ID: %d", iParams.iRequestId );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL;iParams.iRequestId=%u", iParams.iRequestId );
  
     if ( iParams.iControlFlags == EThumbnailPreviewThumbnail )
         {
@@ -313,6 +327,8 @@
     stop.UniversalTime();
     TN_DEBUG3( "CThumbnailRequestActive::RunL() total execution time of req %d is %d ms",
                 iParams.iRequestId, (TInt)stop.MicroSecondsFrom(iStartExecTime).Int64()/1000 );
+    OstTraceExt2( TRACE_NORMAL, DUP1_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL - total execution time of req %d is %d ms",
+                iParams.iRequestId, (TInt)stop.MicroSecondsFrom(iStartExecTime).Int64()/1000 );
 #endif
         }
     else if (iCanceled || iRequestType == EReqRenameThumbnails)
@@ -337,12 +353,15 @@
     stop.UniversalTime();
     TN_DEBUG3( "CThumbnailRequestActive::RunL() total execution time of req %d is %d ms",
                 iParams.iRequestId, (TInt)stop.MicroSecondsFrom(iStartExecTime).Int64()/1000 );
+    OstTraceExt2( TRACE_NORMAL, DUP2_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL - total execution time of req %d is %d ms",
+                iParams.iRequestId, (TInt)stop.MicroSecondsFrom(iStartExecTime).Int64()/1000 );
 #endif
         }
     else if ( iStatus.Int() == KThumbnailErrThumbnailNotFound && iParams.iFileName.Length() && 
          !( iParams.iFlags& CThumbnailManager::EDoNotCreate ))
         {
         TN_DEBUG2( "CThumbnaiRequestActive::RunL() - no thumbnail found - lets try with file handle %S", &iParams.iFileName );
+        OstTraceExt1( TRACE_NORMAL, DUP3_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL - no thumbnail found - lets try with file handle;iParams.iFileName=%S", iParams.iFileName );
         iRequestCompleted = EFalse;
         
         // We tried to get thumbnail using file path, but it was not found in
@@ -351,11 +370,13 @@
         iFile.Close();
         TInt err = iFile.Open( iFs, iParams.iFileName, EFileShareReadersOrWriters );
         TN_DEBUG2( "CThumbnaiRequestActive::RunL() - file handle open err = %d", err );
+        OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL - file handle open err;err=%d", err );
         User::LeaveIfError( err );
         
         CleanupClosePushL( iFile );
         
         TN_DEBUG2( "CThumbnaiRequestActive::RunL() - file handle opened for %S", &iParams.iFileName );
+        OstTraceExt1( TRACE_NORMAL, DUP5_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL;iParams.iFileName=%S", iParams.iFileName );
         
         iSession.RequestThumbnailL( iFile, iParams.iFileName, iParamsPckg, iStatus );
         CleanupStack::PopAndDestroy( &iFile );
@@ -375,9 +396,11 @@
     else if (iParams.iOriginalControlFlags == EThumbnailGeneratePersistentSizesOnly && !iProcessingPreview)
 	    {
 	    TN_DEBUG1( "CThumbnaiRequestActive::RunL()- generate persistent sizes thumbnailready" );
+	    OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL - generate persistent sizes thumbnailready" );
 	    iBitmapHandle = iParams.iBitmapHandle;
 	    
 	    TN_DEBUG2( "CThumbnaiRequestActive::RunL() - iObserver.ThumbnailReady %d", iParams.iRequestId );
+	    OstTrace1( TRACE_NORMAL, DUP7_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL;iParams.iRequestId=%u", iParams.iRequestId );
 	    iObserver.ThumbnailReady( iStatus.Int(), *iCallbackThumbnail, iParams.iRequestId );
 	  
 	    ReleaseServerBitmap();
@@ -392,6 +415,9 @@
             stop.UniversalTime();
             TN_DEBUG3( "CThumbnailRequestActive::RunL() total execution time %d, %d ms",
                        iParams.iRequestId, (TInt)stop.MicroSecondsFrom(iStartExecTime).Int64()/1000 );
+            OstTraceExt2( TRACE_NORMAL, DUP8_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL - total execution time %d, %d ms",
+                       iParams.iRequestId, (TInt)stop.MicroSecondsFrom(iStartExecTime).Int64()/1000 );
+            
         #endif
 	    }
     //1st round preview ready from too low quality exif/exif not found (not-stored)
@@ -399,9 +425,11 @@
     else if (iParams.iOriginalControlFlags == EThumbnailGeneratePersistentSizesOnly && iProcessingPreview)
         {
         TN_DEBUG1( "CThumbnaiRequestActive::RunL()- generate persistent sizes thumbnailpreviewready" );
+        OstTrace0( TRACE_NORMAL, DUP9_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL - generate persistent sizes thumbnailpreviewready" );
         iBitmapHandle = iParams.iBitmapHandle;
         
         TN_DEBUG2( "CThumbnaiRequestActive::RunL() - iObserver.ThumbnailPreviewReady %d", iParams.iRequestId );
+        OstTrace1( TRACE_NORMAL, DUP10_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL;iParams.iRequestId=%u", iParams.iRequestId );
         iObserver.ThumbnailPreviewReady( *iCallbackThumbnail, iParams.iRequestId );
         
         iProcessingPreview = EFalse;
@@ -433,6 +461,7 @@
     else
         {
         TN_DEBUG1( "CThumbnailRequestActive::RunL() - succesful" );
+        OstTrace0( TRACE_NORMAL, DUP11_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL - succesful" );
         
         // Success
         iBitmapHandle = iParams.iBitmapHandle;
@@ -447,6 +476,7 @@
             // reduce bpp value (displaymode to match reqested bits per pixel)
             #ifdef _DEBUG
             TN_DEBUG2( "CThumbnailRequestActive::RunL() - displaymode is %d", bitmap->DisplayMode());
+            OstTrace1( TRACE_NORMAL, DUP12_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL;bitmap->DisplayMode()=%u", bitmap->DisplayMode() );
             #endif
             
             if( bitmap->DisplayMode() > iParams.iDisplayMode )
@@ -454,6 +484,7 @@
                 bitmap->SetDisplayMode( iParams.iDisplayMode );
                 #ifdef _DEBUG
                 TN_DEBUG2( "CThumbnailRequestActive::RunL() - displaymode is now %d", bitmap->DisplayMode());
+                OstTrace1( TRACE_NORMAL, DUP13_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL;bitmap->DisplayMode()=%u", bitmap->DisplayMode() );
                 #endif
                 }
             
@@ -464,6 +495,7 @@
         if ( iProcessingPreview )
             {
             TN_DEBUG2( "CThumbnailRequestActive::RunL() - iObserver.ThumbnailPreviewReady %d", iParams.iRequestId );
+			OstTrace1( TRACE_NORMAL, DUP14_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL - iObserver.ThumbnailPreviewReady;iParams.iRequestId=%u", iParams.iRequestId );
 			
             //increase priority of 2nd round (both, AO and request itself)
             this->SetPriority(this->Priority() + 1);
@@ -480,6 +512,7 @@
         else
             {
             TN_DEBUG2( "CThumbnailRequestActive::RunL() - iObserver.ThumbnailReady %d", iParams.iRequestId );
+            OstTrace1( TRACE_NORMAL, DUP15_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL;iParams.iRequestId=%u", iParams.iRequestId );
             
             iObserver.ThumbnailReady( iStatus.Int(), * iCallbackThumbnail, iParams.iRequestId );
             ReleaseServerBitmap();    
@@ -492,8 +525,11 @@
 #ifdef _DEBUG
         TTime stop;
         stop.UniversalTime();
+        TInt tookTime = (TInt)stop.MicroSecondsFrom(iStartExecTime).Int64()/1000;
         TN_DEBUG4( "CThumbnailRequestActive::RunL(0x%08x) total execution time of req %d is %d ms",
                 this, iParams.iRequestId, (TInt)stop.MicroSecondsFrom(iStartExecTime).Int64()/1000 );
+        OstTrace1( TRACE_NORMAL, DUP16_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL;this=%o", this );
+        OstTraceExt2( TRACE_NORMAL, DUP17_CTHUMBNAILREQUESTACTIVE_RUNL, "CThumbnailRequestActive::RunL;iParams.iRequestId=%u;tookTime=%d", iParams.iRequestId, tookTime );
 #endif
             }
         }
@@ -516,6 +552,7 @@
 TInt CThumbnailRequestActive::RunError( TInt aError )
     {
     TN_DEBUG1( "CThumbnailRequestActive::RunError");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_RUNERROR, "CThumbnailRequestActive::RunError" );
     
     iTimer->Cancel();
     
@@ -535,6 +572,7 @@
 void CThumbnailRequestActive::DoCancel()
     {
     TN_DEBUG1( "CThumbnailRequestActive::DoCancel");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_DOCANCEL, "CThumbnailRequestActive::DoCancel" );
     iTimer->Cancel();
     
     __ASSERT_DEBUG(( iRequestId > 0 ), ThumbnailPanic( EThumbnailWrongId ));
@@ -552,6 +590,7 @@
 void CThumbnailRequestActive::AsyncCancel()
     {
     TN_DEBUG1( "CThumbnailRequestActive::AsyncCancel");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_ASYNCCANCEL, "CThumbnailRequestActive::AsyncCancel" );
 
     __ASSERT_DEBUG(( iRequestId > 0 ), ThumbnailPanic( EThumbnailWrongId ));
     
@@ -573,6 +612,7 @@
     if ( iBitmapHandle && iSession.Handle())
         {
     	TN_DEBUG1( "CThumbnailRequestActive::ReleaseServerBitmap");
+    	OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_RELEASESERVERBITMAP, "CThumbnailRequestActive::ReleaseServerBitmap" );
     
         iSession.ReleaseBitmap( iBitmapHandle );
         iBitmapHandle = 0;
@@ -588,6 +628,7 @@
 void CThumbnailRequestActive::HandleError()
     {
     TN_DEBUG1( "CThumbnailRequestActive::HandleError");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_HANDLEERROR, "CThumbnailRequestActive::HandleError" );
     
     if ( iError )
         {
@@ -598,16 +639,19 @@
             if (connErr != KErrNone)
                 {
                 TN_DEBUG2( "CThumbnaiRequestActive::HandleError() - session reconnect err %d", connErr );
+                OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILREQUESTACTIVE_HANDLEERROR, "CThumbnailRequestActive::HandleError;err=%d", connErr );
                 }
             else
                 {
                 TN_DEBUG1( "CThumbnailRequestActive::HandleError() - session reconnected");
+                OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILREQUESTACTIVE_HANDLEERROR, "CThumbnailRequestActive::HandleError - session reconnected" );
                 }
             }
 
         if (iRequestObserver && iRequestType == EReqDeleteThumbnails)
              {
              TN_DEBUG2( "CThumbnaiRequestActive::HandleError() - iRequestObserver->ThumbnailRequestReady %d", iParams.iRequestId );
+             OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILREQUESTACTIVE_HANDLEERROR, "CThumbnailRequestActive::HandleError;iParams.iRequestId=%u", iParams.iRequestId );
              iRequestObserver->ThumbnailRequestReady(iError, ERequestDeleteThumbnails ,iParams.iRequestId);
              }
         else
@@ -628,6 +672,7 @@
                     {
                     iRetry++;
                     TN_DEBUG2( "CThumbnaiRequestActive::HandleError() - KErrServerTerminated, retry %d", iRetry);
+                    OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILREQUESTACTIVE_HANDLEERROR, "CThumbnailRequestActive::HandleError - KErrServerTerminated;iRetry=%d", iRetry );
                     iError = KErrNone;
                     TRAPD(err, StartL());
                     return;
@@ -635,6 +680,7 @@
 	            }
 #endif
 	        TN_DEBUG3( "CThumbnaiRequestActive::HandleError() - iObserver.ThumbnailReady req=%d err=%d", iParams.iRequestId, iError );
+	        OstTrace1( TRACE_NORMAL, DUP5_CTHUMBNAILREQUESTACTIVE_HANDLEERROR, "CThumbnailRequestActive::HandleError - iObserver.ThumbnailReady %u", iParams.iRequestId );
 	        iObserver.ThumbnailReady( iError, *iCallbackThumbnail, iParams.iRequestId );
 	            
             }
@@ -659,7 +705,7 @@
 // ---------------------------------------------------------------------------
 //
 void CThumbnailRequestActive::GetThumbnailL( const RFile64& aFile, TThumbnailId aThumbnailId,
-    CThumbnailManager::TThumbnailFlags aFlags, CThumbnailManager
+    const TDesC8& aMimeType, CThumbnailManager::TThumbnailFlags aFlags, CThumbnailManager
     ::TThumbnailQualityPreference aQualityPreference, const TSize& aSize, const
     TDisplayMode aDisplayMode, const TInt aPriority, TAny* aClientData, TBool aGeneratePersistentSizesOnly,
     const TDesC& aTargetUri, TThumbnailSize aThumbnailSize)
@@ -680,6 +726,7 @@
     						EThumbnailGeneratePersistentSizesOnly :
     						EThumbnailNoControlFlags);    
     iParams.iOriginalControlFlags = iParams.iControlFlags;
+    iParams.iMimeType = TDataType( aMimeType );
     iParams.iBitmapHandle = 0;
     iParams.iSize = aSize;
     iParams.iDisplayMode = aDisplayMode;
@@ -714,8 +761,8 @@
 // ---------------------------------------------------------------------------
 //
 void CThumbnailRequestActive::GetThumbnailL( TThumbnailId aThumbnailId,
-    const TDesC& aPath, CThumbnailManager::TThumbnailFlags aFlags, CThumbnailManager
-    ::TThumbnailQualityPreference aQualityPreference, const TSize& aSize, const
+    const TDesC& aPath, const TDesC8& aMimeType, CThumbnailManager::TThumbnailFlags aFlags, 
+    CThumbnailManager::TThumbnailQualityPreference aQualityPreference, const TSize& aSize, const
     TDisplayMode aDisplayMode, const TInt aPriority, TAny* aClientData, TBool aGeneratePersistentSizesOnly,
     const TDesC& aTargetUri, TThumbnailSize aThumbnailSize)
     {
@@ -726,6 +773,7 @@
                             EThumbnailGeneratePersistentSizesOnly :
                             EThumbnailNoControlFlags);
     iParams.iOriginalControlFlags = iParams.iControlFlags;
+    iParams.iMimeType = TDataType( aMimeType );
     iParams.iBitmapHandle = 0;
     iParams.iSize = aSize;
     iParams.iDisplayMode = aDisplayMode;
@@ -758,7 +806,7 @@
 // ---------------------------------------------------------------------------
 //
 void CThumbnailRequestActive::GetThumbnailL( const TDesC& aPath, TThumbnailId aThumbnailId,
-    CThumbnailManager::TThumbnailFlags aFlags, CThumbnailManager
+    const TDesC8& aMimeType, CThumbnailManager::TThumbnailFlags aFlags, CThumbnailManager
     ::TThumbnailQualityPreference aQualityPreference, const TSize& aSize, const
     TDisplayMode aDisplayMode, const TInt aPriority, TAny* aClientData, TBool aGeneratePersistentSizesOnly,
     const TDesC& aTargetUri, TThumbnailSize aThumbnailSize)
@@ -770,6 +818,7 @@
     						EThumbnailGeneratePersistentSizesOnly :
     						EThumbnailNoControlFlags);
     iParams.iOriginalControlFlags = iParams.iControlFlags;
+    iParams.iMimeType = TDataType( aMimeType );
     iParams.iBitmapHandle = 0;
     iParams.iSize = aSize;
     iParams.iDisplayMode = aDisplayMode;
@@ -898,6 +947,7 @@
         {
         // memory low, create thumbs using filehandle
         TN_DEBUG1( "CThumbnaiRequestActive::SetThumbnailbyBitmap() - memory low, create thumbs using filehandle!" );
+        OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_SETTHUMBNAILL, "CThumbnailRequestActive::SetThumbnailL - memory low, create thumbs using filehandle!" );
         delete aBitmap;
         aBitmap = NULL;
         iParams.iPriority = aPriority - 1;
@@ -1025,6 +1075,7 @@
 void CThumbnailRequestActive::Get2ndPhaseThumbnailL()
     {
     TN_DEBUG2( "CThumbnailRequestActive::Get2ndPhaseThumbnailL() %d", iParams.iRequestId );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_GET2NDPHASETHUMBNAILL, "CThumbnailRequestActive::Get2ndPhaseThumbnailL;iParams.iRequestId=%u", iParams.iRequestId );
     
     iParams.iQualityPreference = CThumbnailManager::EOptimizeForQuality;
     iParams.iControlFlags = EThumbnailNoControlFlags;
@@ -1049,6 +1100,7 @@
 void CThumbnailRequestActive::ChangePriority( const TInt aNewPriority )
     {
     TN_DEBUG1( "CThumbnailRequestActive::ChangePriority");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_CHANGEPRIORITY, "CThumbnailRequestActive::ChangePriority" );
     
     iParams.iPriority = aNewPriority;
     
@@ -1070,6 +1122,7 @@
 void CThumbnailRequestActive::StartError( const TInt aErr )
     {
     TN_DEBUG1( "CThumbnailRequestActive::StartError");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_STARTERROR, "CThumbnailRequestActive::StartError" );
     
     iStartError = aErr;
     iRequestActive = ETrue;
@@ -1088,6 +1141,7 @@
 TInt CThumbnailRequestActive::TimerCallBack(TAny* aAny)
     {
     TN_DEBUG1( "CThumbnailRequestActive::TimerCallBack() - request timeout");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_TIMERCALLBACK, "CThumbnailRequestActive::TimerCallBack" );
     
     CThumbnailRequestActive* self = static_cast<CThumbnailRequestActive*>( aAny );
     
@@ -1107,6 +1161,7 @@
     self->HandleError();
     
     TN_DEBUG1( "CThumbnailRequestActive::TimerCallBack() - end");
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILREQUESTACTIVE_TIMERCALLBACK, "CThumbnailRequestActive::TimerCallBack - end" );
     
     return KErrNone;
     }
@@ -1129,6 +1184,7 @@
     else
         {
         TN_DEBUG1( "CThumbnailRequestActive::IsVirtualUri() - yes");
+        OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTACTIVE_ISVIRTUALURI, "CThumbnailRequestActive::IsVirtualUri - yes" );
         return ETrue;
         }    
     }
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestqueue.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestqueue.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -19,6 +19,11 @@
 #include "thumbnailrequestqueue.h"
 #include "thumbnailrequestactive.h"
 #include "thumbnaillog.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailrequestqueueTraces.h"
+#endif
+
 
 
 // ======== MEMBER FUNCTIONS ========
@@ -67,10 +72,12 @@
 CThumbnailRequestQueue::~CThumbnailRequestQueue()
     {
     TN_DEBUG1( "CThumbnailRequestQueue::~CThumbnailRequestQueue()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTQUEUE_CTHUMBNAILREQUESTQUEUE, "CThumbnailRequestQueue::~CThumbnailRequestQueue" );
     
     iRequests.ResetAndDestroy();
     
     TN_DEBUG1( "CThumbnailRequestQueue::~CThumbnailRequestQueue() - All requests deleted");
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILREQUESTQUEUE_CTHUMBNAILREQUESTQUEUE, "CThumbnailRequestQueue::~CThumbnailRequestQueue - All requests deleted" );
     }
 
 
@@ -82,6 +89,7 @@
 void CThumbnailRequestQueue::Process()
     {
     TN_DEBUG1( "CThumbnailRequestQueue::Process()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTQUEUE_PROCESS, "CThumbnailRequestQueue::Process" );
     
     while ( (iActiveRequests < KMaxClientRequests) &&
             (iRequests.Count() > iActiveRequests) )
@@ -101,6 +109,9 @@
                TN_DEBUG4( "CThumbnailRequestQueue::Process() - candidate at %d, id = %d, (0x%08x)", i, 
                        request->RequestId(), 
                        request);
+               OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILREQUESTQUEUE_PROCESS, "CThumbnailRequestQueue::Process;request->RequestId()=%u", request->RequestId() );
+               OstTrace1( TRACE_NORMAL, DUP5_CTHUMBNAILREQUESTQUEUE_PROCESS, "CThumbnailRequestQueue::Process;request=%o", request );
+               
                reqPriority = request->Priority();
                if ( reqPriority > priority )
                    {
@@ -114,6 +125,7 @@
         if ( selectedRequest )
            {
            TN_DEBUG1( "CThumbnailRequestQueue::Process() - starting next request");
+           OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILREQUESTQUEUE_PROCESS, "CThumbnailRequestQueue::Process - starting next request" );
                     
            iActiveRequests++;
            
@@ -121,6 +133,7 @@
            if (err != KErrNone)
                {
                TN_DEBUG1( "CThumbnailRequestQueue::Process() - starting request failed");
+               OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILREQUESTQUEUE_PROCESS, "CThumbnailRequestQueue::Process - starting request failed" );
                
                selectedRequest->StartError(err);
                }
@@ -133,6 +146,7 @@
     
     TN_DEBUG3( "CThumbnailRequestQueue::Process() end - requests: %d, active requests: %d",
                iRequests.Count(), iActiveRequests );
+    OstTraceExt2( TRACE_NORMAL, DUP3_CTHUMBNAILREQUESTQUEUE_PROCESS, "CThumbnailRequestQueue::Process;iRequests.Count()=%d;iActiveRequests=%d", iRequests.Count(), iActiveRequests );
     }
 
 
@@ -148,6 +162,7 @@
     
     TN_DEBUG3( "CThumbnailRequestQueue::AddRequestL() end - requests: %d, active requests: %d",
                iRequests.Count(), iActiveRequests );
+    OstTraceExt2( TRACE_NORMAL, CTHUMBNAILREQUESTQUEUE_ADDREQUESTL, "CThumbnailRequestQueue::AddRequestL;iRequests.Count()=%d;iActiveRequests=%d", iRequests.Count(), iActiveRequests );
     }
 
 void CThumbnailRequestQueue::RemoveCompleted( CThumbnailRequestActive* aRequestAO)
@@ -162,6 +177,9 @@
              {
              // delete completed task
              TN_DEBUG3( "CThumbnailRequestQueue::RemoveCompleted() - deleted id = %d (0x%08x)", request->RequestId(), request);
+             OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILREQUESTQUEUE_REMOVECOMPLETED, "CThumbnailRequestQueue::RemoveCompleted;request=%o", request );
+             OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILREQUESTQUEUE_REMOVECOMPLETED, "CThumbnailRequestQueue::RemoveCompleted;request->RequestId()=%u", request->RequestId() );
+             
              delete request;
              request = NULL;
              iRequests.Remove( i );
@@ -175,6 +193,7 @@
      
      TN_DEBUG3( "CThumbnailRequestQueue::RemoveCompleted() end - requests: %d, active requests: %d",
                     iRequests.Count(), iActiveRequests );
+     OstTraceExt2( TRACE_NORMAL, DUP3_CTHUMBNAILREQUESTQUEUE_REMOVECOMPLETED, "CThumbnailRequestQueue::RemoveCompleted;iRequests.Count()=%d;iActiveRequests=%d", iRequests.Count(), iActiveRequests );
     }
 
 
@@ -186,6 +205,7 @@
 TInt CThumbnailRequestQueue::CancelRequest( const TThumbnailRequestId aRequestId )
     {
     TN_DEBUG2( "CThumbnailRequestQueue::CancelRequest() - request ID: %d", aRequestId);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILREQUESTQUEUE_CANCELREQUEST, "CThumbnailRequestQueue::CancelRequest;aRequestId=%u", aRequestId );
     
     TInt res = KErrNotFound;
 
@@ -200,6 +220,7 @@
                 iRequests[i]->AsyncCancel();
                 
                 TN_DEBUG2( "CThumbnailRequestQueue::CancelRequest() - canceled request ID: %d", aRequestId);
+                OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILREQUESTQUEUE_CANCELREQUEST, "CThumbnailRequestQueue::CancelRequest;aRequestId=%u", aRequestId );
                 }
             else
                 {
@@ -208,6 +229,7 @@
                 iRequests.Remove( i );
                           
                 TN_DEBUG2( "CThumbnailRequestQueue::CancelRequest() - removed request ID: %d", aRequestId);
+                OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILREQUESTQUEUE_CANCELREQUEST, "CThumbnailRequestQueue::CancelRequest;aRequestId=%u", aRequestId );
                 }
 
             res = KErrNone;
@@ -232,6 +254,7 @@
                                              const TInt aNewPriority )
     {
     TN_DEBUG1( "CThumbnailRequestQueue::ChangePriority()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTQUEUE_CHANGEPRIORITY, "CThumbnailRequestQueue::ChangePriority" );
     
     TInt err = KErrNotFound;
     const TInt count = iRequests.Count();
@@ -259,6 +282,7 @@
 void CThumbnailRequestQueue::RequestComplete(CThumbnailRequestActive* aRequestAO)
     {
     TN_DEBUG2( "CThumbnailRequestQueue::RequestComplete(0x%08x)", aRequestAO);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILREQUESTQUEUE_REQUESTCOMPLETE, "CThumbnailRequestQueue::RequestComplete;aRequestAO=%o", aRequestAO );
     
     iActiveRequests--;
     if(iActiveRequests <= -1)
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailsession.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailsession.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -20,6 +20,10 @@
 #include "thumbnailsession.h"
 #include "thumbnailmanagerconstants.h"
 #include "thumbnaillog.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailsessionTraces.h"
+#endif
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -32,6 +36,7 @@
     {
     // No implementation required
     TN_DEBUG1( "RThumbnailSession::RThumbnailSession");
+    OstTrace0( TRACE_NORMAL, RTHUMBNAILSESSION_RTHUMBNAILSESSION, "RThumbnailSession::RThumbnailSession" );
     }
 
 
@@ -42,6 +47,7 @@
 TInt RThumbnailSession::Connect()
     { 
     TN_DEBUG1( "RThumbnailSession::Connect - start");
+    OstTrace0( TRACE_NORMAL, RTHUMBNAILSESSION_CONNECT, "RThumbnailSession::Connect - start" );
     
     StartServer();
     
@@ -58,6 +64,7 @@
     while (retry <= 10 && err != KErrNone)
         {
         TN_DEBUG1( "RThumbnailSession::Connect - retry");
+        OstTrace0( TRACE_NORMAL, DUP1_RTHUMBNAILSESSION_CONNECT, "RThumbnailSession::Connect - retry" );
     
         User::After(retry * 50000);
         StartServer();
@@ -66,6 +73,7 @@
         }
     
     TN_DEBUG1( "RThumbnailSession::Connect - end");
+    OstTrace0( TRACE_NORMAL, DUP2_RTHUMBNAILSESSION_CONNECT, "RThumbnailSession::Connect - end" );
     
     return err;
     }
@@ -79,6 +87,7 @@
 void RThumbnailSession::Close()
     {
     TN_DEBUG1( "RThumbnailSession::Close");
+    OstTrace0( TRACE_NORMAL, RTHUMBNAILSESSION_CLOSE, "RThumbnailSession::Close" );
     
     RSessionBase::Close();
     }
@@ -104,6 +113,7 @@
 TInt RThumbnailSession::StartServer()
     {
     TN_DEBUG1( "RThumbnailSession::StartServer - start");
+    OstTrace0( TRACE_NORMAL, RTHUMBNAILSESSION_STARTSERVER, "RThumbnailSession::StartServer - start" );
     
     TInt res( KErrNone );
     // create server - if one of this name does not already exist
@@ -114,6 +124,7 @@
         // we don't exist already
         {
         TN_DEBUG1( "RThumbnailSession::StartServer - server process doesn't exist yet");
+        OstTrace0( TRACE_NORMAL, DUP1_RTHUMBNAILSESSION_STARTSERVER, "RThumbnailSession::StartServer - server process doesn't exist yet" );
     
         RProcess server;
         // Create the server process
@@ -122,10 +133,12 @@
         if ( res != KErrNone )
             {
             TN_DEBUG2( "RThumbnailSession::StartServer - error creating process: %d", res);
+            OstTrace1( TRACE_NORMAL, DUP2_RTHUMBNAILSESSION_STARTSERVER, "RThumbnailSession::StartServer;res=%d", res );
             return res;
             }
         
         TN_DEBUG1( "RThumbnailSession::StartServer - process created");
+        OstTrace0( TRACE_NORMAL, DUP3_RTHUMBNAILSESSION_STARTSERVER, "RThumbnailSession::StartServer - process created" );
 
         // Process created successfully
         TRequestStatus status;
@@ -138,6 +151,7 @@
         if ( status != KErrNone )
             {
             TN_DEBUG2( "RThumbnailSession::StartServer - status: %d, closing", status.Int() );
+            OstTrace1( TRACE_NORMAL, DUP4_RTHUMBNAILSESSION_STARTSERVER, "RThumbnailSession::StartServer;status.Int()=%d", status.Int() );
         
             server.Close();
             return status.Int();
@@ -148,6 +162,7 @@
         }
     
     TN_DEBUG1( "RThumbnailSession::StartServer - end");
+    OstTrace0( TRACE_NORMAL, DUP5_RTHUMBNAILSESSION_STARTSERVER, "RThumbnailSession::StartServer - end" );
     
     return res;
     }
@@ -225,6 +240,7 @@
     if( !aBuffer )
         {
         TN_DEBUG1( "RThumbnailSession::RequestSetThumbnailL() - !aBuffer KErrArgument");
+        OstTrace0( TRACE_NORMAL, RTHUMBNAILSESSION_REQUESTSETTHUMBNAILL, "RThumbnailSession::RequestSetThumbnailL - !aBuffer KErrArgument" );
         User::Leave( KErrArgument );
         }
     
@@ -241,6 +257,7 @@
     if( !aBitmapHandle )
         {
         TN_DEBUG1( "RThumbnailSession::RequestSetThumbnailL() - !aBitmapHandle KErrArgument");
+        OstTrace0( TRACE_NORMAL, DUP1_RTHUMBNAILSESSION_REQUESTSETTHUMBNAILL, "RThumbnailSession::RequestSetThumbnailL - !aBitmapHandle KErrArgument" );
         User::Leave( KErrArgument );
         }
     
@@ -259,6 +276,7 @@
     while ( err == KErrServerBusy )
         {
         TN_DEBUG1( "RThumbnailSession::ReleaseBitmap() - server slots full");
+        OstTrace0( TRACE_NORMAL, RTHUMBNAILSESSION_RELEASEBITMAP, "RThumbnailSession::ReleaseBitmap - server slots full" );
     
         err = Send( EReleaseBitmap, TIpcArgs( aBitmapHandle ));
         }
@@ -275,6 +293,7 @@
     while ( err == KErrServerBusy )
         {
         TN_DEBUG1( "RThumbnailSession::CancelRequest() - server slots full");
+        OstTrace0( TRACE_NORMAL, RTHUMBNAILSESSION_CANCELREQUEST, "RThumbnailSession::CancelRequest - server slots full" );
     
         err = Send( ECancelRequest, TIpcArgs( aRequestId ));
         }
@@ -293,6 +312,7 @@
     while ( err == KErrServerBusy )
         {
         TN_DEBUG1( "RThumbnailSession::ChangePriority() - server slots full");
+        OstTrace0( TRACE_NORMAL, RTHUMBNAILSESSION_CHANGEPRIORITY, "RThumbnailSession::ChangePriority - server slots full" );
     
         err = Send( EChangePriority, TIpcArgs( aRequestId, aNewPriority ));
         }
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/group/thumbnailserver.mmp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/group/thumbnailserver.mmp	Mon Aug 23 13:32:17 2010 +0300
@@ -68,7 +68,7 @@
 
 USERINCLUDE             ../inc
 USERINCLUDE             ../../inc
-USERINCLUDE             ../../tmcommon/inc
+USERINCLUDE             ../../tmcommon/inc ../traces
 
 LIBRARY                 fbscli.lib
 LIBRARY                 euser.lib
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnaildecodetask.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnaildecodetask.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -26,6 +26,11 @@
 #include "thumbnailserver.h"
 #include "thumbnaillog.h"
 #include "thumbnailpanic.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnaildecodetaskTraces.h"
+#endif
+
 
 
 // ======== MEMBER FUNCTIONS ========
@@ -41,6 +46,8 @@
     {
     TN_DEBUG3( "CThumbnailDecodeTask(0x%08x)::CThumbnailDecodeTask() aDisplayMode = %d", this
         , iDisplayMode);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILDECODETASK_CTHUMBNAILDECODETASK, "CThumbnailDecodeTask::CThumbnailDecodeTask;iDisplayMode=%u", iDisplayMode );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILDECODETASK_CTHUMBNAILDECODETASK, "CThumbnailDecodeTask::CThumbnailDecodeTask;this=%o", this );
     }
 
 
@@ -52,6 +59,8 @@
 CThumbnailDecodeTask::~CThumbnailDecodeTask()
     {
     TN_DEBUG2( "CThumbnailDecodeTask(0x%08x)::~CThumbnailDecodeTask()", this );
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILDECODETASK_CTHUMBNAILDECODETASK, "CThumbnailDecodeTask::~CThumbnailDecodeTask" );
+    
     if ( iProvider )
         {
         iProvider->CancelGetThumbnail();
@@ -70,6 +79,7 @@
 void CThumbnailDecodeTask::StartL()
     {
     TN_DEBUG2( "CThumbnailDecodeTask(0x%08x)::StartL()", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILDECODETASK_STARTL, "CThumbnailDecodeTask::StartL;this=%o", this );
 
     CThumbnailTask::StartL();
 
@@ -78,6 +88,7 @@
     iProvider = iServer.ResolveProviderL( mimeType );
     TN_DEBUG3( "CThumbnailDecodeTask(0x%08x) -- provider UID 0x%08x", this,
         iProvider->Uid());
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILDECODETASK_STARTL, "CThumbnailDecodeTask::StartL;this=%o", this );
 
     __ASSERT_DEBUG(( iProvider ), ThumbnailPanic( EThumbnailNullPointer ));
 
@@ -97,6 +108,7 @@
     {
     // No implementation required
     TN_DEBUG2( "CThumbnailDecodeTask(0x%08x)::RunL()", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILDECODETASK_RUNL, "CThumbnailDecodeTask::RunL;this=%o", this );
     }
 
 
@@ -107,6 +119,7 @@
 void CThumbnailDecodeTask::DoCancel()
     {
     TN_DEBUG2( "CThumbnailDecodeTask(0x%08x)::DoCancel()", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILDECODETASK_DOCANCEL, "CThumbnailDecodeTask::DoCancel;this=%o", this );
     if ( iProvider )
         {
         iProvider->CancelGetThumbnail();
@@ -125,6 +138,9 @@
     {
     TN_DEBUG4( "CThumbnailDecodeTask(0x%08x)::ThumbnailProviderReady(aError=%d, aBitmap=0x%08x)", 
                this, aError, aBitmap );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILDECODETASK_THUMBNAILPROVIDERREADY, "CThumbnailDecodeTask::ThumbnailProviderReady;this=%o", this );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILDECODETASK_THUMBNAILPROVIDERREADY, "CThumbnailDecodeTask::ThumbnailProviderReady;aError=%d", aError );
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILDECODETASK_THUMBNAILPROVIDERREADY, "CThumbnailDecodeTask::ThumbnailProviderReady;aBitmap=%o", aBitmap );
 
     iOriginalSize = aOriginalSize;
 
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnaildiskunmountobserver.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnaildiskunmountobserver.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -19,6 +19,11 @@
 #include "thumbnaildiskunmountobserver.h"
 #include "thumbnaillog.h"
 #include "thumbnailserver.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnaildiskunmountobserverTraces.h"
+#endif
+
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -50,6 +55,7 @@
     {
     TN_DEBUG1( "CThumbnailDiskUnmountObserver::CThumbnailDiskUnmountObserver()"
         );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILDISKUNMOUNTOBSERVER_CTHUMBNAILDISKUNMOUNTOBSERVER, "CThumbnailDiskUnmountObserver::CThumbnailDiskUnmountObserver" );
     CActiveScheduler::Add( this );
     StartNotify();
     }
@@ -75,6 +81,7 @@
     {
     TN_DEBUG1( 
         "CThumbnailDiskUnmountObserver::~CThumbnailDiskUnmountObserver()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILDISKUNMOUNTOBSERVER_CTHUMBNAILDISKUNMOUNTOBSERVER, "CThumbnailDiskUnmountObserver::~CThumbnailDiskUnmountObserver" );
     Cancel();
     }
 
@@ -87,6 +94,7 @@
     {
     TN_DEBUG2( "CThumbnailDiskUnmountObserver::RunL() iStatus = %d",
         iStatus.Int());
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILDISKUNMOUNTOBSERVER_RUNL, "CThumbnailDiskUnmountObserver::RunL - iStatus =;iStatus.Int()=%d", iStatus.Int() );
     
     if( !iStatus.Int() )
         {       
@@ -117,6 +125,7 @@
 void CThumbnailDiskUnmountObserver::StartNotify()
     {
     TN_DEBUG1( "CThumbnailDiskUnmountObserver::StartNotify()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILDISKUNMOUNTOBSERVER_STARTNOTIFY, "CThumbnailDiskUnmountObserver::StartNotify" );
     if(!IsActive())
         { 
         iFs.NotifyDismount( iDrive, iStatus, EFsDismountRegisterClient );
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailfetchedchecker.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailfetchedchecker.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -17,6 +17,11 @@
 
 #include "thumbnailfetchedchecker.h"
 #include "thumbnaillog.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailfetchedcheckerTraces.h"
+#endif
+
 
 const int KMaxStoredEntries = 100;
 
@@ -53,6 +58,7 @@
 TInt CThumbnailFetchedChecker::LastFetchResult( const TDesC& aUri, const TThumbnailSize aThumbnailSize )
     {
     TN_DEBUG3( "CThumbnailFetchedChecker::LastFetchResult(aUri=%S aThumbnailSize=%d)", &aUri, aThumbnailSize);
+    OstTraceExt2( TRACE_NORMAL, CTHUMBNAILFETCHEDCHECKER_LASTFETCHRESULT, "CThumbnailFetchedChecker::LastFetchResult;aUri=%S;aThumbnailSize=%hu", aUri, aThumbnailSize );
 
     CEntry* entry = NULL;
     TRAPD( err, entry = CEntry::NewL( aUri, aThumbnailSize, KErrNone ) );
@@ -62,6 +68,7 @@
         if ( ret != KErrNotFound )
             {
             TN_DEBUG1( "CThumbnailFetchedChecker::LastFetchResult() -> error found");
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILFETCHEDCHECKER_LASTFETCHRESULT, "CThumbnailFetchedChecker::LastFetchResult  - error found" );
             delete entry;
             entry = NULL;
             return iNotFetched[ ret ]->iError;
@@ -81,6 +88,7 @@
 void CThumbnailFetchedChecker::SetFetchResult( const TDesC& aUri, const TThumbnailSize aThumbnailSize, TInt aError )
     {
     TN_DEBUG4( "CThumbnailFetchedChecker::SetFetchResult(aUri=%S aThumbnailSize=%d aError=%d)", &aUri, aThumbnailSize, aError);
+    OstTraceExt3( TRACE_NORMAL, CTHUMBNAILFETCHEDCHECKER_SETFETCHRESULT, "CThumbnailFetchedChecker::SetFetchResult;aUri=%S;aThumbnailSize=%u;aError=%d", aUri, aThumbnailSize, aError );
     if ( aError == KErrNone )
         {
         // Remove successful results from store
@@ -92,6 +100,7 @@
             if ( i >= 0 )
                 {
                 TN_DEBUG2( "CThumbnailFetchedChecker::LastFetchResult() -> Remove successful results from store %d",  iNotFetched.Count() );
+                OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILFETCHEDCHECKER_SETFETCHRESULT, "CThumbnailFetchedChecker::SetFetchResult;iNotFetched.Count()=%d", iNotFetched.Count() );
                 delete iNotFetched[ i ];
                 iNotFetched[ i ] = NULL;
                 iNotFetched.Remove( i );
@@ -106,6 +115,7 @@
         // Add or update
         CEntry* entry = NULL;
         TRAPD( err, entry = CEntry::NewL( aUri, aThumbnailSize, aError ) );
+        OstTraceExt3( TRACE_NORMAL, DUP4_CTHUMBNAILFETCHEDCHECKER_SETFETCHRESULT, "CThumbnailFetchedChecker::SetFetchResult;aUri=%S;aThumbnailSize=%u;aError=%d", aUri, aThumbnailSize, aError );
         if ( !err && entry )
             {
             err = iNotFetched.Find( entry );
@@ -116,6 +126,7 @@
                 if ( i >= 0 )
                     {
                     TN_DEBUG1( "CThumbnailFetchedChecker::LastFetchResult() -> Update fetched tn error" );
+                    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILFETCHEDCHECKER_SETFETCHRESULT, "CThumbnailFetchedChecker::SetFetchResult - Update fetched tn error" );
                     iNotFetched[ i ]->iError = aError;
                     }
                 }
@@ -128,6 +139,7 @@
                     if ( err == KErrNone )
                         {
                         TN_DEBUG2( "CThumbnailFetchedChecker::LastFetchResult() -> Inserted new fetched tn error %d", iNotFetched.Count());	
+                        OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILFETCHEDCHECKER_SETFETCHRESULT, "CThumbnailFetchedChecker::SetFetchResult;iNotFetched.Count()=%d", iNotFetched.Count() );
                         entry = NULL; // owned by array now
                         }
                     }
@@ -146,6 +158,7 @@
 void CThumbnailFetchedChecker::DeleteFetchResult( const TDesC& aUri )
     {
     TN_DEBUG2( "CThumbnailFetchedChecker::DeleteFetchResult(%S)", &aUri);
+    OstTraceExt1( TRACE_NORMAL, CTHUMBNAILFETCHEDCHECKER_DELETEFETCHRESULT, "CThumbnailFetchedChecker::DeleteFetchResult;aUri=%S", aUri );
     // delete all entries of passed uri
     TInt ret;
     do
@@ -154,6 +167,7 @@
         if ( ret >= 0 )
             {
             TN_DEBUG1( "CThumbnailFetchedChecker::DeleteFetchResult() -> Deteled URI from fetched list" );	
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILFETCHEDCHECKER_DELETEFETCHRESULT, "CThumbnailFetchedChecker::DeleteFetchResult - Deteled URI from fetched list" );
             delete iNotFetched[ ret ];
             iNotFetched[ ret ] = NULL;
             iNotFetched.Remove( ret );
@@ -170,6 +184,7 @@
 void CThumbnailFetchedChecker::RenameFetchResultL( const TDesC& aNewUri, const TDesC& aOldUri )
     {
     TN_DEBUG3( "CThumbnailFetchedChecker::RenameFetchResult(aNewUri=%S aOldUri=%S)", &aNewUri, &aOldUri);
+    OstTraceExt2( TRACE_NORMAL, CTHUMBNAILFETCHEDCHECKER_RENAMEFETCHRESULTL, "CThumbnailFetchedChecker::RenameFetchResultL;aNewUri=%S;aOldUri=%S", aNewUri, aOldUri );
     // change every occurence of passed uri
     TInt ret;
     do
@@ -182,6 +197,7 @@
 
             iNotFetched[ ret ]->iUri = aNewUri.AllocL();
             TN_DEBUG1( "CThumbnailFetchedChecker::RenameeFetchResult() -> Renamed URI in fetched list" );	
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILFETCHEDCHECKER_RENAMEFETCHRESULTL, "CThumbnailFetchedChecker::RenameFetchResultL - Renamed URI in fetched list" );
             }
         }
     while(ret != KErrNotFound );
@@ -195,6 +211,7 @@
 void CThumbnailFetchedChecker::Reset()
     {
     TN_DEBUG1( "CThumbnailFetchedChecker::Reset()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILFETCHEDCHECKER_RESET, "CThumbnailFetchedChecker::Reset" );
     iNotFetched.ResetAndDestroy();
     }
 
@@ -206,6 +223,7 @@
         const TDesC& aUri, const TThumbnailSize aThumbnailSize, TInt aError )
     {
     TN_DEBUG4( "CThumbnailFetchedChecker::CEntry::NewL(aUri=%S aThumbnailSize=%d aError=%d)", &aUri, aThumbnailSize, aError);
+    OstTraceExt3( TRACE_NORMAL, CENTRY_NEWL, "CEntry::NewL;aUri=%S;aThumbnailSize=%u;aError=%d", aUri, aThumbnailSize, aError );
     CEntry* self  = new (ELeave) CEntry();
     if ( self )
         {
@@ -229,6 +247,7 @@
         const CThumbnailFetchedChecker::CEntry& aEntry, const CThumbnailFetchedChecker::CEntry& aEntry1 )
     {
     TN_DEBUG1( "CThumbnailFetchedChecker::CEntry::FindCB");
+    OstTrace0( TRACE_NORMAL, CENTRY_FINDCB, "CEntry::FindCB" );
     if( aEntry1.iSize == aEntry.iSize)
         {
         // return index if size and uri matches
@@ -248,6 +267,7 @@
         const TDesC* aUri, const CThumbnailFetchedChecker::CEntry& aEntry )
     {
     TN_DEBUG2( "CThumbnailFetchedChecker::CEntry::FindCBUri(aUri=%S", &aUri);
+    OstTrace0( TRACE_NORMAL, CENTRY_FINDCBURI, "CEntry::FindCBUri" );
     return aUri->CompareF( *( aEntry.iUri ) );
     }
 
@@ -260,6 +280,7 @@
         const CThumbnailFetchedChecker::CEntry& aEntry2 )
     {
     TN_DEBUG1( "CThumbnailFetchedChecker::CEntry::InsertCB");
+    OstTrace0( TRACE_NORMAL, CENTRY_INSERTCB, "CEntry::InsertCB" );
     if( aEntry1.iSize == aEntry2.iSize)
         {
         // return index if size and uri matches
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailgeneratetask.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailgeneratetask.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -29,6 +29,11 @@
 #include "thumbnaillog.h"
 #include "thumbnailpanic.h"
 #include "thumbnailfetchedchecker.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailgeneratetaskTraces.h"
+#endif
+
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -52,6 +57,7 @@
     iQualityPreference( aQualityPreference ), iVirtualUri( aVirtualUri )
     {
     TN_DEBUG2( "CThumbnailGenerateTask(0x%08x)::CThumbnailGenerateTask()", this);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILGENERATETASK_CTHUMBNAILGENERATETASK, "CThumbnailGenerateTask::CThumbnailGenerateTask;this=%o", this );
     
     if ( !aBuffer && aFile)
         {
@@ -85,6 +91,7 @@
 CThumbnailGenerateTask::~CThumbnailGenerateTask()
     {
     TN_DEBUG2("CThumbnailGenerateTask(0x%08x)::~CThumbnailGenerateTask()", this);
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILGENERATETASK_CTHUMBNAILGENERATETASK, "CThumbnailGenerateTask::~CThumbnailGenerateTask;this=%o", this );
     
     if ( iProvider )
         {
@@ -110,6 +117,7 @@
     
     iFile.Close();
     TN_DEBUG1("CThumbnailGenerateTask::~CThumbnailGenerateTask() - file handle closed");
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILGENERATETASK_CTHUMBNAILGENERATETASK, "CThumbnailGenerateTask::~CThumbnailGenerateTask - file handle closed" );
     }
 
 
@@ -120,6 +128,7 @@
 void CThumbnailGenerateTask::StartL()
     {
     TN_DEBUG2( "CThumbnailGenerateTask(0x%08x)::StartL()", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILGENERATETASK_STARTL, "CThumbnailGenerateTask::StartL;this=%o", this );
 
     CThumbnailTask::StartL();
     
@@ -141,6 +150,7 @@
     iProvider = iServer.ResolveProviderL(mimeType);
        	
     TN_DEBUG3( "CThumbnailGenerateTask(0x%08x) -- provider UID 0x%08x", this, iProvider->Uid());
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILGENERATETASK_STARTL, "CThumbnailGenerateTask::StartL;this=%o", this );
 
     __ASSERT_DEBUG(( iProvider ), ThumbnailPanic( EThumbnailNullPointer ));
 
@@ -178,6 +188,7 @@
     User::LeaveIfError( providerErr );
     
     TN_DEBUG2( "CThumbnailGenerateTask(0x%08x)::StartL() end", this );
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILGENERATETASK_STARTL, "CThumbnailGenerateTask::StartL -end;this=%o", this );
     }
 
 
@@ -198,6 +209,7 @@
 void CThumbnailGenerateTask::DoCancel()
     {
     TN_DEBUG2( "CThumbnailGenerateTask(0x%08x)::DoCancel()", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILGENERATETASK_DOCANCEL, "CThumbnailGenerateTask::DoCancel;this=%o", this );
     
     if ( iProvider )
         {
@@ -274,6 +286,9 @@
     {
     TN_DEBUG4( 
         "CThumbnailGenerateTask(0x%08x)::ThumbnailProviderReady(aError=%d, aBitmap=0x%08x)", this, aError, aBitmap );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILGENERATETASK_THUMBNAILPROVIDERREADY, "CThumbnailGenerateTask::ThumbnailProviderReady;this=%o", this );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILGENERATETASK_THUMBNAILPROVIDERREADY, "CThumbnailGenerateTask::ThumbnailProviderReady;aError=%d", aError );
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILGENERATETASK_THUMBNAILPROVIDERREADY, "CThumbnailGenerateTask::ThumbnailProviderReady;aBitmap=%o", aBitmap );
 
     #ifdef _DEBUG
     aStop.UniversalTime();
@@ -299,6 +314,7 @@
         
 #ifdef _DEBUG
         TN_DEBUG2( "CThumbnailGenerateTask::ThumbnailProviderReady() - displaymode is %d", aBitmap->DisplayMode());
+        OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILGENERATETASK_THUMBNAILPROVIDERREADY, "CThumbnailGenerateTask::ThumbnailProviderReady;aBitmap->DisplayMode()=%u", aBitmap->DisplayMode() );
 #endif
         
         TRAPD( err, CreateScaleTasksL( aBitmap ));
@@ -358,6 +374,8 @@
             TThumbnailSize size = (*iMissingSizes)[ i ].iType;
 #ifdef _DEBUG
             TN_DEBUG3( "CThumbnailGenerateTask(0x%08x)::CreateScaleTasksL() *iMissingSizes)[ i ].iType == %d", this, size );
+            OstTrace1( TRACE_NORMAL, CTHUMBNAILGENERATETASK_CREATESCALETASKSL, "CThumbnailGenerateTask::CreateScaleTasksL;this=%o", this );
+            OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILGENERATETASK_CREATESCALETASKSL, "CThumbnailGenerateTask::CreateScaleTasksL;size=%d", size );
 #endif
             
             if ( iPortrait )
@@ -367,13 +385,21 @@
                      size == EAudioFullScreenThumbnailSize ||
                      size == EImageFullScreenThumbnailSize )
                     {
+                    TInt mis_width = (*iMissingSizes)[ i ].iSize.iWidth;
                     TN_DEBUG2( "*iMissingSizes)[ i ].iWidth == %d", (*iMissingSizes)[ i ].iSize.iWidth );
+                    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILGENERATETASK_CREATESCALETASKSL, "CThumbnailGenerateTask::CreateScaleTasksL;width=%d", mis_width );
+
+                    TInt mis_height = (*iMissingSizes)[ i ].iSize.iHeight;
                     TN_DEBUG2( "*iMissingSizes)[ i ].iHeight == %d", (*iMissingSizes)[ i ].iSize.iHeight );
+                    OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILGENERATETASK_CREATESCALETASKSL, "CThumbnailGenerateTask::CreateScaleTasksL;mis_height=%d", mis_height );
                     TInt width = (*iMissingSizes)[ i ].iSize.iWidth; 
                     (*iMissingSizes)[ i ].iSize.iWidth = (*iMissingSizes)[ i ].iSize.iHeight;
                     (*iMissingSizes)[ i ].iSize.iHeight = width;
                     TN_DEBUG2( "*iMissingSizes)[ i ].iWidth == %d", (*iMissingSizes)[ i ].iSize.iWidth );
+                    OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILGENERATETASK_CREATESCALETASKSL, "CThumbnailGenerateTask::CreateScaleTasksL;width=%d", width );
+                    mis_height = (*iMissingSizes)[ i ].iSize.iHeight;
                     TN_DEBUG2( "*iMissingSizes)[ i ].iHeight == %d", (*iMissingSizes)[ i ].iSize.iHeight );
+                    OstTrace1( TRACE_NORMAL, DUP5_CTHUMBNAILGENERATETASK_CREATESCALETASKSL, "CThumbnailGenerateTask::CreateScaleTasksL;mis_height=%d", mis_height );
                     }
                 }
             
@@ -393,6 +419,7 @@
                 {
                 complTask->SetDoStore( EFalse );
                 TN_DEBUG2( "CThumbnailGenerateTask(0x%08x)::CreateScaleTasksL() - do not store", this );
+                OstTrace1( TRACE_NORMAL, DUP6_CTHUMBNAILGENERATETASK_CREATESCALETASKSL, "CThumbnailGenerateTask::CreateScaleTasksL - do not store;this=%o", this );
                 }
             else
                 {
@@ -442,6 +469,7 @@
             {
             complTask->SetDoStore( EFalse );
             TN_DEBUG2( "CThumbnailGenerateTask(0x%08x)::CreateScaleTasksL() - do not store", this );
+            OstTrace1( TRACE_NORMAL, DUP7_CTHUMBNAILGENERATETASK_CREATESCALETASKSL, "CThumbnailGenerateTask::CreateScaleTasksL - do not store;this=%o", this );
             }
         else
             {
@@ -479,6 +507,7 @@
 void CThumbnailGenerateTask::CreateBlackListedL( const TSize& aOriginalSize )
     {
     TN_DEBUG1( "CThumbnailGenerateTask::CreateBlackListedL()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILGENERATETASK_CREATEBLACKLISTEDL, "CThumbnailGenerateTask::CreateBlackListedL" );
     CFbsBitmap* tempBitmap = 0;
     tempBitmap = new (ELeave) CFbsBitmap();
     CleanupStack::PushL( tempBitmap );
@@ -515,6 +544,7 @@
 void CThumbnailGenerateTask::DoBlacklisting( const TInt aError, const TSize& aOriginalSize )
     {
     TN_DEBUG1( "CThumbnailGenerateTask::DoBlacklisting()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILGENERATETASK_DOBLACKLISTING, "CThumbnailGenerateTask::DoBlacklisting" );
     // Create a temporary bitmap of size 1 for storing blacklisted thumbnail
     // Because no actual bitmap data is generated, there is no reason to 
     // add bitmap to server bitmap pool. Completion of client request with
@@ -533,6 +563,7 @@
         if(iMissingSizes)
             {
             TN_DEBUG2( "CThumbnailGenerateTask::DoBlacklisting() - blacklist missing sizes count = %d", iMissingSizes->Count() );
+            OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILGENERATETASK_DOBLACKLISTING, "CThumbnailGenerateTask::DoBlacklisting - blacklist missing sizes count;iMissingSizes->Count()=%d", iMissingSizes->Count() );
 
             for ( TInt i( 0 ); i < iMissingSizes->Count(); i++ )
                 {
@@ -541,6 +572,7 @@
                 if (err != KErrNone)
                    {
                    TN_DEBUG3( "CThumbnailGenerateTask::DoBlacklisting() - blacklisting missing size %d failed with code %d", iThumbnailSize, err );
+                   OstTraceExt2( TRACE_NORMAL, DUP2_CTHUMBNAILGENERATETASK_DOBLACKLISTING, "CThumbnailGenerateTask::DoBlacklisting -  - blacklisting missing size failed with error;iThumbnailSize=%u;err=%d", iThumbnailSize, err );
                    }
                 }
             return;
@@ -548,15 +580,18 @@
         else
             {
             TN_DEBUG1( "CThumbnailGenerateTask::DoBlacklisting() - blacklist single size" );
+            OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILGENERATETASK_DOBLACKLISTING, "CThumbnailGenerateTask::DoBlacklisting - blacklist single size" );
             TRAPD( err, CreateBlackListedL( aOriginalSize ) );
             if (err != KErrNone)
                 {
                 TN_DEBUG2( "CThumbnailGenerateTask::DoBlacklisting() - blacklisting failed with code %d", err );
+                OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILGENERATETASK_DOBLACKLISTING, "CThumbnailGenerateTask::DoBlacklisting - blacklisting failed with code;err=%d", err );
                 }
             return;
             }
         }
     TN_DEBUG1( "CThumbnailGenerateTask::DoBlacklisting() - not blacklisted " );        
+    OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILGENERATETASK_DOBLACKLISTING, "CThumbnailGenerateTask::DoBlacklisting - not blacklisted" );
     }
 }
 
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailmdsquerytask.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailmdsquerytask.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -25,6 +25,10 @@
 #include "thumbnailmanagerconstants.h"
 #include "thumbnaillog.h"
 #include "thumbnailserver.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailmdsquerytaskTraces.h"
+#endif
 
 
 // ======== MEMBER FUNCTIONS ========
@@ -40,6 +44,7 @@
 		iServer(aServer), iUpdateToDb(ETrue)
     {
     TN_DEBUG2( "CThumbnailMDSQueryTask(0x%08x)::CThumbnailMDSQueryTask()", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILMDSQUERYTASK_CTHUMBNAILMDSQUERYTASK, "CThumbnailMDSQueryTask::CThumbnailMDSQueryTask;this=%o", this );
     }
 
 
@@ -51,6 +56,7 @@
 CThumbnailMDSQueryTask::~CThumbnailMDSQueryTask()
     {
     TN_DEBUG2( "CThumbnailMDSQueryTask(0x%08x)::~CThumbnailMDSQueryTask()", this);
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILMDSQUERYTASK_CTHUMBNAILMDSQUERYTASK, "CThumbnailMDSQueryTask::~CThumbnailMDSQueryTask;this=%o", this );
            
     if (iQuery)
         {
@@ -79,6 +85,9 @@
 void CThumbnailMDSQueryTask::HandleQueryCompleted( CMdEQuery& /*aQuery*/, const TInt aError )
     {
     TN_DEBUG3( "CThumbnailMDSQueryTask::HandleQueryCompleted(0x%08x), aError == %d", this, aError );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILMDSQUERYTASK_HANDLEQUERYCOMPLETED, "CThumbnailMDSQueryTask::HandleQueryCompleted;this=%o", this );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILMDSQUERYTASK_HANDLEQUERYCOMPLETED, "CThumbnailMDSQueryTask::HandleQueryCompleted;aError=%d", aError );
+    
     
     // if no errors in query
     if (aError == KErrNone && iQuery && iQuery->Count() > 0)
@@ -88,11 +97,13 @@
             const CMdEObject* object = &iQuery->Result(0);
             
             TN_DEBUG2( "CThumbnailMDSQueryTask::HandleQueryCompleted() - URI = %S", &object->Uri() );
+            OstTraceExt1( TRACE_NORMAL, DUP2_CTHUMBNAILMDSQUERYTASK_HANDLEQUERYCOMPLETED, "CThumbnailMDSQueryTask::HandleQueryCompleted;object->Uri()=%S", object->Uri() );
                             
             // return path to client side       
             if( iDelete )
                 {
                 TN_DEBUG2( "CThumbnailMDSQueryTask::HandleQueryCompleted() delete %S", &iUri );
+                OstTraceExt1( TRACE_NORMAL, DUP3_CTHUMBNAILMDSQUERYTASK_HANDLEQUERYCOMPLETED, "CThumbnailMDSQueryTask::HandleQueryCompleted - delete;iUri()=%S", iUri );
                 TRAP_IGNORE( iServer.DeleteThumbnailsL( iUri ) );
                 }
             else
@@ -103,6 +114,7 @@
         else
             {
             TN_DEBUG1( "CThumbnailMDSQueryTask::HandleQueryCompleted() - Don't ever come here!" );
+            OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILMDSQUERYTASK_HANDLEQUERYCOMPLETED, "CThumbnailMDSQueryTask::HandleQueryCompleted - Don't ever come here!" );
             if (ClientThreadAlive())
                 {  
                 Complete( KErrNotFound );
@@ -114,6 +126,7 @@
     else
         {
         TN_DEBUG1( "CThumbnailMDSQueryTask::HandleQueryCompleted() - No results." );
+        OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILMDSQUERYTASK_HANDLEQUERYCOMPLETED, "CThumbnailMDSQueryTask::HandleQueryCompleted - No results." );
         if(!iDelete)
             {
             if (ClientThreadAlive())
@@ -133,6 +146,7 @@
 void CThumbnailMDSQueryTask::StartL()
     {
     TN_DEBUG2( "CThumbnailMDSQueryTask(0x%08x)::StartL()", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILMDSQUERYTASK_STARTL, "CThumbnailMDSQueryTask::StartL;this=%o", this );
 
     CThumbnailTask::StartL();
     
@@ -158,6 +172,7 @@
     {
     // No implementation required
     TN_DEBUG2( "CThumbnailMDSQueryTask(0x%08x)::RunL()", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILMDSQUERYTASK_RUNL, "CThumbnailMDSQueryTask::RunL;this=%o", this );
     }
 
 
@@ -168,6 +183,7 @@
 void CThumbnailMDSQueryTask::DoCancel()
     {
     TN_DEBUG2( "CThumbnailMDSQueryTask(0x%08x)::DoCancel()", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILMDSQUERYTASK_DOCANCEL, "CThumbnailMDSQueryTask::DoCancel;this=%o", this );
     
     iQuery->Cancel();
     }
@@ -179,6 +195,7 @@
 void CThumbnailMDSQueryTask::QueryPathByIdL(TThumbnailId aId, TBool aDelete)
     {
     TN_DEBUG1( "CThumbnailMDSQueryTask()::QueryPathByIdL()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILMDSQUERYTASK_QUERYPATHBYIDL, "CThumbnailMDSQueryTask::QueryPathByIdL" );
     iQueryType = EURI;
     iDelete = aDelete;
     CMdENamespaceDef* defNamespace = &iMdESession->GetDefaultNamespaceDefL();
@@ -232,5 +249,6 @@
 void CThumbnailMDSQueryTask::SetUpdateToDb(const TBool& aUpdateToDb )
     {
     TN_DEBUG2( "CThumbnailMDSQueryTask()::SetCompleteTask() aUpdateToDb == %d", aUpdateToDb);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILMDSQUERYTASK_SETUPDATETODB, "CThumbnailMDSQueryTask::SetUpdateToDb;aUpdateToDb=%u", aUpdateToDb );
     iUpdateToDb = aUpdateToDb;
     }
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailmemorycardobserver.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailmemorycardobserver.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -18,6 +18,11 @@
 
 #include "thumbnailmemorycardobserver.h"
 #include "thumbnaillog.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailmemorycardobserverTraces.h"
+#endif
+
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -47,6 +52,7 @@
     {
     TN_DEBUG1( "CThumbnailMemoryCardObserver::CThumbnailMemoryCardObserver()"
         );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILMEMORYCARDOBSERVER_CTHUMBNAILMEMORYCARDOBSERVER, "CThumbnailMemoryCardObserver::CThumbnailMemoryCardObserver" );
     CActiveScheduler::Add( this );
     StartNotify();
     }
@@ -72,6 +78,7 @@
     {
     TN_DEBUG1( 
         "CThumbnailMemoryCardObserver::~CThumbnailMemoryCardObserver()" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILMEMORYCARDOBSERVER_CTHUMBNAILMEMORYCARDOBSERVER, "CThumbnailMemoryCardObserver::~CThumbnailMemoryCardObserver" );
     Cancel();
     }
 
@@ -83,6 +90,7 @@
 void CThumbnailMemoryCardObserver::RunL()
     {
     TN_DEBUG2( "CThumbnailMemoryCardObserver::RunL() iStatus = %d", iStatus.Int());
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILMEMORYCARDOBSERVER_RUNL, "CThumbnailMemoryCardObserver::RunL;iStatus.Int()=%d", iStatus.Int() );
     if ( !iStatus.Int() )
         {
         // trap because nothing could be done in RunError
@@ -107,6 +115,7 @@
 void CThumbnailMemoryCardObserver::StartNotify()
     {
     TN_DEBUG1( "CThumbnailMemoryCardObserver::StartNotify()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILMEMORYCARDOBSERVER_STARTNOTIFY, "CThumbnailMemoryCardObserver::StartNotify" );
     
     if (IsActive()) 
         {
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailscaletask.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailscaletask.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -28,6 +28,11 @@
 #include "thumbnailmanagerconstants.h"
 #include "thumbnaillog.h"
 #include "thumbnailpanic.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailscaletaskTraces.h"
+#endif
+
 
 
 // ======== MEMBER FUNCTIONS ========
@@ -78,6 +83,7 @@
     iBitmapToPool(aBitmapToPool), iEXIF(aEXIF), iVirtualUri( aVirtualUri )
     {
     TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::CThumbnailScaleTask()", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSCALETASK_CTHUMBNAILSCALETASK, "CThumbnailScaleTask::CThumbnailScaleTask;this=%o", this );
     
     iRequestId = aRequestId;
     }
@@ -114,6 +120,7 @@
     if ( iBitmapInPool && iBitmap )
         {
         TN_DEBUG1("CThumbnailScaleTask()::~CThumbnailScaleTask() delete original bitmap from pool");
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSCALETASK_CTHUMBNAILSCALETASK, "CThumbnailScaleTask::~CThumbnailScaleTask - delete original bitmap from pool" );
         
         // Original bitmap is owned by server, decrease reference count
         iServer.DeleteBitmapFromPool( iBitmap->Handle());
@@ -132,12 +139,14 @@
 void CThumbnailScaleTask::StartL()
     {
     TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::StartL()", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSCALETASK_STARTL, "CThumbnailScaleTask::StartL;this=%o", this );
 
     CThumbnailTask::StartL();
 
     if ( !iCrop )
         {
         TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::StartL() - cropping OFF", this );
+        OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSCALETASK_STARTL, "CThumbnailScaleTask::StartL - cropping OFF;this=%o", this );
     
         // target size at max, keep aspect ratio
         CalculateTargetSize();
@@ -145,12 +154,14 @@
     else
         {
         TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::StartL() - cropping ON", this );
+        OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSCALETASK_STARTL, "CThumbnailScaleTask::StartL - cropping ON;this=%o", this );
     
         // exact target size, crop excess
         CalculateCropRectangle();
         }
     
     TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::StartL() - sizes calculated", this );
+    OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSCALETASK_STARTL, "CThumbnailScaleTask::StartL - sizes calculated;this=%o", this );
     
 #ifdef _DEBUG
     aStart.UniversalTime();
@@ -165,6 +176,7 @@
     if(bitmapSize.iHeight == iTargetSize.iHeight && bitmapSize.iWidth == iTargetSize.iWidth)
         {
         TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::StartL() - no need for scaling", this);
+        OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILSCALETASK_STARTL, "CThumbnailScaleTask::StartL - no need for scaling;this=%o", this );
     
         // copy bitmap 1:1
         User::LeaveIfError( iScaledBitmap->Create( bitmapSize, iBitmap->DisplayMode() ));
@@ -183,6 +195,7 @@
     else
         {
         TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::StartL() - scaling", this);
+        OstTrace1( TRACE_NORMAL, DUP5_CTHUMBNAILSCALETASK_STARTL, "CThumbnailScaleTask::StartL - scaling;this=%o", this );
         
         User::LeaveIfError( iScaledBitmap->Create( iTargetSize, iBitmap->DisplayMode() ));
         iServer.ScaleBitmapL( iStatus, * iBitmap, * iScaledBitmap, iCropRectangle );
@@ -190,6 +203,7 @@
         }  
     
     TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::StartL() end", this );
+    OstTrace1( TRACE_NORMAL, DUP6_CTHUMBNAILSCALETASK_STARTL, "CThumbnailScaleTask::StartL - end;this=%o", this );
     }
 
 
@@ -202,10 +216,14 @@
     TInt err = iStatus.Int();
 
     TN_DEBUG3( "CThumbnailScaleTask(0x%08x)::RunL() err=%d)", this, err );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSCALETASK_RUNL, "CThumbnailScaleTask::RunL;this=%o", this );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSCALETASK_RUNL, "CThumbnailScaleTask::RunL;err=%d", err );
 
     #ifdef _DEBUG
     aStop.UniversalTime();
+    TInt tookTime = (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000;
     TN_DEBUG2( "CThumbnailScaleTask::RunL() scale took %d ms", (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000);
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSCALETASK_RUNL, "CThumbnailScaleTask::RunL - scale took ms;tookTime=%d", tookTime );
     #endif
 
     if ( !err )
@@ -225,6 +243,7 @@
 void CThumbnailScaleTask::DoCancel()
     {
     TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::DoCancel()", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSCALETASK_DOCANCEL, "CThumbnailScaleTask::DoCancel;this=%o", this );
     iServer.CancelScale();
     }
 
@@ -333,16 +352,22 @@
     {
     TN_DEBUG6( "CThumbnailScaleTask(0x%08x)::StoreAndCompleteL() iFilename=%S, iThumbnailSize=%d, iBitmap=0x%08x, iScaledBitmap=0x%08x)", 
                this, &iFilename, iThumbnailSize, iBitmap, iScaledBitmap );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSCALETASK_STOREANDCOMPLETEL, "CThumbnailScaleTask::StoreAndCompleteL;this=%o", this );
+	OstTraceExt1( TRACE_NORMAL, DUP1_CTHUMBNAILSCALETASK_STOREANDCOMPLETEL, "CThumbnailScaleTask::StoreAndCompleteL;iFilename=%S", iFilename );
+	OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSCALETASK_STOREANDCOMPLETEL, "CThumbnailScaleTask::StoreAndCompleteL;iBitmap=%o", iBitmap );
+	
 		 
     // do not store TN if quality is too low eg. orignal size of image is smaller than requested size
     // (do not store upscaled images)
     if ( (iTargetSizeTN.iWidth > iOriginalSize.iWidth || iTargetSizeTN.iHeight > iOriginalSize.iHeight) && iEXIF)
         {
         TN_DEBUG1("CThumbnailScaleTask()::StoreAndCompleteL() too low quality");
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSCALETASK_STOREANDCOMPLETEL, "CThumbnailScaleTask::StoreAndCompleteL - too low quality" );
         iDoStore = EFalse;
         }
     
     TN_DEBUG3("CThumbnailScaleTask(0x%08x)::StoreAndCompleteL() iDoStore = %d", this, iDoStore);
+    OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILSCALETASK_STOREANDCOMPLETEL, "CThumbnailScaleTask::StoreAndCompleteL;this=%o", this );
     
     if ( iDoStore )
         {
@@ -377,6 +402,7 @@
         if (iBitmapToPool)
             {
             TN_DEBUG1("CThumbnailScaleTask()::StoreAndCompleteL() scaled bitmap handle to params");
+            OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILSCALETASK_STOREANDCOMPLETEL, "CThumbnailScaleTask::StoreAndCompleteL" );
             
             params.iBitmapHandle = iScaledBitmap->Handle();
             }    
@@ -385,12 +411,14 @@
 	        && iEXIF && !iDoStore)
 	        {
             TN_DEBUG1("CThumbnailScaleTask()::StoreAndCompleteL() EThumbnailPreviewThumbnail");
-	    
+            OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILSCALETASK_STOREANDCOMPLETEL, "CThumbnailScaleTask::StoreAndCompleteL - EThumbnailPreviewThumbnail" );
+            
 		    // this is upscaled preview image
 	        params.iControlFlags = EThumbnailPreviewThumbnail;
 	        }
 	    
         TN_DEBUG1("CThumbnailScaleTask()::StoreAndCompleteL() write params to message");
+        OstTrace0( TRACE_NORMAL, DUP7_CTHUMBNAILSCALETASK_STOREANDCOMPLETEL, "CThumbnailScaleTask::StoreAndCompleteL - write params to message" );
         
 	    // pass bitmap handle to client
 	    iMessage.WriteL( 0, iParamsBuf );
@@ -398,13 +426,15 @@
         if (iBitmapToPool)
             {
             TN_DEBUG1("CThumbnailScaleTask()::StoreAndCompleteL() scaled bitmap to pool");
-        
+            OstTrace0( TRACE_NORMAL, DUP8_CTHUMBNAILSCALETASK_STOREANDCOMPLETEL, "CThumbnailScaleTask::StoreAndCompleteL - scaled bitmap to pool" );
+            
             iServer.AddBitmapToPoolL( iRequestId.iSession, iScaledBitmap, iRequestId );
             iScaledBitmap = NULL; // Server owns the bitmap now
             }
         }
     
     TN_DEBUG1("CThumbnailScaleTask()::StoreAndCompleteL() - end");
+    OstTrace0( TRACE_NORMAL, DUP9_CTHUMBNAILSCALETASK_STOREANDCOMPLETEL, "CThumbnailScaleTask::StoreAndCompleteL - end" );
     }
 
 
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -37,6 +37,11 @@
 #include "thumbnailmemorycardobserver.h"
 #include "tmgetimei.h"
 #include "thumbnailfetchedchecker.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailserverTraces.h"
+#endif
+
 
 
 _LIT8( KThumbnailMimeWildCard, "*" );
@@ -211,6 +216,7 @@
 void CThumbnailServer::ConstructL()
     {
     TN_DEBUG1( "CThumbnailServer::ConstructL()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_CONSTRUCTL, "CThumbnailServer::ConstructL" );
     
 #ifdef _DEBUG
     iPlaceholderCounter = 0;
@@ -273,6 +279,7 @@
 CThumbnailServer::~CThumbnailServer()
     {
     TN_DEBUG1( "CThumbnailServer::~CThumbnailServer()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_CTHUMBNAILSERVER, "CThumbnailServer::~CThumbnailServer" );
 
     iShutdown = ETrue;
     
@@ -347,7 +354,10 @@
 void CThumbnailServer::HandleSessionOpened( CMdESession& /* aSession */, TInt /*aError*/ )
 #endif
     {
+#ifdef _DEBUG
     TN_DEBUG2( "CThumbnailServer::HandleSessionOpened error == %d", aError );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_HANDLESESSIONOPENED, "CThumbnailServer::HandleSessionOpened;aError=%d", aError );
+#endif    
     }
 
 // -----------------------------------------------------------------------------
@@ -357,6 +367,7 @@
 void CThumbnailServer::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
     {
     TN_DEBUG2( "CThumbnailServer::HandleSessionError == %d", aError );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_HANDLESESSIONERROR, "CThumbnailServer::HandleSessionError;aError=%d", aError );
     if (aError != KErrNone && !iShutdown && !iSessionError)
         {
         iSessionError = ETrue;
@@ -367,6 +378,7 @@
                                TCallBack(ReconnectCallBack, this));
             
             TN_DEBUG1( "CThumbnailServer::HandleSessionError() - reconnect timer started" );
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_HANDLESESSIONERROR, "CThumbnailServer::HandleSessionError - reconnect timer started" );
             }
         } 
     }
@@ -411,9 +423,11 @@
         RProcess::Rendezvous( KErrNone );
         TN_DEBUG1( 
             "CThumbnailServer::ThreadFunctionL() -- CActiveScheduler::Start() in" );
+        OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_THREADFUNCTIONL, "CThumbnailServer::ThreadFunctionL -- CActiveScheduler::Start() in" );
         CActiveScheduler::Start();
         TN_DEBUG1( 
             "CThumbnailServer::ThreadFunctionL() -- CActiveScheduler::Start() out" );
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_THREADFUNCTIONL, "CThumbnailServer::ThreadFunctionL - out" );
         // Comes here if server gets shut down
         delete server;
         server = NULL;
@@ -430,6 +444,7 @@
     {
     TN_DEBUG2( "CThumbnailServer::AddSession() iSessionCount was %d",
         iSessionCount );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_ADDSESSION, "CThumbnailServer::AddSession;iSessionCount=%d", iSessionCount );
     iSessionCount++;
     }
 
@@ -442,6 +457,7 @@
     {
     TN_DEBUG2( "CThumbnailServer::DropSession() iSessionCount was %d",
         iSessionCount );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_DROPSESSION, "CThumbnailServer::DropSession;iSessionCount=%d", iSessionCount );
     iSessionCount--;
     
     if(iProcessor)
@@ -450,6 +466,7 @@
         }
     
     TN_DEBUG2( "CThumbnailServer::DropSession() aSession = 0x%08x", aSession );        
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_DROPSESSION, "CThumbnailServer::DropSession;aSession=%o", aSession );
     
     // clean-up bitmap pool    
     THashMapIter < TInt, TThumbnailBitmapRef > bpiter( iBitmapPool );
@@ -462,11 +479,13 @@
         if ( ref->iSession == aSession )
             {
             TN_DEBUG2( "CThumbnailServer::DropSession() - ref->iSession = 0x%08x", ref->iSession );
+            OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_DROPSESSION, "CThumbnailServer::DropSession;ref->iSession=%o", ref->iSession );
         
             delete ref->iBitmap;
             bpiter.RemoveCurrent();
                         
             TN_DEBUG2( "CThumbnailServer::DropSession() - deleted bitmap, left=%d", iBitmapPool.Count());
+            OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSERVER_DROPSESSION, "CThumbnailServer::DropSession;iBitmapPool.Count()=%d", iBitmapPool.Count() );
             }
         
         ref = bpiter.NextValue();        
@@ -493,9 +512,11 @@
 void CThumbnailServer::ShutdownNotification()
     {
     TN_DEBUG1( "CThumbnailServer::ShutdownNotification()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_SHUTDOWNNOTIFICATION, "CThumbnailServer::ShutdownNotification" );
     if (!iShutdown)
         {
         TN_DEBUG1( "CThumbnailServer::ShutdownNotification() shutdown");
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_SHUTDOWNNOTIFICATION, "CThumbnailServer::ShutdownNotification - shutdown" );
         CActiveScheduler::Stop();
         iShutdown = ETrue;
         }
@@ -513,6 +534,7 @@
     if( !aBitmap )
         {
         TN_DEBUG1( "CThumbnailServer::AddBitmapToPoolL() - KErrArgument");
+        OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_ADDBITMAPTOPOOLL, "CThumbnailServer::AddBitmapToPoolL - KErrArgument" );
         User::Leave( KErrArgument );
         }
     TN_DEBUG4( 
@@ -521,6 +543,7 @@
     TThumbnailBitmapRef* ptr = iBitmapPool.Find( aBitmap->Handle());
 
     TN_DEBUG2( "CThumbnailServer::AddBitmapToPoolL() - req id = %d", aRequestId.iRequestId );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_ADDBITMAPTOPOOLL, "CThumbnailServer::AddBitmapToPoolL;aRequestId.iRequestId=%u", aRequestId.iRequestId );
     
     if ( ptr )
         {
@@ -539,6 +562,7 @@
     
 #ifdef _DEBUG
     TN_DEBUG2( "CThumbnailServer::BITMAP-POOL-COUNTER----------, Bitmaps = %d", iBitmapPool.Count() );
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_ADDBITMAPTOPOOLL, "CThumbnailServer::AddBitmapToPoolL;iBitmapPool.Count()=%d", iBitmapPool.Count() );
 #endif
     }
 
@@ -553,8 +577,13 @@
     {
     TN_DEBUG6( 
         "CThumbnailServer::StoreBitmapL(aPath=%S, aBitmap=0x%08x, aOriginalSize=%dx%d, aCropped=%d)", &aPath, aBitmap, aOriginalSize.iWidth, aOriginalSize.iHeight, aCropped );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_STORETHUMBNAILL, "CThumbnailServer::StoreThumbnailL;aBitmap=%o", aBitmap );
+    OstTraceExt1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_STORETHUMBNAILL, "CThumbnailServer::StoreThumbnailL;aPath=%S", aPath );
+    OstTraceExt3( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_STORETHUMBNAILL, "CThumbnailServer::StoreThumbnailL;aOriginalSize.iWidth=%d;aOriginalSize.iHeight=%d;aCropped=%u", aOriginalSize.iWidth, aOriginalSize.iHeight, aCropped );
+    
 #ifdef _DEBUG
     TN_DEBUG2( "CThumbnailServer::StoreThumbnailL() - iScaledBitmap displaymode is %d", aBitmap->DisplayMode());
+    OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSERVER_STORETHUMBNAILL, "CThumbnailServer::StoreThumbnailL;aBitmap->DisplayMode()=%u", aBitmap->DisplayMode() );
 #endif
     
     if (!aCheckExist)
@@ -570,6 +599,7 @@
     else
         {
         TN_DEBUG1( "CThumbnailServer::StoreThumbnailL() - file doesn't exists anymore, skip store!");
+        OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSERVER_STORETHUMBNAILL, "CThumbnailServer::StoreThumbnailL - file doesn't exists anymore, skip store!" );
         }
     
     if( iFetchedChecker )    
@@ -587,6 +617,7 @@
     aThumbnail, TDesC8* & aData, const TThumbnailSize aThumbnailSize, TSize &aOriginalSize )
     {
     TN_DEBUG3( "CThumbnailServer::FetchThumbnailL(aPath=%S aThumbnailSize=%d)", &aPath, aThumbnailSize );
+    OstTraceExt2( TRACE_NORMAL, CTHUMBNAILSERVER_FETCHTHUMBNAILL, "CThumbnailServer::FetchThumbnailL;aPath=%S;aThumbnailSize=%hu", aPath, aThumbnailSize );
     if( iFetchedChecker )
         {
         TInt err( iFetchedChecker->LastFetchResult( aPath, aThumbnailSize ) );
@@ -628,6 +659,7 @@
 void CThumbnailServer::DeleteBitmapFromPool( TInt aHandle )
     {
     TN_DEBUG2( "CThumbnailServer::DeleteBitmapFromPool(%d)", aHandle );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_DELETEBITMAPFROMPOOL, "CThumbnailServer::DeleteBitmapFromPool;aHandle=%d", aHandle );
 
     TThumbnailBitmapRef* ptr = iBitmapPool.Find( aHandle );
     if ( ptr )
@@ -637,16 +669,19 @@
             {
             TN_DEBUG3( 
                 "CThumbnailServer::DeleteBitmapFromPool(%d) -- deleting 0x%08x)", aHandle, ptr );
+            OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_DELETEBITMAPFROMPOOL, "CThumbnailServer::DeleteBitmapFromPool -- deleting;ptr=%o", ptr );
             delete ptr->iBitmap;
             ptr->iBitmap = NULL;
             iBitmapPool.Remove( aHandle );
             TN_DEBUG2( "CThumbnailServer::DeleteBitmapFromPool -- items left %d", iBitmapPool.Count() );
+            OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_DELETEBITMAPFROMPOOL, "CThumbnailServer::DeleteBitmapFromPool  -- items left;iBitmapPool.Count()=%d", iBitmapPool.Count() );
             }
         else
             {
             TN_DEBUG3( 
                 "CThumbnailServer::DeleteBitmapFromPool(%d) -- refcount now %d",
                 aHandle, ptr->iRefCount );
+            OstTraceExt2( TRACE_NORMAL, DUP3_CTHUMBNAILSERVER_DELETEBITMAPFROMPOOL, "CThumbnailServer::DeleteBitmapFromPool) -- refcount now;aHandle=%d;ptr->iRefCount=%d", aHandle, ptr->iRefCount );
             }
         }
     else
@@ -654,6 +689,7 @@
         //__ASSERT_DEBUG(( EFalse ), ThumbnailPanic( EThumbnailBitmapNotReleased ));
         TN_DEBUG2( "CThumbnailServer::DeleteBitmapFromPool(%d) -- not found!",
             aHandle );
+        OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILSERVER_DELETEBITMAPFROMPOOL, "CThumbnailServer::DeleteBitmapFromPool  -- not found!;aHandle=%d", aHandle );
         }
     }
 
@@ -665,6 +701,7 @@
 void CThumbnailServer::DeleteThumbnailsL( const TDesC& aPath )
     {
     TN_DEBUG2( "CThumbnailServer::DeleteThumbnailsL(%S)", &aPath);
+    OstTraceExt1( TRACE_NORMAL, CTHUMBNAILSERVER_DELETETHUMBNAILSL, "CThumbnailServer::DeleteThumbnailsL;aPath=%S", aPath );
     
     StoreForPathL( aPath )->DeleteThumbnailsL( aPath );
     
@@ -700,6 +737,7 @@
         {
         // cannot handle other than Oma DRM 1.x files
         TN_DEBUG1( "CThumbnailStore::ResolveMimeTypeL()- only OMA DRM 1.0 supported");
+        OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_RESOLVEMIMETYPEL, "CThumbnailServer::ResolveMimeTypeL - only OMA DRM 1.0 supported" );
         User::Leave(KErrNotSupported);
         }    
     
@@ -734,6 +772,7 @@
     TBuf < KMaxDataTypeLength > buf; // 16-bit descriptor for debug prints
     buf.Copy( aMimeType );
     TN_DEBUG2( "CThumbnailServer::ResolveProviderL(%S)", &buf );
+    OstTraceExt1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_RESOLVEMIMETYPEL, "CThumbnailServer::ResolveMimeTypeL;buf=%S", buf );
 #endif 
 
     CThumbnailProvider* ret = NULL;
@@ -758,6 +797,8 @@
 #ifdef _DEBUG
                 TN_DEBUG3( 
                     "CThumbnailServer::ResolveProviderL(%S) -- using provider 0x%08x", &buf, iPluginInfoArray[i]->ImplementationUid().iUid );
+                OstTraceExt1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_RESOLVEPROVIDERL, "CThumbnailServer::ResolveProviderL;buf=%S", buf );
+                OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_RESOLVEPROVIDERL, "CThumbnailServer::ResolveProviderL;iPluginInfoArray[i]->ImplementationUid().iUid=%o", iPluginInfoArray[i]->ImplementationUid().iUid );
 #endif 
                 ret = GetProviderL( iPluginInfoArray[i]->ImplementationUid());
                 }
@@ -769,6 +810,7 @@
         TN_DEBUG2( 
             "CThumbnailServer::ResolveProviderL(%S) -- provider not found",
             &buf );
+        OstTraceExt1( TRACE_NORMAL, CTHUMBNAILSERVER_RESOLVEPROVIDERL, "CThumbnailServer::ResolveProviderL;buf=%S", buf );
 #endif 
         User::Leave( KErrNotSupported );
         }
@@ -797,6 +839,7 @@
             aImplUid );
         res = CThumbnailProvider::NewL( aImplUid );
         TN_DEBUG1( "CThumbnailServer::GetProviderL() -- loading complete" );
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_GETPROVIDERL, "CThumbnailServer::GetProviderL -- loading complete" );
         CleanupStack::PushL( res );
         iProviders.InsertL( aImplUid.iUid, res );
         CleanupStack::Pop( res );
@@ -813,6 +856,7 @@
 void CThumbnailServer::PreLoadProviders(  )
     {
     TN_DEBUG1( "CThumbnailServer::PreLoadProvidersL()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_PRELOADPROVIDERS, "CThumbnailServer::PreLoadProviders" );
     TInt err(KErrNone);
     
     for(TInt i=0; i< iPluginInfoArray.Count(); i++)
@@ -852,6 +896,7 @@
     while ( ref )
         {       
         TN_DEBUG2( "CThumbnailServer::DequeTask() - ref->iRequestId = %d", ref->iRequestId );
+        OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_DEQUETASK, "CThumbnailServer::DequeTask;ref->iRequestId=%u", ref->iRequestId );
 
         if ( ref->iSession == aRequestId.iSession && 
              ref->iRequestId == aRequestId.iRequestId )
@@ -861,6 +906,7 @@
                         
             TN_DEBUG2( "CThumbnailServer::DequeTask() - deleted bitmap, left=%d", 
                     iBitmapPool.Count());
+            OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_DEQUETASK, "CThumbnailServer::DequeTask;iBitmapPool.Count()=%d", iBitmapPool.Count() );
             }
         
         ref = bpiter.NextValue();        
@@ -932,10 +978,12 @@
 CThumbnailStore* CThumbnailServer::StoreForDriveL( const TInt aDrive )
     {
     TN_DEBUG2( "CThumbnailServer::StoreForDriveL() drive=%d", aDrive );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL;aDrive=%d", aDrive );
     
     if(iUnmountedDrives.Find( aDrive ) >= KErrNone)
         {
         TN_DEBUG1( "CThumbnailServer::StoreForDriveL() unmount in progress, skip!");
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL - unmount in progress, skip!" );
         User::Leave( KErrDisMounted );
         }
     
@@ -951,6 +999,7 @@
         if( iFormatting )
            {
            TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - FORMATTING! - ABORT");
+           OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL - FORMATTING! - ABORT" );
            User::Leave( KErrNotSupported );
            } 
         
@@ -961,11 +1010,13 @@
             {
             // Locked
             TN_DEBUG2( "CThumbnailServer::StoreForDriveL() - err %d", err);
+            OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL;err=%d", err );
             User::Leave( err);
             }
         else if( volumeInfo.iDrive.iMediaAtt& KMediaAttLocked )
             {
             TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - locked");
+            OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL - locked" );
             User::Leave( KErrAccessDenied );
             }
 		else if ( volumeInfo.iDrive.iDriveAtt& KDriveAttRom ||
@@ -974,11 +1025,13 @@
             {
             // We support ROM disks and remote disks in read only mode.
             TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - rom/remote/write protected");
+            OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL - rom/remote/write protected" );
             res = CThumbnailStore::NewL( iFs, aDrive, iImei, this, ETrue );
             }
         else
             {
             TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - normal");
+            OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL - normal" );
             res = CThumbnailStore::NewL( iFs, aDrive, iImei, this, EFalse );
             }
 			
@@ -1006,6 +1059,7 @@
     if(aPath.Length() < 3 || aPath.Length() > KMaxPath)
         {
         TN_DEBUG1( "CThumbnailServer::StoreForPathL() - KErrArgument");
+        OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_STOREFORPATHL, "CThumbnailServer::StoreForPathL - KErrArgument" );
         User::Leave(KErrArgument);
         }
     TInt drive = 0;
@@ -1050,6 +1104,7 @@
             if (!err)
                 {
                 TN_DEBUG2( "CThumbnailServer::OpenStoresL() StoreForDriveL %d", i);
+                OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_OPENSTORESL, "CThumbnailServer::OpenStoresL;i=%d", i );
                 
                 // ignore errors
                 TRAP_IGNORE( StoreForDriveL( i ));
@@ -1068,6 +1123,7 @@
 void CThumbnailServer::CloseStoreForDriveL( const TInt aDrive )
     {
     TN_DEBUG2( "CThumbnailServer::CloseStoreForDriveL drive=%d", aDrive);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_CLOSESTOREFORDRIVEL, "CThumbnailServer::CloseStoreForDriveL;aDrive=%d", aDrive );
     CThumbnailStore** store = iStores.Find( aDrive );
     
     StartUnmountTimeout( aDrive);
@@ -1134,6 +1190,7 @@
         if (!err && driveInfo.iDriveAtt& KDriveAttRemovable)
             {
             TN_DEBUG2( "CThumbnailServer::AddOnMountObserver drive=%d", drive);
+            OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_ADDUNMOUNTOBSERVERSL, "CThumbnailServer::AddUnmountObserversL;drive=%d", drive );
             CThumbnailDiskUnmountObserver* obs = CThumbnailDiskUnmountObserver::NewL( iFs, drive, this );
             CleanupStack::PushL( obs );
             iUnmountObservers.AppendL( obs );
@@ -1149,6 +1206,7 @@
 void CThumbnailServer::MemoryCardStatusChangedL()
     {
     TN_DEBUG1( "CThumbnailServer::MemoryCardStatusChangedL in()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL - in" );
     TDriveList driveList;
     TInt drive; 
     TVolumeInfo volumeInfo;
@@ -1174,20 +1232,30 @@
                 && driveInfo.iDriveAtt& KDriveAttRemovable )
             {
             TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL mount drive==%d", drive);
+            OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL;drive=%d", drive );
             
             CThumbnailStore** resPtr = iStores.Find( drive );
 
             if ( resPtr )
                 {
                 TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL() already mounted, skip %d", drive);
+                OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL;drive=%d", drive );
                 continue;
                 }
             
             // ignore errors
             TRAP_IGNORE( StoreForDriveL( drive ));
             
-            TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL() update KItemsleft == %d", KErrNotReady);
-            RProperty::Set(KTAGDPSNotification, KItemsleft, KErrNotReady );
+            TUint driveStatus(0);
+            DriveInfo::GetDriveStatus(iFs, drive, driveStatus);
+            TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL() driveStatus = %d", driveStatus);
+            if (!(driveStatus & DriveInfo::EDriveUsbMemory) && 
+			    !(driveStatus & DriveInfo::EDriveRemote))
+                {
+                TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL() update KItemsleft = %d", KErrNotReady);
+                OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL;KErrNotReady=%d - update KItemsleft", KErrNotReady );
+                RProperty::Set(KTAGDPSNotification, KItemsleft, KErrNotReady );
+                }
 			
             TInt index = iUnmountedDrives.Find( drive );
             
@@ -1199,6 +1267,7 @@
             if(!iUnmountedDrives.Count()&& iUnmount && iUnmount->IsActive())
                 {
                 TN_DEBUG1( "CThumbnailServer::MemoryCardStatusChangedL() cancel unmount timer");
+                OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL - cancel unmount timer" );
                 iUnmount->Cancel();
                 }
             }
@@ -1207,11 +1276,13 @@
         else if(err && !err_drive && driveInfo.iDriveAtt& KDriveAttRemovable )
             {
             TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL() unmount drive==%d", drive);
+            OstTrace1( TRACE_NORMAL, DUP5_CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL - unmount drive;drive=%d", drive );
             CloseStoreForDriveL( drive);
             }
         }
 
     TN_DEBUG1( "CThumbnailServer::MemoryCardStatusChangedL out()" );
+    OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL - out" );
     }
 
 
@@ -1270,66 +1341,56 @@
                                            const TInt /*aOrientation*/, const TInt64 aModified )
     {
     TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL" );
     
     // 1. check path change
-    // 2. check orientation change
-    // 3. check timestamp change
-
-    TBool orientationChanged = EFalse;
+    // 2. check timestamp change
     TBool modifiedChanged = EFalse;
     
     CThumbnailStore* store = StoreForPathL( aPath );
    
-    // placeholder for orientation check
-    orientationChanged = EFalse;
-    
-    if (orientationChanged)
+    TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - exist");
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL - exist" );
+        
+    TBool exists = store->CheckModifiedByPathL(aPath, aModified, modifiedChanged);
+       
+    if(!exists)
         {
-        TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - orientation updated");
-        
-        // orientation updated, no need to check further
-        return ETrue;
+        TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - exists NO");
+    	OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL - exists NO" );
+        //not found, needs to be generated
+        return EFalse;
+        }
+    
+    TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - modified ?");
+    OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL - modified ?" );
+    
+    if (modifiedChanged)
+        {
+        TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - modified YES");
+        OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL - modified YES" );
+            
+        // delete old thumbs
+        store->DeleteThumbnailsL(aPath, ETrue);
+            
+        if( iFetchedChecker ) 
+            {
+            iFetchedChecker->DeleteFetchResult( aPath );
+            }
+            
+        // need to create new thumbs
         }
     else
         {
-        TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - exist");
-        
-        TBool exists = store->CheckModifiedByPathL(aPath, aModified, modifiedChanged);
-       
-        if(!exists)
-            {
-            TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - exists NO");
-            //not found, needs to be generated
-            return EFalse;
-            }
-        
-        TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - modified ?");
+        TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - modified NO");
+        OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL - modified NO" );
         
-        if (modifiedChanged)
-            {
-            TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - modified YES");
-            
-            // delete old thumbs
-            store->DeleteThumbnailsL(aPath, ETrue);
-            
-            if( iFetchedChecker ) 
-                {
-                iFetchedChecker->DeleteFetchResult( aPath );
-                }
-            
-            // need to create new thumbs
-            }
-        else
-            {
-            TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - modified NO");
-            
-            // not modified
-            return ETrue;
-            }
+        // not modified
+        return ETrue;
         }
-  
     
     TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - no thumbs found, create new");
+    OstTrace0( TRACE_NORMAL, DUP7_CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL - no thumbs found, create new" );
     
     return EFalse;
     }
@@ -1341,6 +1402,7 @@
 void CThumbnailServer::RenameThumbnailsL( const TDesC& aCurrentPath, const TDesC& aNewPath )
     {
     TN_DEBUG2( "CThumbnailServer::RenameThumbnailsL(%S)", &aCurrentPath);
+    OstTraceExt1( TRACE_NORMAL, CTHUMBNAILSERVER_RENAMETHUMBNAILSL, "CThumbnailServer::RenameThumbnailsL;aCurrentPath=%S", aCurrentPath );
     
     StoreForPathL( aCurrentPath )->RenameThumbnailsL( aCurrentPath, aNewPath );
     
@@ -1418,10 +1480,14 @@
     else if ( ext.CompareF( K3gpExt ) == 0 )
         {
         aMimeType = TDataType( KVideo3gppMime );
+        return KErrNotFound; 
+        // 3gp can contain video or audio, should go to recognizer
         } 
     else if ( ext.CompareF( K3gppExt ) == 0 )
         {
         aMimeType = TDataType( KVideo3gppMime );
+        return KErrNotFound; 
+        // 3gp can contain video or audio, should go to recognizer
         }
     else if ( ext.CompareF( KAmrExt ) == 0 )
         {
@@ -1625,6 +1691,7 @@
         TN_DEBUG2( 
             "CThumbnailServer::E32Main() -- thread function out, result=%d",
             result );
+        OstTrace1( TRACE_NORMAL, _E32MAIN, "::E32Main;result=%d - thread function out", result );
         delete cleanup;
         cleanup = NULL;
         }
@@ -1632,8 +1699,10 @@
         {
         // Signal the client that server creation failed
         TN_DEBUG1( "CThumbnailServer::E32Main() -- Rendezvous() in" );
+        OstTrace0( TRACE_NORMAL, DUP2__E32MAIN, "::E32Main - in" );
         RProcess::Rendezvous( result );
         TN_DEBUG1( "CThumbnailServer::E32Main() -- Rendezvous() out" );
+        OstTrace0( TRACE_NORMAL, DUP1__E32MAIN, "::E32Main - out" );
         }
 
     __UHEAP_MARKEND;
@@ -1668,6 +1737,7 @@
         if (!err && driveInfo.iDriveAtt& KDriveAttRemovable)
             {
             TN_DEBUG2( "CThumbnailServer::CloseRemovableDrive drive=%d", drive);
+            OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_CLOSEREMOVABLEDRIVESL, "CThumbnailServer::CloseRemovableDrivesL;drive=%d", drive );
             CloseStoreForDriveL(drive);
             }
         }
@@ -1702,6 +1772,7 @@
         if (!err && driveInfo.iDriveAtt& KDriveAttRemovable)
             {
             TN_DEBUG2( "CThumbnailServer::OpenRemovableDrive drive=%d", drive);
+            OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_OPENREMOVABLEDRIVESL, "CThumbnailServer::OpenRemovableDrivesL;drive=%d", drive );
             StoreForDriveL(drive);
             }
         }
@@ -1724,6 +1795,7 @@
 void CThumbnailServer::FormatNotification( TBool aFormat )
     {
     TN_DEBUG2( "CThumbnailServer::FormatNotification(%d)", aFormat );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_FORMATNOTIFICATION, "CThumbnailServer::FormatNotification;aFormat=%d", aFormat );
     
     if(aFormat)
         {
@@ -1742,6 +1814,7 @@
 TInt CThumbnailServer::ReconnectCallBack(TAny* aAny)
     {
     TN_DEBUG1( "CThumbnailServer::ReconnectCallBack() - reconnect");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_RECONNECTCALLBACK, "CThumbnailServer::ReconnectCallBack - reconnect" );
     
     CThumbnailServer* self = static_cast<CThumbnailServer*>( aAny );
     
@@ -1758,6 +1831,7 @@
     self->iSessionError = EFalse;
     
     TN_DEBUG1( "CThumbAGDaemon::ReconnectCallBack() - done");
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_RECONNECTCALLBACK, "CThumbnailServer::ReconnectCallBack - done" );
     
     return KErrNone;
     }
@@ -1774,6 +1848,7 @@
     if ( pos == 1 )
         {
         TN_DEBUG1( "CThumbnailServer::IsPublicPath() NO");
+        OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_ISPUBLICPATH, "CThumbnailServer::IsPublicPath - NO" );
         return EFalse;
         }
     
@@ -1781,6 +1856,7 @@
     if ( pos == 1 )
         {
         TN_DEBUG1( "CThumbnailServer::IsPublicPath() NO");
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_ISPUBLICPATH, "CThumbnailServer::IsPublicPath - NO" );
         return EFalse;
         }
     
@@ -1794,6 +1870,7 @@
 void CThumbnailServer::StartUnmountTimeout( const TInt aDrive)
     {
     TN_DEBUG2( "CThumbnailServer::StartUnmountTimeout(%d)", aDrive);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_STARTUNMOUNTTIMEOUT, "CThumbnailServer::StartUnmountTimeout;aDrive=%d", aDrive );
     
     if(iUnmount )
         {
@@ -1808,6 +1885,7 @@
            }
        
        TN_DEBUG1( "CThumbnailServer::StartUnmountTimeout() start unmount timer");
+       OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_STARTUNMOUNTTIMEOUT, "CThumbnailServer::StartUnmountTimeout - start unmount timer" );
        iUnmount->Start( KUnmountTimerTimeout, KUnmountTimerTimeout, TCallBack(UnmountCallBack, this));
        }
        __ASSERT_DEBUG(( iUnmount ), ThumbnailPanic( EThumbnailNullPointer ));
@@ -1821,6 +1899,7 @@
 TInt CThumbnailServer::UnmountCallBack(TAny* aAny)
     {
     TN_DEBUG1( "CThumbnailServer::UnmountCallBack() - unmount finished");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_UNMOUNTCALLBACK, "CThumbnailServer::UnmountCallBack - unmount finished" );
     
     CThumbnailServer* self = static_cast<CThumbnailServer*>( aAny );
     
@@ -1829,6 +1908,7 @@
     self->iUnmountedDrives.Reset();
     
     TN_DEBUG1( "CThumbAGDaemon::UnmountCallBack() - done");
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_UNMOUNTCALLBACK, "CThumbnailServer::UnmountCallBack - done" );
     
     return KErrNone;
     }
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserversession.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserversession.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -31,6 +31,11 @@
 #include "thumbnailpanic.h"
 
 #include "thumbnailcenrep.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailserversessionTraces.h"
+#endif
+
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -161,6 +166,7 @@
 void CThumbnailServerSession::CreateL()
     {
     TN_DEBUG2( "CThumbnailServerSession::AddSession() = 0x%08x", this );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_CREATEL, "CThumbnailServerSession::CreateL;this=%o", this );
     
     Server()->AddSession();
     }
@@ -174,6 +180,7 @@
 void CThumbnailServerSession::ServiceL( const RMessage2& aMessage )
     {
     TN_DEBUG1( "CThumbnailServerSession::ServiceL() - begin" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_SERVICEL, "CThumbnailServerSession::ServiceL - begin" );
     
     __ASSERT_DEBUG( !iMessage.Handle(), ThumbnailPanic(EThumbnailMessageNotCompleted));
     if ( iMessage.Handle())
@@ -191,6 +198,7 @@
         if (err != KErrNone)
             {
             TN_DEBUG1( "CThumbnailServerSession::ServiceL() - client thread not found");
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_SERVICEL, "CThumbnailServerSession::ServiceL - client thread not found" );
     
             iMessage = RMessage2();
             }       
@@ -198,6 +206,7 @@
     else
         {
         TN_DEBUG1( "CThumbnailServerSession::ServiceL() - message null");
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSERVERSESSION_SERVICEL, "CThumbnailServerSession::ServiceL - message null" );
         }
     
     // clean up possible trash
@@ -231,6 +240,7 @@
     iClientThread.Close();
     
     TN_DEBUG1( "CThumbnailServerSession::ServiceL() - end" );
+    OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSERVERSESSION_SERVICEL, "CThumbnailServerSession::ServiceL - end" );
     }
 
 
@@ -261,6 +271,7 @@
 void CThumbnailServerSession::UpdateThumbnailsL( const RMessage2& aMessage )
     {
     TN_DEBUG1( "CThumbnailServerSession::UpdateThumbnailsL()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_UPDATETHUMBNAILSL, "CThumbnailServerSession::UpdateThumbnailsL" );
     
     if(aMessage.Int1() != KCheckValue)
        {
@@ -291,8 +302,26 @@
         TInt sourceType = 0;
         TInt err = Server()->MimeTypeFromFileExt( params.iFileName, mimeType );
         
+        // need to use recognizer
+        if (err == KErrNotFound)
+            {
+            Server()->Fs().ShareProtected();
+            RFile64 file;
+            CleanupClosePushL( file );
+          
+            User::LeaveIfError( file.Open( Server()->Fs(), params.iFileName, EFileShareReadersOrWriters )); 
+            TN_DEBUG2( "CThumbnailServerSession::UpdateThumbnailsL - file handle opened for %S", &params.iFileName );
+          
+            mimeType = Server()->ResolveMimeTypeL(file);
+          
+            file.Close();
+            TN_DEBUG1("CThumbnailServerSession::UpdateThumbnailsL - file handle closed");
+          
+            CleanupStack::Pop( &file );    
+            }
+        
         // get missing sizes
-        if ( err == KErrNone && ( params.iControlFlags & EThumbnailGeneratePersistentSizesOnly ) != 0 )
+        if ( ( params.iControlFlags & EThumbnailGeneratePersistentSizesOnly ) != 0 )
             {
             sourceType = Server()->SourceTypeFromMimeType( mimeType );
             
@@ -313,10 +342,12 @@
         if(!missingSizes)
             {
             TN_DEBUG1( "CThumbnailServerSession::UpdateThumbnailsL() - finished part 1" );
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_UPDATETHUMBNAILSL, "CThumbnailServerSession::UpdateThumbnailsL - finished part 1" );
             aMessage.Complete( KErrNone );
             }
         else
             {
+            OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSERVERSESSION_UPDATETHUMBNAILSL, "CThumbnailServerSession::UpdateThumbnailsL  - some sizes missing..." );
             TN_DEBUG1( "CThumbnailServerSession::UpdateThumbnailsL() - some sizes missing..." ); 
             }
         }
@@ -324,6 +355,7 @@
     if (missingSizes || !finished)
         {
         TN_DEBUG1( "CThumbnailServerSession::UpdateThumbnailsL() - need to create (some) thumbs" );
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSERVERSESSION_UPDATETHUMBNAILSL, "CThumbnailServerSession::UpdateThumbnailsL - need to create (some) thumbs" );
         
         if(missingSizes)
             {
@@ -343,6 +375,7 @@
     else
         {
         TN_DEBUG1( "CThumbnailServerSession::UpdateThumbnailsL() - finished part 2" );
+        OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSERVERSESSION_UPDATETHUMBNAILSL, "CThumbnailServerSession::UpdateThumbnailsL - finished part 2" );
         }
     
     iMessage = RMessage2();
@@ -358,6 +391,7 @@
     if(aMessage.Int1() != KCheckValue)
        {
        TN_DEBUG1( "CThumbnailServerSession::RenameThumbnailsL() - error in aMessage - leaving" );
+       OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_RENAMETHUMBNAILSL, "CThumbnailServerSession::RenameThumbnailsL - error in aMessage - leaving" );
        User::Leave(KErrArgument);
        }
     
@@ -397,6 +431,7 @@
     if(aMessage.Int1() != KCheckValue)
        {
        TN_DEBUG1( "CThumbnailServerSession::RequestThumbByIdAsync() - error in aMessage - leaving" );
+       OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYIDASYNCL, "CThumbnailServerSession::RequestThumbByIdAsyncL - leaving" );
        User::Leave(KErrArgument);
        }
 
@@ -423,10 +458,13 @@
     
 #ifdef _DEBUG
     aStop.UniversalTime();
+    TInt tookTime = (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000;
     TN_DEBUG2( "CThumbnailServerSession::RequestThumbByIdAsyncL() request took %d ms", (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000 );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYIDASYNCL, "CThumbnailServerSession::RequestThumbByIdAsyncL;tookTime=%d", tookTime );
 #endif 
     
     TN_DEBUG1("CThumbnailServerSession::RequestThumbByIdAsyncL() - end" );
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYIDASYNCL, "CThumbnailServerSession::RequestThumbByIdAsyncL - end" );
     }
 
 // -----------------------------------------------------------------------------
@@ -437,10 +475,12 @@
     aMessage )
     {
     TN_DEBUG1( "CThumbnailServerSession::RequestThumbByFileHandleAsyncL()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYFILEHANDLEASYNCL, "CThumbnailServerSession::RequestThumbByFileHandleAsyncL" );
     
     if(aMessage.Int1() != KCheckValue)
        {
        TN_DEBUG1( "CThumbnailServerSession::RequestThumbByFileHandleAsync() - error in aMessage - leaving" );
+       OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYFILEHANDLEASYNCL, "CThumbnailServerSession::RequestThumbByFileHandleAsyncL - error in aMessage - leaving" );
        User::Leave(KErrArgument);
        }
     
@@ -472,6 +512,7 @@
     if (params.iControlFlags == EThumbnailGeneratePersistentSizesOnly)
         {
         TN_DEBUG1( "CThumbnailServerSession::RequestThumbByFileHandleAsyncL() - EThumbnailGeneratePersistentSizesOnly" );
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYFILEHANDLEASYNCL, "CThumbnailServerSession::RequestThumbByFileHandleAsyncL - EThumbnailGeneratePersistentSizesOnly" );
         CreateGenerateTaskFromFileHandleL( &file );
         
         // ownership of the file transferred
@@ -486,6 +527,7 @@
             {
             // If thumbnail of requested size is blacklisted, fetching is left with KErrCompletion
             TN_DEBUG1( "CThumbnailServerSession::RequestThumbByFileHandleAsyncL() - thumbnail blacklisted" );
+            OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYFILEHANDLEASYNCL, "CThumbnailServerSession::RequestThumbByFileHandleAsyncL - thumbnail blacklisted" );
             
             aMessage.Complete( err );
             iMessage = RMessage2();
@@ -496,10 +538,12 @@
         else if ( !err && iBitmap )
             {
             TN_DEBUG1( "CThumbnailServerSession::RequestThumbByFileHandleAsyncL() - found existing thumbnail - bitmap " );
+            OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYFILEHANDLEASYNCL, "CThumbnailServerSession::RequestThumbByFileHandleAsyncL - found existing thumbnail - bitmap " );
 
             // Thumbnail already stored
             CleanupStack::PopAndDestroy(&file);
             TN_DEBUG1("CThumbnailServerSession::RequestThumbByFileHandleAsyncL - file handle closed");
+            OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYFILEHANDLEASYNCL, "CThumbnailServerSession::RequestThumbByFileHandleAsyncL - file handle closed" );
 
             ProcessBitmapL();
             }
@@ -507,6 +551,7 @@
                  !(params.iFlags& CThumbnailManager::EDoNotCreate) )
             {
             TN_DEBUG1( "CThumbnailServerSession::RequestThumbByFileHandleAsyncL() - KErrNotFound & !EDoNotCreate" );
+            OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYFILEHANDLEASYNCL, "CThumbnailServerSession::RequestThumbByFileHandleAsyncL - KErrNotFound & !EDoNotCreate" );
             CreateGenerateTaskFromFileHandleL( &file);
             
             // ownership of the file transferred
@@ -515,6 +560,7 @@
         else if (!err && iBuffer)
             {
             TN_DEBUG1( "CThumbnailServerSession::RequestThumbByFileHandleAsyncL() - found existing thumbnail - jpeg " );
+            OstTrace0( TRACE_NORMAL, DUP7_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYFILEHANDLEASYNCL, "CThumbnailServerSession::RequestThumbByFileHandleAsyncL - found existing thumbnail - jpeg" );
             
             CThumbnailDecodeTask* task = new( ELeave )CThumbnailDecodeTask( Server()
                         ->Processor(), * Server(), iBuffer, params.iPriority, params.iDisplayMode );
@@ -533,10 +579,12 @@
             // close file
             CleanupStack::PopAndDestroy(&file);
             TN_DEBUG1("CThumbnailServerSession::RequestThumbByFileHandleAsyncL - file handle closed");
+            OstTrace0( TRACE_NORMAL, DUP8_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYFILEHANDLEASYNCL, "CThumbnailServerSession::RequestThumbByFileHandleAsyncL - file handle closed" );
             }
         else
             {
             TN_DEBUG2( "CThumbnailServerSession::RequestThumbByFileHandleAsyncL() - thumbnail not found, err=%d", err );
+            OstTrace1( TRACE_NORMAL, DUP9_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYFILEHANDLEASYNCL, "CThumbnailServerSession::RequestThumbByFileHandleAsyncL - thumbnail not found;err=%d", err );
             
             aMessage.Complete( ConvertSqlErrToE32Err( err ));
             iMessage = RMessage2();
@@ -555,6 +603,7 @@
     aMessage )
     {
     TN_DEBUG1( "CThumbnailServerSession::RequestThumbByPathAsyncL()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYPATHASYNCL, "CThumbnailServerSession::RequestThumbByPathAsyncL" );
     
 #ifdef _DEBUG
     TTime aStart, aStop;
@@ -564,6 +613,7 @@
     if(aMessage.Int1() != KCheckValue)
        {
        TN_DEBUG1( "CThumbnailServerSession::RequestThumbByPathAsync() - error in aMessage - leaving" );
+       OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYPATHASYNCL, "CThumbnailServerSession::RequestThumbByPathAsyncL - error in aMessage - leaving" );
        User::Leave(KErrArgument);
        }
 
@@ -590,6 +640,7 @@
 	        {
 	        TN_DEBUG1( 
 	            "CThumbnailServerSession::RequestThumbByPathAsyncL() - found existing thumbnail- bitmap" );
+	        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYPATHASYNCL, "CThumbnailServerSession::RequestThumbByPathAsyncL - found existing thumbnail- bitmap" );
 
 	        ProcessBitmapL();
 	        }
@@ -597,6 +648,7 @@
 	        {
 	        TN_DEBUG1( 
 	            "CThumbnailServerSession::RequestThumbByPathAsyncL() - found existing thumbnail- jpeg" );
+	        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYPATHASYNCL, "CThumbnailServerSession::RequestThumbByPathAsyncL - found existing thumbnail- jpeg" );
 	        
 	        CThumbnailDecodeTask* task = new( ELeave )CThumbnailDecodeTask( Server()
 	               ->Processor(), * Server(), iBuffer, params.iPriority, params.iDisplayMode );
@@ -616,6 +668,7 @@
 	        {
             // If thumbnail of requested size is blacklisted, fetching is left with KErrCompletion
             TN_DEBUG1( "CThumbnailServerSession::RequestThumbByPathAsyncL() - thumbnail blacklisted" );
+            OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYPATHASYNCL, "CThumbnailServerSession::RequestThumbByPathAsyncL - thumbnail blacklisted" );
             
             aMessage.Complete( err );
             iMessage = RMessage2();
@@ -624,6 +677,7 @@
 	        {
 	        TN_DEBUG2( 
 	            "CThumbnailServerSession::RequestThumbByPathAsyncL() - thumbnail not found, err = %d", err );
+	        OstTrace1( TRACE_NORMAL, DUP5_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYPATHASYNCL, "CThumbnailServerSession::RequestThumbByPathAsyncL  - thumbnail not found;err=%d", err );
 	        
 	        // don't try to create from virtual URI
 	        if ( params.iVirtualUri )
@@ -652,17 +706,21 @@
     
 #ifdef _DEBUG
     aStop.UniversalTime();
+    TInt tookTime = (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000;
     TN_DEBUG2( "CThumbnailStore::RequestThumbByPathAsyncL() request took %d ms", (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000 );
+    OstTrace1( TRACE_NORMAL, DUP6_CTHUMBNAILSERVERSESSION_REQUESTTHUMBBYPATHASYNCL, "CThumbnailServerSession::RequestThumbByPathAsyncL;tookTime=%d", tookTime );
 #endif
     }   
     
 void CThumbnailServerSession::RequestSetThumbnailByBufferL( const RMessage2& aMessage )
     {
     TN_DEBUG1( "CThumbnailServerSession::RequestSetThumbnailByBufferL()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_REQUESTSETTHUMBNAILBYBUFFERL, "CThumbnailServerSession::RequestSetThumbnailByBufferL" );
     
     if(aMessage.Int3() != KCheckValue)
         {
         TN_DEBUG1( "CThumbnailServerSession::RequestSetThumbnailByBufferL() - error in aMessage - leaving" );
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_REQUESTSETTHUMBNAILBYBUFFERL, "CThumbnailServerSession::RequestSetThumbnailByBufferL - error in aMessage - leaving" );
         User::Leave(KErrArgument);
         }
       
@@ -707,10 +765,12 @@
 void CThumbnailServerSession::RequestSetThumbnailByBitmapL( const RMessage2& aMessage )
     {
     TN_DEBUG1( "CThumbnailServerSession::RequestSetThumbnailByBitmapL()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_REQUESTSETTHUMBNAILBYBITMAPL, "CThumbnailServerSession::RequestSetThumbnailByBitmapL" );
 
     if(aMessage.Int2() != KCheckValue)
         {
         TN_DEBUG1( "CThumbnailServerSession::RequestSetThumbnailByBitmapL() - error in aMessage - leaving" );
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_REQUESTSETTHUMBNAILBYBITMAPL, "CThumbnailServerSession::RequestSetThumbnailByBitmapL - error in aMessage - leaving" );
         User::Leave(KErrArgument);
         }
         
@@ -808,6 +868,7 @@
                    (*missingSizes)[i].iSize.iWidth = height;
                     
                    TN_DEBUG1( "CThumbnailServerSession::RequestSetThumbnailByBitmapL() - portrait");
+                   OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSERVERSESSION_REQUESTSETTHUMBNAILBYBITMAPL, "CThumbnailServerSession::RequestSetThumbnailByBitmapL - portrait" );
                    }
                }
         
@@ -862,6 +923,7 @@
 
     TN_DEBUG2( 
         "CThumbnailServerSession::CreateGenerateTaskFromFileHandleL() -- create thumbnail generation task for %S", &params.iFileName );
+    OstTraceExt1( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_CREATEGENERATETASKFROMFILEHANDLEL, "CThumbnailServerSession::CreateGenerateTaskFromFileHandleL -- create thumbnail generation task for;params.iFileName=%S", params.iFileName );
     
     // disk space check only for stored sizes
     if ( params.iImport && 
@@ -947,6 +1009,7 @@
     if( !aFile)
         {
         TN_DEBUG1("CThumbnailServerSession::CreateGenerateTaskFromFileHandleL() - KErrArgument");
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_CREATEGENERATETASKFROMFILEHANDLEL, "CThumbnailServerSession::CreateGenerateTaskFromFileHandleL - KErrArgument" );
         User::Leave( KErrArgument );
         }
     CleanupClosePushL( *aFile );
@@ -989,6 +1052,7 @@
 
     TN_DEBUG2( 
         "CThumbnailServerSession::CreateGenerateTaskFromBufferL() -- create thumbnail generation task for %S", &params.iTargetUri );
+    OstTraceExt1( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_CREATEGENERATETASKFROMBUFFERL, "CThumbnailServerSession::CreateGenerateTaskFromBufferL -  -- create thumbnail generation task for;params.iTargetUri=%S", params.iTargetUri );
   
     // disk space check only for stored sizes
     if ( params.iThumbnailSize != ECustomThumbnailSize && 
@@ -1014,11 +1078,13 @@
         
         User::LeaveIfError( file.Open( Server()->Fs(), params.iTargetUri, EFileShareReadersOrWriters )); 
         TN_DEBUG2( "CThumbnailServerSession::CreateGenerateTaskFromBufferL - file handle opened for %S", &params.iFileName );
+                OstTraceExt1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_CREATEGENERATETASKFROMBUFFERL, "CThumbnailServerSession::CreateGenerateTaskFromBufferL;params.iFileName=%S", params.iFileName );
                 
         mimetype = Server()->ResolveMimeTypeL(file);
                 
         file.Close();
         TN_DEBUG1("CThumbnailServerSession::CreateGenerateTaskFromBufferL - file handle closed");
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSERVERSESSION_CREATEGENERATETASKFROMBUFFERL, "CThumbnailServerSession::CreateGenerateTaskFromBufferL - file handle closed" );
         
         CleanupStack::Pop( &file );    
         }
@@ -1062,6 +1128,7 @@
     if( !aBuffer)
         {
         TN_DEBUG1( "CThumbnailServerSession::UpdateThumbnailsL() - KErrArgument" );
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSERVERSESSION_CREATEGENERATETASKFROMBUFFERL, "CThumbnailServerSession::CreateGenerateTaskFromBufferL - KErrArgument" );
         User::Leave( KErrArgument );
         }
     
@@ -1098,6 +1165,7 @@
 void CThumbnailServerSession::FetchThumbnailL()
     {
     TN_DEBUG1("CThumbnailServerSession::FetchThumbnailL()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_FETCHTHUMBNAILL, "CThumbnailServerSession::FetchThumbnailL" );
     __ASSERT_DEBUG( !iBitmap, ThumbnailPanic( EThumbnailBitmapNotReleased ));
     __ASSERT_DEBUG( !iBuffer, ThumbnailPanic( EThumbnailBitmapNotReleased ));
 
@@ -1119,6 +1187,7 @@
         {
         TN_DEBUG3( "CThumbnailServerSession::FetchThumbnailL( ThumbnailSize=%d ( Path=%S ))", 
                  params.iThumbnailSize, &params.iFileName );
+        OstTraceExt1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_FETCHTHUMBNAILL, "CThumbnailServerSession::FetchThumbnailL;params.iFileName=%S", params.iFileName );
         Server()->FetchThumbnailL( params.iFileName, iBitmap, iBuffer, params.iThumbnailSize, iOriginalSize);
         }
     else
@@ -1129,6 +1198,7 @@
     if( iBitmap)
         {
         TN_DEBUG4( "CThumbnailServerSession::FetchThumbnailL() size %d x %d displaymode %d", iBitmap->SizeInPixels().iWidth, iBitmap->SizeInPixels().iHeight, iBitmap->DisplayMode());
+        OstTraceExt3( TRACE_NORMAL, DUP2_CTHUMBNAILSERVERSESSION_FETCHTHUMBNAILL, "CThumbnailServerSession::FetchThumbnailL;iBitmap->SizeInPixels().iWidth=%d;iBitmap->SizeInPixels().iHeight=%d;iBitmap->DisplayMode()=%u", iBitmap->SizeInPixels().iWidth, iBitmap->SizeInPixels().iHeight, iBitmap->DisplayMode() );
         }
 #endif
     }
@@ -1146,6 +1216,7 @@
     if ( ClientThreadAlive() )
         {        
         TN_DEBUG2("CThumbnailServerSession::ProcessBitmapL(), iBitmap handle= 0x%08x", iBitmap->Handle());
+        OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_PROCESSBITMAPL, "CThumbnailServerSession::ProcessBitmapL;iBitmap->Handle()=%o", iBitmap->Handle() );
         
         params.iBitmapHandle = iBitmap->Handle();
         const TSize bitmapSize = iBitmap->SizeInPixels();
@@ -1163,6 +1234,7 @@
         iMessage.WriteL( 0, iRequestParams );
         
         TN_DEBUG1("CThumbnailServerSession()::ProcessBitmapL() bitmap to pool");
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_PROCESSBITMAPL, "CThumbnailServerSession::ProcessBitmapL - bitmap to pool" );
         
         Server()->AddBitmapToPoolL( this, iBitmap, TThumbnailServerRequestId( this, params.iRequestId ) );
         
@@ -1186,6 +1258,7 @@
 void CThumbnailServerSession::ReleaseBitmap( const RMessage2& aMessage )
     {
     TN_DEBUG2( "CThumbnailServerSession::ReleaseBitmap(%d)", aMessage.Int0());
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_RELEASEBITMAP, "CThumbnailServerSession::ReleaseBitmap;aMessage.Int0()=%d", aMessage.Int0() );
     Server()->DeleteBitmapFromPool( aMessage.Int0());
     }
 
@@ -1198,12 +1271,16 @@
 TInt CThumbnailServerSession::CancelRequest( const RMessage2& aMessage )
     {
     TN_DEBUG1( "CThumbnailServerSession::CancelRequest()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_CANCELREQUEST, "CThumbnailServerSession::CancelRequest" );
     
     const TThumbnailServerRequestId requestId( this, aMessage.Int0());
     const TInt err = Server()->DequeTask( requestId );
     TN_DEBUG4( 
         "CThumbnailServerSession::CancelRequest(0x%08x/%d) - returning %d",
         requestId.iSession, requestId.iRequestId, err );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_CANCELREQUEST, "CThumbnailServerSession::CancelRequest;requestId.iSession=%o", requestId.iSession );
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSERVERSESSION_CANCELREQUEST, "CThumbnailServerSession::CancelRequest;err=%d", err );
+    
     return err;
     }
 
@@ -1215,6 +1292,7 @@
 TInt CThumbnailServerSession::ChangePriority( const RMessage2& aMessage )
     {
     TN_DEBUG1( "CThumbnailServerSession::ChangePriority()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_CHANGEPRIORITY, "CThumbnailServerSession::ChangePriority" );
     
     const TThumbnailServerRequestId requestId( this, aMessage.Int0());
     const TInt newPriority = aMessage.Int1();
@@ -1223,6 +1301,9 @@
     TN_DEBUG5( 
         "CThumbnailServerSession::ChangePriority(0x%08x/%d, %d) - returning %d",
         requestId.iSession, requestId.iRequestId, newPriority, err );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_CHANGEPRIORITY, "CThumbnailServerSession::ChangePriority;requestId.iSession=%o", requestId.iSession );
+    OstTraceExt2( TRACE_NORMAL, DUP2_CTHUMBNAILSERVERSESSION_CHANGEPRIORITY, "CThumbnailServerSession::ChangePriority;requestId.iRequestId=%u;err=%d", requestId.iRequestId, err );
+    
     return err;
     }
 
@@ -1236,6 +1317,7 @@
     if(aMessage.Int2() != KCheckValue)
        {
        TN_DEBUG1( "CThumbnailServerSession::DeleteThumbnailsL() - error in aMessage - leaving" );
+       OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_DELETETHUMBNAILSL, "CThumbnailServerSession::DeleteThumbnailsL - error in aMessage - leaving" );
        User::Leave(KErrArgument);
        }
     
@@ -1259,6 +1341,7 @@
     if(aMessage.Int2() != KCheckValue)
        {
        TN_DEBUG1( "CThumbnailServerSession::DeleteThumbnailsByIdL() - error in aMessage - leaving" );
+       OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_DELETETHUMBNAILSBYIDL, "CThumbnailServerSession::DeleteThumbnailsByIdL - error in aMessage - leaving" );
        User::Leave(KErrArgument);
        }
     
@@ -1302,6 +1385,7 @@
 void CThumbnailServerSession::GetMimeTypeListL( const RMessage2& aMessage )
     {
     TN_DEBUG1( "CThumbnailServerSession::GetMimeTypeListL()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_GETMIMETYPELISTL, "CThumbnailServerSession::GetMimeTypeListL" );
     
     TInt len = aMessage.GetDesMaxLengthL( 0 );
     HBufC* buf = HBufC::NewLC( len );
@@ -1417,11 +1501,13 @@
               
                 User::LeaveIfError( file.Open( Server()->Fs(), params.iFileName, EFileShareReadersOrWriters )); 
                 TN_DEBUG2( "CThumbnailServerSession::ResolveMimeType - file handle opened for %S", &params.iFileName );
+                OstTraceExt1( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_RESOLVEMIMETYPEL, "CThumbnailServerSession::ResolveMimeTypeL - file handle opened;params.iFileName=%S", params.iFileName );
               
                 params.iMimeType = Server()->ResolveMimeTypeL(file);
               
                 file.Close();
                 TN_DEBUG1("CThumbnailServerSession::ResolveMimeType - file handle closed");
+                OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_RESOLVEMIMETYPEL, "CThumbnailServerSession::ResolveMimeTypeL - file handle closed" );
               
                 CleanupStack::Pop( &file );    
                 }    
@@ -1437,6 +1523,7 @@
 TInt CThumbnailServerSession::ConvertSqlErrToE32Err( TInt aReason )
     {
     TN_DEBUG2("CThumbnailServerSession::ConvertSqlErrToE32Err(%d)", aReason);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_CONVERTSQLERRTOE32ERR, "CThumbnailServerSession::ConvertSqlErrToE32Err;aReason=%d", aReason );
     TInt e32Err(aReason);
 	
     if ( aReason >=  - 144 )
@@ -1540,6 +1627,7 @@
 TBool CThumbnailServerSession::ClientThreadAlive()
     {
     TN_DEBUG1( "CThumbnailServerSession::ClientThreadAlive()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVERSESSION_CLIENTTHREADALIVE, "CThumbnailServerSession::ClientThreadAlive" );
     
     if ( iMessage.Handle())
         {
@@ -1549,6 +1637,7 @@
         if( exitType != EExitPending )
             {
             TN_DEBUG1( "CThumbnailServerSession::ClientThreadAlive() - client thread died");
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVERSESSION_CLIENTTHREADALIVE, "CThumbnailServerSession::ClientThreadAlive - client thread died" );
         
             iMessage = RMessage2();
             
@@ -1563,6 +1652,7 @@
     else
         {
         TN_DEBUG1( "CThumbnailServerSession::ClientThreadAlive() - message null");       
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSERVERSESSION_CLIENTTHREADALIVE, "CThumbnailServerSession::ClientThreadAlive - message null" );
         return EFalse;
         }
     }
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailstore.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailstore.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -33,6 +33,11 @@
 #include "thumbnailpanic.h"
 #include "thumbnailmanagerconstants.h"
 #include "thumbnailserver.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailstoreTraces.h"
+#endif
+
 
 
 _LIT8( KThumbnailSqlConfig, "page_size=32768; cache_size=64;" );
@@ -72,6 +77,7 @@
     if (iDatabase.InTransaction())
         {
         TN_DEBUG1( "RThumbnailTransaction::BeginL() - error: old transaction open!" );
+        OstTrace0( TRACE_NORMAL, RTHUMBNAILTRANSACTION_BEGINL, "RThumbnailTransaction::BeginL - error: old transaction open!" );
         __ASSERT_DEBUG(( !iDatabase.InTransaction() ), ThumbnailPanic( EThumbnailSQLTransaction ));
         
         // old transaction already open, don't open another
@@ -91,6 +97,7 @@
 #ifdef _DEBUG
     TPtrC errorMsg = iDatabase.LastErrorMessage();
     TN_DEBUG3( "RThumbnailTransaction::BeginL() lastError %S, ret = %d" , &errorMsg, err);
+    OstTraceExt2( TRACE_NORMAL, DUP1_RTHUMBNAILTRANSACTION_BEGINL, "RThumbnailTransaction::BeginL - lastError;errorMsg=%S;err=%d", errorMsg, err );
 #endif
         User::Leave( err );
         }
@@ -121,6 +128,7 @@
 #ifdef _DEBUG
     TPtrC errorMsg = iDatabase.LastErrorMessage();
     TN_DEBUG3( "RThumbnailTransaction::CommitL() lastError %S, ret = %d" , &errorMsg, ret);
+    OstTraceExt2( TRACE_NORMAL, DUP2_RTHUMBNAILTRANSACTION_BEGINL, "RThumbnailTransaction::BeginL - lastError;errorMsg=%S;ret=%d", errorMsg, ret );
 #endif  
     User::LeaveIfError( ret );
         }
@@ -150,6 +158,7 @@
         else
             {
             TN_DEBUG1( "RThumbnailTransaction::Rollback() - automatic rollback already done!" );
+            OstTrace0( TRACE_NORMAL, RTHUMBNAILTRANSACTION_ROLLBACK, "RThumbnailTransaction::Rollback - automatic rollback already done!" );
             }
         }
     
@@ -184,6 +193,7 @@
 CThumbnailStore::~CThumbnailStore()
     {
     TN_DEBUG2( "CThumbnailStore::~CThumbnailStore() drive: %d", iDrive );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSTORE_CTHUMBNAILSTORE, "CThumbnailStore::~CThumbnailStore;iDrive=%d", iDrive );
     
     if(iActivityManager)
         {
@@ -215,6 +225,7 @@
     iDatabase.Close();
     
     TN_DEBUG1( "CThumbnailStore::~CThumbnailStore() - database closed" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_CTHUMBNAILSTORE, "CThumbnailStore::~CThumbnailStore - database closed" );
     }
 
 // ---------------------------------------------------------------------------
@@ -237,6 +248,7 @@
 void CThumbnailStore::ConstructL()
     {
     TN_DEBUG1( "CThumbnailStore::ConstructL()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_CONSTRUCTL, "CThumbnailStore::ConstructL" );
 
 #ifdef _DEBUG
     iThumbCounter = 0;
@@ -257,6 +269,7 @@
         CleanupStack::PopAndDestroy( databasePath );
     
         TN_DEBUG2( "CThumbnailStore::ConstructL() drive: %d", iDrive );
+        OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_CONSTRUCTL, "CThumbnailStore::ConstructL;iDrive=%d", iDrive );
     
         OpenDatabaseL();
     
@@ -270,6 +283,7 @@
     else
         {
 	    TN_DEBUG1( "CThumbnailStore::ConstructL() - read only, dymmy mode..." );
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_CONSTRUCTL, "CThumbnailStore::ConstructL - read only, dymmy mode..." );
         iDeleteThumbs = EFalse;
         iCheckFilesExist = EFalse;
         iLastCheckedRowID = -1;
@@ -282,6 +296,7 @@
 TInt CThumbnailStore::OpenDatabaseFileL()
     {
     TN_DEBUG1( "CThumbnailStore::OpenDatabaseFile()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_OPENDATABASEFILEL, "CThumbnailStore::OpenDatabaseFileL" );
     
     HBufC* databasePath = HBufC::NewLC( KMaxFileName );
     TPtr pathPtr = databasePath->Des();
@@ -301,6 +316,7 @@
 TInt CThumbnailStore::OpenDatabaseL( TBool aNewDatabase )
     {
     TN_DEBUG2( "CThumbnailStore::OpenDatabaseL() drive: %d", iDrive );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSTORE_OPENDATABASEL, "CThumbnailStore::OpenDatabaseL;iDrive=%d", iDrive );
         
     CloseStatements();
     iDatabase.Close();
@@ -325,6 +341,7 @@
         err = OpenDatabaseFileL();
         
         TN_DEBUG2( "CThumbnailStore::OpenDatabaseL() -- err = %d", err);
+        OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_OPENDATABASEL, "CThumbnailStore::OpenDatabaseL;err=%d", err );
                
         if ( err == KErrNone)
             {
@@ -395,6 +412,7 @@
 void CThumbnailStore::PrepareDbL()
     {
     TN_DEBUG1( "CThumbnailStore::PrepareDbL()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_PREPAREDBL, "CThumbnailStore::PrepareDbL" );
     
     // add persistent tables
     CreateTablesL();
@@ -412,18 +430,22 @@
 void CThumbnailStore::CreateTablesL()
     {
     TN_DEBUG1( "CThumbnailStore::CreateTablesL()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_CREATETABLESL, "CThumbnailStore::CreateTablesL" );
     
     TInt err = KErrNone;
     err = iDatabase.Exec( KThumbnailCreateInfoTable );
     TN_DEBUG2( "CThumbnailStore::CreateTablesL() KThumbnailCreateInfoTable err=%d", err );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_CREATETABLESL, "CThumbnailStore::CreateTablesL - KThumbnailCreateInfoTable;err=%d", err );
     User::LeaveIfError( err );
     
     err = iDatabase.Exec( KThumbnailCreateInfoDataTable );
     TN_DEBUG2( "CThumbnailStore::CreateTablesL() KThumbnailCreateInfoDataTable err=%d", err );
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_CREATETABLESL, "CThumbnailStore::CreateTablesL - KThumbnailCreateInfoDataTable;err=%d", err );
     User::LeaveIfError( err );
     
     err = iDatabase.Exec(KThumbnailDeletedTable);
     TN_DEBUG2( "CThumbnailStore::CreateTablesL() KThumbnailDeletedTable err=%d", err );
+    OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSTORE_CREATETABLESL, "CThumbnailStore::CreateTablesL - KThumbnailDeletedTable;err=%d", err );
     User::LeaveIfError( err );
     
     err = iDatabase.Exec( KThumbnailCreateInfoTableIndex1 );
@@ -432,6 +454,7 @@
     
     err = iDatabase.Exec(KThumbnailVersionTable);
     TN_DEBUG2( "CThumbnailStore::CreateTablesL() KThumbnailVersionTable err=%d", err );
+    OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILSTORE_CREATETABLESL, "CThumbnailStore::CreateTablesL;err=%d", err );
     User::LeaveIfError( err );
     }
 
@@ -442,6 +465,7 @@
 void CThumbnailStore::CreateTempTablesL()
     {
     TN_DEBUG1( "CThumbnailStore::CreateTempTablesL()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_CREATETEMPTABLESL, "CThumbnailStore::CreateTempTablesL" );
 
     TInt err = iDatabase.Exec( KThumbnailCreateTempInfoTable );
 
@@ -450,6 +474,7 @@
         {
         TPtrC errorMsg = iDatabase.LastErrorMessage();
         TN_DEBUG2( "CThumbnailStore::PrepareDbL() KThumbnailCreateTempInfoTable %S" , &errorMsg);
+        OstTraceExt1( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_CREATETEMPTABLESL, "CThumbnailStore::CreateTempTablesL - KThumbnailCreateTempInfoTable;errorMsg=%S", errorMsg );
         }
 #endif
     
@@ -462,6 +487,7 @@
         {
         TPtrC errorMsg = iDatabase.LastErrorMessage();
         TN_DEBUG2( "CThumbnailStore::PrepareDbL() KThumbnailCreateTempInfoDataTable %S" , &errorMsg);
+        OstTraceExt1( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_CREATETEMPTABLESL, "CThumbnailStore::CreateTempTablesL - KThumbnailCreateTempInfoDataTable;errorMsg=%S", errorMsg );
         }
 #endif
     
@@ -471,6 +497,7 @@
 void CThumbnailStore::RecreateDatabaseL(const TBool aDelete)
     {
     TN_DEBUG2( "CThumbnailStore::RecreateDatabaseL() drive: %d", iDrive );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSTORE_RECREATEDATABASEL, "CThumbnailStore::RecreateDatabaseL;iDrive=%d", iDrive );
     
     TVolumeInfo volumeinfo;
     User::LeaveIfError( iFs.Volume(volumeinfo, iDrive) );
@@ -483,6 +510,7 @@
     iUnrecoverable = ETrue;
     
     TN_DEBUG1( "CThumbnailStore::RecreateDatabaseL() database closed" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_RECREATEDATABASEL, "CThumbnailStore::RecreateDatabaseL - database closed" );
     
     HBufC* databasePath = HBufC::NewLC( KMaxFileName );
     TPtr pathPtr = databasePath->Des();
@@ -496,8 +524,10 @@
     if(aDelete)
         {
         TN_DEBUG1( "CThumbnailStore::RecreateDatabaseL() delete database" );
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_RECREATEDATABASEL, "CThumbnailStore::RecreateDatabaseL - delete database" );
         TInt del = iDatabase.Delete(pathPtr);     
         TN_DEBUG2( "CThumbnailStore::RecreateDatabaseL() deleted database, err: %d", del );       
+        OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSTORE_RECREATEDATABASEL, "CThumbnailStore::RecreateDatabaseL" );
         }
         
     const TDesC8& config = KThumbnailSqlConfig;
@@ -508,8 +538,10 @@
 
     // create new
     TN_DEBUG1( "CThumbnailStore::RecreateDatabaseL() create new" );
+    OstTrace0( TRACE_FATAL, DUP3_CTHUMBNAILSTORE_RECREATEDATABASEL, "CThumbnailStore::RecreateDatabaseL - create new" );
     TRAP(err, iDatabase.CreateL( pathPtr, securityPolicy, &config ));    
     TN_DEBUG2( "CThumbnailStore::RecreateDatabaseL() -- database created, err = %d", err );
+    OstTrace1( TRACE_FATAL, DUP5_CTHUMBNAILSTORE_RECREATEDATABASEL, "CThumbnailStore::RecreateDatabaseL;err=%d", err );
     User::LeaveIfError(err);
     
     CleanupStack::PopAndDestroy( &securityPolicy );
@@ -518,6 +550,7 @@
     TRAPD(prepareErr, PrepareDbL() );
     
     TN_DEBUG2( "CThumbnailStore::RecreateDatabaseL() -- prepare tables, err = %d", prepareErr );
+    OstTrace1( TRACE_FATAL, DUP6_CTHUMBNAILSTORE_RECREATEDATABASEL, "CThumbnailStore::RecreateDatabaseL - prepare tables;prepareErr=%d", prepareErr );
     
     TInt mediaidErr(KErrNone);
     
@@ -529,6 +562,7 @@
         file.Close();
         
         TN_DEBUG2( "CThumbnailStore::RecreateDatabaseL() -- mediaID file created, err = %d", mediaidErr );
+        OstTrace1( TRACE_FATAL, DUP7_CTHUMBNAILSTORE_RECREATEDATABASEL, "CThumbnailStore::RecreateDatabaseL;mediaidErr=%d", mediaidErr );
         }
     
     // delete db if not fully complete
@@ -537,8 +571,10 @@
         CloseStatements();
         iDatabase.Close();
         TN_DEBUG1( "CThumbnailStore::RecreateDatabaseL() delete database" );
+        OstTrace0( TRACE_FATAL, DUP8_CTHUMBNAILSTORE_RECREATEDATABASEL, "CThumbnailStore::RecreateDatabaseL - delete database" );
         TInt del = iDatabase.Delete(pathPtr);     
         TN_DEBUG2( "CThumbnailStore::RecreateDatabaseL() deleted database, err: %d", del );
+        OstTrace1( TRACE_FATAL, DUP9_CTHUMBNAILSTORE_RECREATEDATABASEL, "CThumbnailStore::RecreateDatabaseL - delete database;del=%d", del );
         }
     
     User::LeaveIfError( prepareErr );
@@ -550,6 +586,7 @@
 TInt CThumbnailStore::CheckRowIDs()
     {
     TN_DEBUG1( "CThumbnailStore::CheckRowIDs()");
+    OstTrace0( TRACE_FATAL, CTHUMBNAILSTORE_CHECKROWIDS, "CThumbnailStore::CheckRowIDs" );
     
     RSqlStatement stmt;
     TInt column = 0;   
@@ -562,6 +599,7 @@
         {
         stmt.Close();
         TN_DEBUG1( "CThumbnailStore::CheckRowIDs() KGetInfoRowID failed %d");
+        OstTrace1( TRACE_FATAL, DUP1_CTHUMBNAILSTORE_CHECKROWIDS, "CThumbnailStore::CheckRowIDs KGetInfoRowID failed;ret=%d", ret );
         return KErrNotSupported;
         }
     rowStatus = stmt.Next();
@@ -578,6 +616,7 @@
 #ifdef _DEBUG
         TPtrC errorMsg2 = iDatabase.LastErrorMessage();
         TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2);
+        OstTraceExt1( TRACE_FATAL, DUP2_CTHUMBNAILSTORE_CHECKROWIDS, "CThumbnailStore::CheckRowIDs - lastError;errorMsg2=%S", errorMsg2 );
 #endif
         return KErrNotSupported;
         }
@@ -587,6 +626,7 @@
         {
         stmt.Close();
         TN_DEBUG1( "CThumbnailStore::CheckRowIDs() KGetDataRowID failed");
+        OstTrace0( TRACE_FATAL, DUP3_CTHUMBNAILSTORE_CHECKROWIDS, "CThumbnailStore::CheckRowIDs - KGetDataRowID failed" );
         return KErrNotSupported;
         }
     rowStatus = stmt.Next();
@@ -603,12 +643,15 @@
 #ifdef _DEBUG
         TPtrC errorMsg2 = iDatabase.LastErrorMessage();
         TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2);
+        OstTraceExt1( TRACE_FATAL, DUP4_CTHUMBNAILSTORE_CHECKROWIDS, "CThumbnailStore::CheckRowIDs - lastError;errorMsg2=%S", errorMsg2 );
 #endif
         return KErrNotSupported;
         }
     
     TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - inforows %Ld", inforows );
+    OstTraceExt1( TRACE_FATAL, DUP5_CTHUMBNAILSTORE_CHECKROWIDS, "CThumbnailStore::CheckRowIDs;inforows=%g", inforows );
     TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - datarows %Ld", datarows );
+    OstTraceExt1( TRACE_FATAL, DUP6_CTHUMBNAILSTORE_CHECKROWIDS, "CThumbnailStore::CheckRowIDs;datarows=%Ld", datarows );
             
     if( inforows != datarows )
         {
@@ -628,6 +671,7 @@
 TInt CThumbnailStore::CheckVersion()
     {
     TN_DEBUG1( "CThumbnailStore::CheckVersion()" );
+    OstTrace0( TRACE_FATAL, CTHUMBNAILSTORE_CHECKVERSION, "CThumbnailStore::CheckVersion" );
     RSqlStatement stmt;
          
     TInt rowStatus = 0;
@@ -640,6 +684,7 @@
        {  
        stmt.Close();
        TN_DEBUG1( "CThumbnailStore::CheckVersion() unknown version" );
+       OstTrace0( TRACE_FATAL, DUP1_CTHUMBNAILSTORE_CHECKVERSION, "CThumbnailStore::CheckVersion - unknown version" );
        return KErrNotSupported;
        }
               
@@ -658,6 +703,7 @@
 #ifdef _DEBUG
          TPtrC errorMsg = iDatabase.LastErrorMessage();
         TN_DEBUG2( "RThumbnailTransaction::CheckVersion() lastError %S, ret = %d" , &errorMsg);
+        OstTrace0( TRACE_FATAL, DUP2_CTHUMBNAILSTORE_CHECKVERSION, "CThumbnailStore::CheckVersion" );
 #endif
         return ret;
         }
@@ -669,6 +715,7 @@
     else
       {
       TN_DEBUG1( "CThumbnailStore::CheckVersion() - wrong DB version" );
+      OstTrace0( TRACE_FATAL, DUP3_CTHUMBNAILSTORE_CHECKVERSION, "CThumbnailStore::CheckVersion" );
       return KErrNotSupported;  
       }
     }
@@ -680,6 +727,7 @@
 TInt CThumbnailStore::CheckImei()
     {
     TN_DEBUG1( "CThumbnailStore::CheckImei()" );
+    OstTrace0( TRACE_FATAL, CTHUMBNAILSTORE_CHECKIMEI, "CThumbnailStore::CheckImei" );
     RSqlStatement stmt;
          
     TInt rowStatus = 0;
@@ -691,6 +739,7 @@
        {  
         stmt.Close();
        TN_DEBUG1( "CThumbnailStore::CheckImei() failed" );
+       OstTrace0( TRACE_FATAL, DUP1_CTHUMBNAILSTORE_CHECKIMEI, "CThumbnailStore::CheckImei - failed" );
        return KErrNotSupported;
        }
               
@@ -709,6 +758,7 @@
 #ifdef _DEBUG
          TPtrC errorMsg = iDatabase.LastErrorMessage();
         TN_DEBUG2( "RThumbnailTransaction::CheckImei() lastError %S, ret = %d" , &errorMsg);
+        OstTraceExt1( TRACE_FATAL, DUP2_CTHUMBNAILSTORE_CHECKIMEI, "CThumbnailStore::CheckImei - lastError;errorMsg=%S", errorMsg );
 #endif
         return ret;
         }
@@ -720,6 +770,7 @@
     else
       {
       TN_DEBUG1( "CThumbnailStore::CheckImei() mismatch" );
+      OstTrace0( TRACE_FATAL, DUP3_CTHUMBNAILSTORE_CHECKIMEI, "CThumbnailStore::CheckImei - mismatch" );
       return KErrNotSupported;  
       }
     }
@@ -731,6 +782,7 @@
 TInt CThumbnailStore::CheckMediaIDL()
     {
     TN_DEBUG1( "CThumbnailStore::CheckMediaIDL()" );
+    OstTrace0( TRACE_FATAL, CTHUMBNAILSTORE_CHECKMEDIAIDL, "CThumbnailStore::CheckMediaIDL" );
     
     TVolumeInfo volumeinfo;
     User::LeaveIfError( iFs.Volume(volumeinfo, iDrive) );
@@ -744,6 +796,7 @@
        TInt err = file.Create(iFs, mediaid, EFileShareReadersOrWriters );
        file.Close();
        TN_DEBUG2( "CThumbnailStore::CheckMediaIDL() -- mediaID file created, err = %d", err );
+       OstTrace1( TRACE_FATAL, DUP1_CTHUMBNAILSTORE_CHECKMEDIAIDL, "CThumbnailStore::CheckMediaIDL - mediaID file created;err=%d", err );
        
        return KErrNotSupported;
        } 
@@ -758,6 +811,7 @@
 void CThumbnailStore::AddVersionAndImeiL()
     {
     TN_DEBUG1( "CThumbnailStore::AddVersionAndImei()" );
+    OstTrace0( TRACE_FATAL, CTHUMBNAILSTORE_ADDVERSIONANDIMEIL, "CThumbnailStore::AddVersionAndImeiL" );
     RSqlStatement stmt;
     CleanupClosePushL( stmt );
             
@@ -787,6 +841,7 @@
 void CThumbnailStore::UpdateImeiL()
     {
     TN_DEBUG1( "CThumbnailStore::UpdateImeiL()" );
+    OstTrace0( TRACE_FATAL, CTHUMBNAILSTORE_UPDATEIMEIL, "CThumbnailStore::UpdateImeiL" );
     RSqlStatement stmt;
     CleanupClosePushL( stmt );
             
@@ -803,6 +858,7 @@
 #ifdef _DEBUG
         TPtrC errorMsg = iDatabase.LastErrorMessage();
         TN_DEBUG2( "RThumbnailTransaction::UpdateImeiL() lastError %S" , &errorMsg);
+        OstTraceExt1( TRACE_FATAL, DUP1_CTHUMBNAILSTORE_UPDATEIMEIL, "CThumbnailStore::UpdateImeiL - lastError;errorMsg=%S", errorMsg );
 #endif
         User::Leave(err);
         }
@@ -817,6 +873,7 @@
 void CThumbnailStore::PrepareStatementsL()
     {
     TN_DEBUG1("CThumbnailStore::PrepareStatementsL()");
+    OstTrace0( TRACE_FATAL, CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL" );
     
     TInt err = KErrNone;  
 #ifdef _DEBUG
@@ -827,6 +884,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSelectInfoByPath %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP1_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSelectInfoByPath;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -835,6 +893,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSelectTempInfoByPath %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP2_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSelectTempInfoByPath;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -843,6 +902,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailInsertTempThumbnailInfo %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP3_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailInsertTempThumbnailInfo ;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -851,6 +911,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailInsertTempThumbnailInfoData %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP4_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailInsertTempThumbnailInfoData;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -859,6 +920,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSelectModifiedByPath %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP5_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -867,6 +929,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSelectTempModifiedByPath %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP6_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSelectTempModifiedByPath;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -875,6 +938,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailFindDuplicate %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP7_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailFindDuplicate;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -883,6 +947,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailTempFindDuplicate %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP8_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailTempFindDuplicate;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -891,6 +956,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSqlFindDeleted %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP9_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSqlFindDeleted;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -899,6 +965,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSelectSizeByPath %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP10_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSelectSizeByPath;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -907,6 +974,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSelectTempSizeByPath %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP11_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSelectTempSizeByPath;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -915,6 +983,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSqlSelectRowIDInfoByPath %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP12_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSqlSelectRowIDInfoByPath;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -923,6 +992,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSqlDeleteInfoByPath %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP13_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSqlDeleteInfoByPath;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -931,6 +1001,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSqlDeleteInfoDataByPath %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP14_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSqlDeleteInfoDataByPath;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -939,6 +1010,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KTempThumbnailSqlSelectRowIDInfoByPath %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP15_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KTempThumbnailSqlSelectRowIDInfoByPath;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -947,6 +1019,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KTempThumbnailSqlDeleteInfoByPath %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP16_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KTempThumbnailSqlDeleteInfoByPath;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -955,6 +1028,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KTempThumbnailSqlDeleteInfoDataByPath %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP17_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KTempThumbnailSqlDeleteInfoDataByPath;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -963,6 +1037,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSqlInsertDeleted %S" , &msg );
+    OstTraceExt1( TRACE_FATAL, DUP18_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSqlInsertDeleted;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -971,6 +1046,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSqlSelectMarked %S" , &msg );
+    OstTraceExt1( TRACE_NORMAL, DUP19_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSqlSelectMarked;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -979,6 +1055,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSqlDeleteInfoByRowID %S" , &msg );
+    OstTraceExt1( TRACE_NORMAL, DUP20_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSqlDeleteInfoByRowID;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -987,6 +1064,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSqlDeleteInfoDataByRowID %S" , &msg );
+    OstTraceExt1( TRACE_NORMAL, DUP21_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSqlDeleteInfoDataByRowID;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -995,6 +1073,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailSelectAllPaths %S" , &msg );
+    OstTraceExt1( TRACE_NORMAL, DUP22_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailSelectAllPaths;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -1003,6 +1082,7 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailRename %S" , &msg );
+    OstTraceExt1( TRACE_NORMAL, DUP23_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailRename;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
@@ -1011,11 +1091,13 @@
 #ifdef _DEBUG
     msg.Append( iDatabase.LastErrorMessage() );
     TN_DEBUG2( "CThumbnailStore::PrepareStatementsL() KThumbnailTempRename %S" , &msg );
+    OstTraceExt1( TRACE_NORMAL, DUP24_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - KThumbnailTempRename;msg=%S", msg );
     msg.Zero();
 #endif
     User::LeaveIfError( err );
     
     TN_DEBUG1("CThumbnailStore::PrepareStatementsL() end");
+    OstTrace0( TRACE_NORMAL, DUP25_CTHUMBNAILSTORE_PREPARESTATEMENTSL, "CThumbnailStore::PrepareStatementsL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -1036,6 +1118,7 @@
 void CThumbnailStore::CloseStatements()
     {
     TN_DEBUG1("CThumbnailStore::CloseStatements()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_CLOSESTATEMENTS, "CThumbnailStore::CloseStatements" );
     
     iStmt_KThumbnailSelectInfoByPath.Close();
     iStmt_KThumbnailSelectTempInfoByPath.Close();   
@@ -1063,6 +1146,7 @@
     iStmt_KThumbnailTempRename.Close();
     
     TN_DEBUG1("CThumbnailStore::CloseStatements() end");
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_CLOSESTATEMENTS, "CThumbnailStore::CloseStatements - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -1144,6 +1228,7 @@
     TTime timeStamp;
     
     TN_DEBUG2( "CThumbnailStore::StoreThumbnailL( private ) timeStamp aModified %Ld", aModified );
+    OstTraceExt1( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - timeStamp aModified;aModified=%Ld", aModified );
         
     if( aModified )
         {
@@ -1166,10 +1251,12 @@
             if (timeErr != KErrNone)
                 {
                 TN_DEBUG2( "CThumbnailStore::StoreThumbnailL( private ) error getting timeStamp: %d", timeErr );
+                OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - error getting timeStamp;timeErr=%d", timeErr );
                 }
             else
                 {
                 TN_DEBUG2( "CThumbnailStore::StoreThumbnailL( private ) timeStamp       iFs %Ld", timeStamp.Int64() );
+                OstTraceExt1( TRACE_NORMAL, DUP3_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - timeStamp;timeStamp.Int64()=%Ld", timeStamp.Int64() );
                 }
             }
         
@@ -1178,10 +1265,12 @@
             // otherwise current time
             timeStamp.UniversalTime();
             TN_DEBUG2( "CThumbnailStore::StoreThumbnailL( private ) timeStamp   current %Ld", timeStamp.Int64() );
+            OstTraceExt1( TRACE_NORMAL, DUP4_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - timeStamp   current;timeStamp.Int64()=%Ld", timeStamp.Int64() );
             }
         }
         
    TN_DEBUG2( "CThumbnailStore::StoreThumbnailL( private ) timeStamp       set %Ld", timeStamp.Int64());
+   OstTraceExt1( TRACE_NORMAL, DUP5_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - timeStamp       set;timeStamp.Int64()=%Ld", timeStamp.Int64() );
    
     paramIndex = stmt->ParameterIndex( KThumbnailSqlParamModified );
     User::LeaveIfError( paramIndex );
@@ -1213,11 +1302,15 @@
 #ifdef _DEBUG
     iThumbCounter++;
     TN_DEBUG2( "CThumbnailStore::THUMBSTORE-COUNTER----------, Thumbs = %d", iThumbCounter );
+    OstTrace1( TRACE_NORMAL, DUP6_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::THUMBSTORE-COUNTER----------, Thumbs =;iThumbCounter=%d", iThumbCounter );
     
     aStop.UniversalTime();
+    TInt tookTime = aStop.MicroSecondsFrom(aStart).Int64()/1000;
     TN_DEBUG2( "CThumbnailStore::StoreThumbnailL( private ) insert to table %d ms", (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000);
+    OstTrace1( TRACE_NORMAL, DUP7_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - insert to table;tookTime=%d", tookTime );
 #endif 
     TN_DEBUG1( "CThumbnailStore::StoreThumbnailL( private ) out" );
+    OstTrace0( TRACE_NORMAL, DUP8_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - out" );
     }
 
 
@@ -1232,7 +1325,7 @@
     {
     TSize thumbSize = aThumbnail->SizeInPixels();
     TN_DEBUG4( "CThumbnailStore::StoreThumbnailL( public ) aThumbnailSize = %d, aThumbnailSize(%d,%d) IN", aThumbnailSize, thumbSize.iWidth, thumbSize.iHeight );
-    
+    OstTraceExt3( TRACE_NORMAL, DUP9_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - IN;aThumbnailSize=%u;thumbSize.iWidth=%d;thumbSize.iHeight=%d", aThumbnailSize, thumbSize.iWidth, thumbSize.iHeight );    
     if(iReadOnly)
         {
         TN_DEBUG1( "CThumbnailStore::StoreThumbnailL() read only, skip..." );
@@ -1248,6 +1341,7 @@
             || thumbSize.iWidth <= 0 || thumbSize.iHeight <= 0 )
         {
         TN_DEBUG1( "CThumbnailStore::StoreThumbnailL( public ) not stored");
+        OstTrace0( TRACE_NORMAL, DUP10_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - not stored" );
         return;
         }
     
@@ -1280,6 +1374,7 @@
                  aThumbnailSize == EAudioFullScreenThumbnailSize) && !aBlackListed )
                 {
                 TN_DEBUG1( "CThumbnailStore::StoreThumbnailL( public ) - encode jpg" );
+                OstTrace0( TRACE_NORMAL, DUP11_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - encode jpg" );
             
                 HBufC8* data = NULL;
                 CleanupStack::PushL( data );
@@ -1292,32 +1387,38 @@
                 if ( decErr != KErrNone )
                     {
                     TN_DEBUG2( "CThumbnailStore::StoreThumbnailL( public ) - HW CExtJpegEncoder failed %d", decErr);
+                    OstTrace1( TRACE_NORMAL, DUP12_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - HW CExtJpegEncoder failed;decErr=%d", decErr );
                 
                     TRAPD( decErr, encoder = CExtJpegEncoder::DataNewL( CExtJpegEncoder::ESwImplementation, data, options ) );
                     if ( decErr != KErrNone )
                         {
                         TN_DEBUG2( "CThumbnailStore::StoreThumbnailL( public ) - SW CExtJpegEncoder failed %d", decErr);
+                        OstTrace1( TRACE_NORMAL, DUP13_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - SW CExtJpegEncoder failed;decErr=%d", decErr );
                     
                         TRAPD( decErr, encoder = CImageEncoder::DataNewL( data,  KJpegMime(), options ) );
                         if ( decErr != KErrNone )
                             {
                             TN_DEBUG2( "CThumbnailStore::StoreThumbnailL( public ) - CImageEncoder failed %d", decErr);
+                            OstTrace1( TRACE_NORMAL, DUP14_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - CImageEncoder failed;decErr=%d", decErr );
                             
                             User::Leave(decErr);
                             }
                         else
                             {
                             TN_DEBUG1( "CThumbnailStore::StoreThumbnailL( public ) - CImageEncoder created" );
+                            OstTrace0( TRACE_NORMAL, DUP15_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - CImageEncoder created" );
                             }
                         }
                     else
                         {
                         TN_DEBUG1( "CThumbnailStore::StoreThumbnailL( public ) - SW CExtJpegEncoder created" );
+                        OstTrace0( TRACE_NORMAL, DUP16_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - SW CExtJpegEncoder created" );
                         }
                     }
                 else
                     {
                     TN_DEBUG1( "CThumbnailStore::StoreThumbnailL( public ) - HW CExtJpegEncoder created" );
+                    OstTrace0( TRACE_NORMAL, DUP17_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - HW CExtJpegEncoder created" );
                     }             
                 
                 CleanupStack::Pop( data );
@@ -1354,6 +1455,7 @@
                 if(request == KErrNone)
                     {           
                     TN_DEBUG1( "CThumbnailStore::StoreThumbnailL( public ) - encoding ok" );    
+                    OstTrace0( TRACE_NORMAL, DUP18_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - encoding ok" );
                 
                     CleanupStack::PushL( data );
                     TPtr8 ptr = data->Des(); 
@@ -1365,6 +1467,7 @@
                 else
                     {
                     TN_DEBUG2( "CThumbnailStore::StoreThumbnailL( public ) - encoding failed: %d", request.Int() );
+                    OstTrace1( TRACE_NORMAL, DUP19_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - encoding failed;request.Int()=%d", request.Int() );
                     }
                 
                 delete data;
@@ -1392,6 +1495,7 @@
     CleanupStack::PopAndDestroy( path );
     
     TN_DEBUG1( "CThumbnailStore::StoreThumbnailL( public ) out" );
+    OstTrace0( TRACE_NORMAL, DUP20_CTHUMBNAILSTORE_STORETHUMBNAILL, "CThumbnailStore::StoreThumbnailL - out" );
     }
 
 // ---------------------------------------------------------------------------
@@ -1401,7 +1505,7 @@
 TBool CThumbnailStore::FindDuplicateL( const TDesC& aPath, const TThumbnailSize& aThumbnailSize )
     {
     TN_DEBUG1( "CThumbnailStore::FindDuplicateL()" );
-	
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_FINDDUPLICATEL, "CThumbnailStore::FindDuplicateL" );
 	if(iReadOnly)
 		{
 		TN_DEBUG1( "CThumbnailStore::FindDuplicateL() read only, skip..." );
@@ -1448,17 +1552,20 @@
         if(rowStatus == KSqlAtRow)
             {
             TN_DEBUG1( "CThumbnailStore::FindDuplicateL() - duplicate in main table" );
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_FINDDUPLICATEL, "CThumbnailStore::FindDuplicateL - duplicate in main table" );
             
             found = ETrue;
             }
         else
             {
             TN_DEBUG1( "CThumbnailStore::FindDuplicateL() - no duplicate" );
+            OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_FINDDUPLICATEL, "CThumbnailStore::FindDuplicateL - no duplicate" );
             }
         }
     else
         {
         TN_DEBUG1( "CThumbnailStore::FindDuplicateL() - duplicate in temp table" );
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSTORE_FINDDUPLICATEL, "CThumbnailStore::FindDuplicateL - duplicate in temp table" );
         
         found = ETrue;
         }
@@ -1482,10 +1589,12 @@
         if(rowStatus == KSqlAtRow)
             {
             TN_DEBUG1( "CThumbnailStore::FindDuplicateL() - duplicate marked deleted" );
+            OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSTORE_FINDDUPLICATEL, "CThumbnailStore::FindDuplicateL - duplicate marked deleted" );
             
             DeleteThumbnailsL(aPath, ETrue);
             
             TN_DEBUG1( "CThumbnailStore::FindDuplicateL() - duplicate force-deleted" );
+            OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILSTORE_FINDDUPLICATEL, "CThumbnailStore::FindDuplicateL - duplicate force-deleted" );
             
             found = EFalse;
             }
@@ -1502,7 +1611,7 @@
     TThumbnailPersistentSize > & aMissingSizes, TBool aCheckGridSizeOnly )
     {
     TN_DEBUG2( "CThumbnailStore::GetMissingSizesL() aSourceType == %d", aSourceType );
-    
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSTORE_GETMISSINGSIZESL, "CThumbnailStore::GetMissingSizesL;aSourceType=%d", aSourceType );
     if(iReadOnly)
         {
         TN_DEBUG1( "CThumbnailStore::GetMissingSizesL() read only, skip..." );
@@ -1530,6 +1639,7 @@
                     {
                     TN_DEBUG4( "CThumbnailStore::GetMissingSizesL() skip, aCheckGridSizeOnly = %d and  iPersistentSizes[%d].iSizeType == %d", 
                             aCheckGridSizeOnly, i, iPersistentSizes[i].iSizeType );
+                    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_GETMISSINGSIZESL, "CThumbnailStore::GetMissingSizesL;aCheckGridSizeOnly=%u", aCheckGridSizeOnly );
                     }
 				else
 				    {
@@ -1546,6 +1656,7 @@
     TInt missingSizeCount = aMissingSizes.Count();
         
     TN_DEBUG2( "CThumbnailStore::GetMissingSizesL() missingSizeCount == %d", missingSizeCount );
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_GETMISSINGSIZESL, "CThumbnailStore::GetMissingSizesL;missingSizeCount=%d", missingSizeCount );
     
     // check temp table first
     RSqlStatement* stmt = NULL;
@@ -1573,6 +1684,7 @@
                 if ( aMissingSizes[ i ].iType == size )
                     {
                     TN_DEBUG1( "CThumbnailStore::GetMissingSizesL() -- thumbnail found" );
+                    OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSTORE_GETMISSINGSIZESL, "CThumbnailStore::GetMissingSizesL - thumbnail found" );
                     aMissingSizes.Remove( i );
                     missingSizeCount--;
                     break;
@@ -1617,7 +1729,7 @@
     aThumbnail, TDesC8* & aData, const TThumbnailSize aThumbnailSize, TSize &aThumbnailRealSize )
     {
     TN_DEBUG3( "CThumbnailStore::FetchThumbnailL(%S) aThumbnailSize==%d", &aPath, aThumbnailSize );
-    
+    OstTraceExt2( TRACE_NORMAL, CTHUMBNAILSTORE_FETCHTHUMBNAILL, "CThumbnailStore::FetchThumbnailL;aPath=%S;aThumbnailSize=%u", aPath, aThumbnailSize );
     if(iReadOnly)
         {
         TN_DEBUG1( "CThumbnailStore::FetchThumbnailL() read only, skip..." );
@@ -1636,6 +1748,7 @@
     TInt column = 0;
     
     TN_DEBUG1( "CThumbnailStore::FetchThumbnailL() -- TEMP TABLE lookup" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_FETCHTHUMBNAILL, "CThumbnailStore::FetchThumbnailL - TEMP TABLE lookup" );
 
     RSqlStatement* stmt = NULL;
     stmt = &iStmt_KThumbnailSelectTempInfoByPath;
@@ -1655,6 +1768,7 @@
     if(rowStatus != KSqlAtRow)
        {
        TN_DEBUG1( "CThumbnailStore::FetchThumbnailL() -- MAIN TABLE lookup" );
+       OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_FETCHTHUMBNAILL, "CThumbnailStore::FetchThumbnailL - MAIN TABLE lookup" );
       
        CleanupStack::PopAndDestroy( stmt );
        stmt = &iStmt_KThumbnailSelectInfoByPath;
@@ -1674,6 +1788,7 @@
     if(rowStatus == KSqlAtRow)
        {
         TN_DEBUG1( "CThumbnailStore::FetchThumbnailL() -- thumbnail found" );
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSTORE_FETCHTHUMBNAILL, "CThumbnailStore::FetchThumbnailL - thumbnail found" );
         
         // Check whether blacklisted thumbnail entry modified. 
         // If thumbnail is marked as blacklisted and timestamp has 
@@ -1731,6 +1846,7 @@
     else
         {
         TN_DEBUG1( "CThumbnailStore::FetchThumbnailL() -- thumbnail NOT found" );
+        OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSTORE_FETCHTHUMBNAILL, "CThumbnailStore::FetchThumbnailL - thumbnail NOT found" );
         }
         
     CleanupStack::PopAndDestroy( stmt );
@@ -1747,6 +1863,7 @@
                                          TBool aTransaction )
     {
     TN_DEBUG2( "CThumbnailStore::DeleteThumbnailsL(%S)", &aPath );
+    OstTraceExt1( TRACE_NORMAL, CTHUMBNAILSTORE_DELETETHUMBNAILSL, "CThumbnailStore::DeleteThumbnailsL;aPath=%S", aPath );
 
     if(iReadOnly)
         {
@@ -1781,6 +1898,7 @@
         }
         
     TN_DEBUG1( "CThumbnailStore::DeleteThumbnailsByPathL() -- TEMP TABLE lookup" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_DELETETHUMBNAILSL, "CThumbnailStore::DeleteThumbnailsL - TEMP TABLE lookup" );
     
     RSqlStatement* stmt = NULL;
     RSqlStatement* stmt_info = NULL;
@@ -1819,6 +1937,7 @@
         User::LeaveIfError( err );
         
         TN_DEBUG1( "CThumbnailStore::DeleteThumbnailsByPathL() -- TEMP TABLE lookup - thumbnail deleted" );
+        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_DELETETHUMBNAILSL, "CThumbnailStore::DeleteThumbnailsL - TEMP TABLE lookup - thumbnail deleted" );
        
         // fetch another row (temp table rowIDs are updated immediately)
         stmt->Reset();
@@ -1839,6 +1958,7 @@
         {
         //look from real table 
         TN_DEBUG1( "CThumbnailStore::DeleteThumbnailByPathL() -- MAIN TABLE lookup" );
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSTORE_DELETETHUMBNAILSL, "CThumbnailStore::DeleteThumbnailsL - MAIN TABLE lookup" );
         
         stmt = &iStmt_KThumbnailSqlSelectRowIDInfoByPath;
         CleanupStack::PushL(TCleanupItem(ResetStatement, stmt));
@@ -1873,6 +1993,7 @@
             User::LeaveIfError( err );
            
             TN_DEBUG1( "CThumbnailStore::DeleteThumbnailByPathL() -- MAIN TABLE lookup - thumbnail deleted" );
+            OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSTORE_DELETETHUMBNAILSL, "CThumbnailStore::DeleteThumbnailsL - MAIN TABLE lookup - thumbnail deleted" );
             
             rowStatus = stmt->Next();
             }
@@ -1887,6 +2008,7 @@
     else
         {
         TN_DEBUG1( "CThumbnailStore::DeleteThumbnailByPathL() -- MAIN TABLE lookup" );        
+        OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILSTORE_DELETETHUMBNAILSL, "CThumbnailStore::DeleteThumbnailsL - MAIN TABLE lookup" );
     
         stmt = &iStmt_KThumbnailSqlSelectRowIDInfoByPath;
         CleanupStack::PushL(TCleanupItem(ResetStatement, stmt));
@@ -1903,6 +2025,7 @@
         if (rowStatus == KSqlAtRow)
             {        
             TN_DEBUG1( "CThumbnailStore::DeleteThumbnailByPathL() -- add to Deleted" );
+            OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILSTORE_DELETETHUMBNAILSL, "CThumbnailStore::DeleteThumbnailsL - add to Deleted" );
         
             // only add path to deleted table
             stmt = &iStmt_KThumbnailSqlInsertDeleted;
@@ -1919,6 +2042,7 @@
         else
             {
             TN_DEBUG1( "CThumbnailStore::DeleteThumbnailByPathL() -- no thumbs in MAIN" );
+            OstTrace0( TRACE_NORMAL, DUP7_CTHUMBNAILSTORE_DELETETHUMBNAILSL, "CThumbnailStore::DeleteThumbnailsL - no thumbs in MAIN" );
             }
         }    
     
@@ -1930,13 +2054,16 @@
     
 #ifdef _DEBUG
     aStop.UniversalTime();
+    TInt tookTime = (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000;
     TN_DEBUG2( "CThumbnailStore::DeleteThumbnailByPathL() took %d ms", (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000);
+    OstTrace1( TRACE_NORMAL, DUP8_CTHUMBNAILSTORE_DELETETHUMBNAILSL, "CThumbnailStore::DeleteThumbnailsL - took;tookTime=%d", tookTime );
 #endif
     
     // start maintenance if rows in main table were marked
     if (!aForce && count > 0)
         {
         TN_DEBUG2( "CThumbnailStore::DeleteThumbnailByPathL() -- MAIN TABLE lookup - %d rows marked deleted", count);
+        OstTrace1( TRACE_NORMAL, DUP9_CTHUMBNAILSTORE_DELETETHUMBNAILSL, "CThumbnailStore::DeleteThumbnailsL -- MAIN TABLE lookup - rows marked deleted;count=%d", count );
         
         iDeleteThumbs = ETrue;
         iActivityManager->Start();
@@ -1952,7 +2079,7 @@
 void CThumbnailStore::RenameThumbnailsL( const TDesC& aCurrentPath, const TDesC& aNewPath )
     {
     TN_DEBUG2( "CThumbnailStore::RenameThumbnailsL(%S)", &aCurrentPath );
-    
+    OstTraceExt1( TRACE_NORMAL, CTHUMBNAILSTORE_RENAMETHUMBNAILSL, "CThumbnailStore::RenameThumbnailsL;aCurrentPath=%S", aCurrentPath );
     if(iReadOnly)
         {
         TN_DEBUG1( "CThumbnailStore::RenameThumbnailsL() read only, skip..." );
@@ -1981,6 +2108,7 @@
     transaction.BeginL();
         
     TN_DEBUG1( "CThumbnailStore::RenameThumbnailsL() -- TEMP TABLE" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_RENAMETHUMBNAILSL, "CThumbnailStore::RenameThumbnailsL - TEMP TABLE" );
     
     RSqlStatement* stmt = NULL;
     stmt = &iStmt_KThumbnailTempRename;
@@ -1997,6 +2125,7 @@
     User::LeaveIfError( stmt->Exec() );
     
     TN_DEBUG1( "CThumbnailStore::RenameThumbnailsL() -- MAIN TABLE" );
+    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_RENAMETHUMBNAILSL, "CThumbnailStore::RenameThumbnailsL - MAIN TABLE" );
     
     CleanupStack::PopAndDestroy( stmt );
     stmt = &iStmt_KThumbnailRename;
@@ -2025,7 +2154,9 @@
     
 #ifdef _DEBUG
     aStop.UniversalTime();
+    TInt tookTime = (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000;
     TN_DEBUG2( "CThumbnailStore::RenameThumbnailsL() took %d ms", (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000);
+    OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSTORE_RENAMETHUMBNAILSL, "CThumbnailStore::RenameThumbnailsL;tookTime=%d", tookTime );
 #endif      
     }
 
@@ -2045,6 +2176,7 @@
 void CThumbnailStore::FlushCacheTable( TBool aForce )
     {
     TN_DEBUG1("CThumbnailStore::FlushCacheTable() in");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - in" );
     
     StopAutoFlush();
     
@@ -2058,6 +2190,7 @@
         {
         // cache empty or db unusable
         TN_DEBUG1( "CThumbnailStore::FlushCacheTable() error ");
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - error" );
         return;
         }
     
@@ -2067,6 +2200,7 @@
     if(ret != KErrNone)
        {
        TN_DEBUG2( "CThumbnailStore::FlushCacheTable() error checking MTP sync: %d", ret);
+       OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - error checking MTP sync;ret=%d", ret );
        }
     
     //set init max flush delay
@@ -2078,6 +2212,7 @@
         {
         //MTP or MPX harvesting active, allow longer flush -> bigger batch size
         TN_DEBUG1("CThumbnailStore::FlushCacheTable() MTP sync, longer flush..");
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - MTP sync, longer flush.." );
         aMaxFlushDelay = KMaxMTPFlushDelay;
         }
     
@@ -2085,6 +2220,7 @@
     if( iBatchItemCount == 1)
         {
         TN_DEBUG2("CThumbnailStore::FlushCacheTable() calculate new batch size iPreviousFlushDelay = %d", iPreviousFlushDelay);
+        OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable;iPreviousFlushDelay=%d", iPreviousFlushDelay );
         //adjust batch size dynamically between min and max based on previous flush speed
         if( iPreviousFlushDelay > 0 )
             {
@@ -2092,10 +2228,15 @@
             iBatchFlushItemCount = (TInt)aNewBatchFlushItemCount;
 
             TN_DEBUG2("CThumbnailStore::FlushCacheTable() aMaxFlushDelay %e", aMaxFlushDelay);      
+            OstTrace1( TRACE_NORMAL, DUP5_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable;aMaxFlushDelay=%d", aMaxFlushDelay );
             TN_DEBUG2("CThumbnailStore::FlushCacheTable() aPreviousFlushDelay %e", aPreviousFlushDelay);      
+			OstTrace1( TRACE_NORMAL, DUP6_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable;aPreviousFlushDelay=%d", aPreviousFlushDelay );
 			TN_DEBUG2("CThumbnailStore::FlushCacheTable() aBatchFlushItemCount %e", aBatchFlushItemCount);      
+            OstTrace1( TRACE_NORMAL, DUP7_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable;aBatchFlushItemCount=%d", aBatchFlushItemCount );
             TN_DEBUG2("CThumbnailStore::FlushCacheTable() aNewBatchFlushItemCount %e", aNewBatchFlushItemCount);
+            OstTrace1( TRACE_NORMAL, DUP8_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable;aNewBatchFlushItemCount=%d", aNewBatchFlushItemCount );
             TN_DEBUG2("CThumbnailStore::FlushCacheTable() iBatchFlushItemCount %d", iBatchFlushItemCount);
+            OstTrace1( TRACE_NORMAL, DUP9_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable;iBatchFlushItemCount=%d", iBatchFlushItemCount );
             
             if( iBatchFlushItemCount < KMInBatchItems )
                 {
@@ -2114,6 +2255,7 @@
         }
     
     TN_DEBUG3("CThumbnailStore::FlushCacheTable() iBatchFlushItemCount = %d, iBatchItemCount = %d", iBatchFlushItemCount, iBatchItemCount);
+    OstTrace0( TRACE_NORMAL, DUP10_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable" );
     
     if( iBatchItemCount < iBatchFlushItemCount && !aForce)
        {
@@ -2127,15 +2269,18 @@
     // Move data from temp table to main....
     TInt err_begin = iDatabase.Exec( KThumbnailBeginTransaction );
     TN_DEBUG2("CThumbnailStore::FlushCacheTable() KThumbnailBeginTransaction %d", err_begin);
+    OstTrace1( TRACE_NORMAL, DUP11_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - KThumbnailBeginTransaction;err_begin=%d", err_begin );
     
     TInt err_tempinfo = iDatabase.Exec( KThumbnailMoveFromTempInfoToMainTable );
     TN_DEBUG2("CThumbnailStore::FlushCacheTable() KThumbnailMoveFromTempInfoToMainTable %d", err_tempinfo);
+    OstTrace1( TRACE_NORMAL, DUP12_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - KThumbnailMoveFromTempInfoToMainTable;err_tempinfo=%d", err_tempinfo );
     
 #ifdef _DEBUG
     if(err_tempinfo < 0)
         {
         TPtrC errorMsg = iDatabase.LastErrorMessage();
         TN_DEBUG2( "CThumbnailStore::FlushCacheTable() lastError %S", &errorMsg);
+        OstTraceExt1( TRACE_NORMAL, DUP13_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - lastError;errorMsg=%S", errorMsg );
         }
 #endif
     
@@ -2146,24 +2291,29 @@
         {
         TPtrC errorMsg2 = iDatabase.LastErrorMessage();
         TN_DEBUG2( "CThumbnailStore::FlushCacheTable() KThumbnailMoveFromTempDataToMainTable %S", &errorMsg2);
+        OstTraceExt1( TRACE_NORMAL, DUP14_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - KThumbnailMoveFromTempDataToMainTable;errorMsg2=%S", errorMsg2 );
         }
 #endif
     
     TInt err_delinfo = iDatabase.Exec( KThumbnailDeleteFromTempInfoTable );
     TN_DEBUG2("CThumbnailStore::FlushCacheTable() KThumbnailDeleteFromTempInfoTable %d", err_delinfo);
+    OstTrace1( TRACE_NORMAL, DUP15_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - KThumbnailDeleteFromTempInfoTable;err_delinfo=%d", err_delinfo );
     
     TInt err_deldata = iDatabase.Exec( KThumbnailDeleteFromTempDataTable );
     TN_DEBUG2("CThumbnailStore::FlushCacheTable() KThumbnailDeleteFromTempDataTable %d", err_deldata);
+    OstTrace1( TRACE_NORMAL, DUP16_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable;err_deldata=%d", err_deldata );
    
     if( err_tempinfo < 0 || err_tempdata < 0  || err_delinfo < 0  || err_deldata < 0 )
         {
         TInt err = iDatabase.Exec( KThumbnailRollbackTransaction );
         TN_DEBUG2("CThumbnailStore::FlushCacheTable() KThumbnailRollbackTransaction %d", err);
+        OstTrace1( TRACE_NORMAL, DUP17_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - KThumbnailRollbackTransaction;err=%d", err );
         }
     else
         {
         TInt err_commit = iDatabase.Exec( KThumbnailCommitTransaction );
         TN_DEBUG2("CThumbnailStore::FlushCacheTable() KThumbnailCommitTransaction %d", err_commit);
+        OstTrace0( TRACE_NORMAL, DUP18_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable" );
         }
     
     // db got corrupted
@@ -2171,6 +2321,7 @@
        err_tempdata == KSqlErrCorrupt || err_tempdata == KErrCorrupt)
         {
         TN_DEBUG1("CThumbnailStore::FlushCacheTable() db corrupted");
+        OstTrace0( TRACE_NORMAL, DUP19_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - db corrupted" );
     
         // open new
         TRAP_IGNORE(OpenDatabaseL(ETrue));
@@ -2180,11 +2331,13 @@
     iPreviousFlushDelay = (TInt)iStopFlush.MicroSecondsFrom(iStartFlush).Int64()/1000;
     
     TN_DEBUG2( "CThumbnailStore::FlushCacheTable() took %d ms", iPreviousFlushDelay);
+    OstTrace1( TRACE_NORMAL, DUP20_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - took ms ;iPreviousFlushDelay=%d", iPreviousFlushDelay );
         
     //cache flushed
     iBatchItemCount = 0;
 
     TN_DEBUG1("CThumbnailStore::FlushCacheTable() out");
+    OstTrace0( TRACE_NORMAL, DUP21_CTHUMBNAILSTORE_FLUSHCACHETABLE, "CThumbnailStore::FlushCacheTable - out" );
     }
 
 // -----------------------------------------------------------------------------
@@ -2194,7 +2347,7 @@
 void CThumbnailStore::StartAutoFlush()
     {
     TN_DEBUG1( "CThumbnailStore::StartAutoFlush()" );
-    
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_STARTAUTOFLUSH, "CThumbnailStore::StartAutoFlush" );
     if(iReadOnly)
         {
         TN_DEBUG1( "CThumbnailStore::StartAutoFlush() read only, skip..." );
@@ -2215,6 +2368,7 @@
     if (err != KErrNone)
         {
         TN_DEBUG2( "CThumbnailStore::StartAutoFlush() - Error creating timer (%d)", err );
+        OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_STARTAUTOFLUSH, "CThumbnailStore::StartAutoFlush - - Error creating timer;err=%d", err );
         }
     else
         {
@@ -2230,6 +2384,7 @@
 void CThumbnailStore::StopAutoFlush()
     {
     TN_DEBUG1( "CThumbnailStore::StopAutoFlush()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_STOPAUTOFLUSH, "CThumbnailStore::StopAutoFlush" );
     if( iAutoFlushTimer )
         {
         iAutoFlushTimer->Cancel();
@@ -2243,6 +2398,7 @@
 void CThumbnailStore::StartMaintenance()
     {
     TN_DEBUG1( "CThumbnailStore::StartMaintenance()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_STARTMAINTENANCE, "CThumbnailStore::StartMaintenance" );
     TInt err = KErrNone;
     
     if( iMaintenanceTimer && iMaintenanceTimer->IsActive() )
@@ -2257,6 +2413,7 @@
     if (err != KErrNone && !iMaintenanceTimer)
         {
         TN_DEBUG2( "CThumbnailStore::StartMaintenanceTimer() - Error creating timer (%d)", err );
+        OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_STARTMAINTENANCE, "CThumbnailStore::StartMaintenance - Error creating timer ;err=%d", err );
         }
     else
         {
@@ -2272,6 +2429,7 @@
 TInt CThumbnailStore::AutoFlushTimerCallBack(TAny* aAny)
     {
     TN_DEBUG1( "CThumbnailStore::AutoFlushTimerCallBack()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_AUTOFLUSHTIMERCALLBACK, "CThumbnailStore::AutoFlushTimerCallBack" );
     CThumbnailStore* self = static_cast<CThumbnailStore*>( aAny );
     
     self->FlushCacheTable(ETrue);
@@ -2295,26 +2453,32 @@
     if(ret != KErrNone || MPXHarvesting)
         {
         TN_DEBUG3( "CThumbnailStore::MaintenanceTimerCallBack() KMPXHarvesting err == %d, MPXHarvesting == %d", ret, MPXHarvesting);
+        OstTraceExt2( TRACE_NORMAL, CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack;ret=%d;MPXHarvesting=%d", ret, MPXHarvesting );
         self->iIdle = EFalse;
         }
     TN_DEBUG2( "CThumbnailStore::MaintenanceTimerCallBack() KMPXHarvesting == %d", MPXHarvesting);
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack;MPXHarvesting=%d", MPXHarvesting );
 
     ret = RProperty::Get(KTAGDPSNotification, KDaemonProcessing, DaemonProcessing);
     if(ret != KErrNone || DaemonProcessing)
         {
         TN_DEBUG3( "CThumbnailStore::MaintenanceTimerCallBack() KDaemonProcessing err == %d, DaemonProcessing == %d", ret, DaemonProcessing);
+        OstTraceExt2( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack;ret=%d;DaemonProcessing=%d", ret, DaemonProcessing );
         self->iIdle = EFalse;
         }
     TN_DEBUG2( "CThumbnailStore::MaintenanceTimerCallBack() DaemonProcessing == %d", DaemonProcessing);
+    OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack;DaemonProcessing=%d", DaemonProcessing );
     
     if (self->iIdle)
         {
         TN_DEBUG2( "CThumbnailStore::MaintenanceTimerCallBack() - maintenance, store %d", self->iDrive);
+        OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack - maintenance, store;self->iDrive=%d", self->iDrive );
     
         // thumbmnail deletion
         if (self->iDeleteThumbs)
             {
             TN_DEBUG1( "CThumbnailStore::MaintenanceTimerCallBack() - cleanup");
+            OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack - cleanup" );
         
             TInt deleteCount = 0;
             
@@ -2323,6 +2487,7 @@
             if (err != KErrNone)
                 {
                 TN_DEBUG2( "CThumbnailStore::MaintenanceTimerCallBack() - cleanup failed, err %d", err);
+                OstTrace1( TRACE_NORMAL, DUP6_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack - cleanup failed;err=%d", err );
                 return err;
                 }
             
@@ -2330,6 +2495,7 @@
             if (deleteCount < KStoreMaintenanceDeleteLimit || deleteCount == 0)
                 {
                 TN_DEBUG2( "CThumbnailStore::MaintenanceTimerCallBack() - cleanup finished, store %d", self->iDrive);
+                OstTrace1( TRACE_NORMAL, DUP7_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack - cleanup finished, store;self->iDrive=%d", self->iDrive );
                 self->iDeleteThumbs = EFalse;
                 }     
             }
@@ -2338,6 +2504,7 @@
         else if (self->iCheckFilesExist)
             {
             TN_DEBUG1( "CThumbnailStore::MaintenanceTimerCallBack() - file existence check");
+            OstTrace0( TRACE_NORMAL, DUP8_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack - file existence check" );
         
             TBool finished = EFalse;
         
@@ -2345,6 +2512,7 @@
             if (err != KErrNone)
                 {
                 TN_DEBUG2( "CThumbnailStore::MaintenanceTimerCallBack() - file existence check failed, err %d", err);
+                OstTrace1( TRACE_NORMAL, DUP9_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack - file existence check failed;err=%d", err );
                 return err;
                 }
         
@@ -2352,6 +2520,7 @@
             if (finished)
                 {
                 TN_DEBUG2( "CThumbnailStore::MaintenanceTimerCallBack() - file existence check finished, store %d", self->iDrive);
+                OstTrace1( TRACE_NORMAL, DUP10_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack - file existence check finished, store;self->iDrive=%d", self->iDrive );
                 self->iCheckFilesExist = EFalse;
                 }
             }
@@ -2360,11 +2529,13 @@
         if (self->iIdle && ( self->iDeleteThumbs || self->iCheckFilesExist) )
             {
             TN_DEBUG1( "CThumbnailStore::MaintenanceTimerCallBack() - continue maintenance");
+            OstTrace0( TRACE_NORMAL, DUP11_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack - continue maintenance" );
             self->StartMaintenance();
             }  
         else if (!self->iDeleteThumbs && !self->iCheckFilesExist)
             {
             TN_DEBUG1( "CThumbnailStore::MaintenanceTimerCallBack() - no more maintenance");
+            OstTrace0( TRACE_NORMAL, DUP12_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack - no more maintenance" );
         
             // no need to monitor activity anymore
             self->iActivityManager->Cancel();
@@ -2373,6 +2544,7 @@
     else
         {
         TN_DEBUG1( "CThumbnailStore::MaintenanceTimerCallBack() - device not idle");
+        OstTrace0( TRACE_NORMAL, DUP13_CTHUMBNAILSTORE_MAINTENANCETIMERCALLBACK, "CThumbnailStore::MaintenanceTimerCallBack - device not idle" );
         }
 
     return KErrNone; // Return value ignored by CPeriodic
@@ -2381,6 +2553,7 @@
 TBool CThumbnailStore::CheckModifiedByPathL( const TDesC& aPath, const TInt64 aModified, TBool& modifiedChanged )
     {
     TN_DEBUG2( "CThumbnailStore::CheckModifiedByPathL() %S", &aPath);
+    OstTraceExt1( TRACE_NORMAL, CTHUMBNAILSTORE_CHECKMODIFIEDBYPATHL, "CThumbnailStore::CheckModifiedByPathL;aPath=%S", aPath );
     
     if(iReadOnly)
     	{
@@ -2414,6 +2587,7 @@
     TBool checkMain = EFalse;
    
     TN_DEBUG1( "CThumbnailStore::CheckModifiedL() -- temp" );
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_CHECKMODIFIEDBYPATHL, "CThumbnailStore::CheckModifiedByPathL -- temp" );
    
     while(rowStatus == KSqlAtRow || !checkMain)
         {
@@ -2423,21 +2597,26 @@
             TInt64 oldModified = stmt->ColumnInt64( column );
            
             TN_DEBUG2( "CThumbnailStore::CheckModifiedL() -- timestamp old %Ld", oldModified);
+            OstTraceExt1( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_CHECKMODIFIEDBYPATHL, "CThumbnailStore::CheckModifiedByPathL -- timestamp old;oldModified=%Ld", oldModified );
             TN_DEBUG2( "CThumbnailStore::CheckModifiedL() -- timestamp mds %Ld", aModified);
+            OstTraceExt1( TRACE_NORMAL, DUP3_CTHUMBNAILSTORE_CHECKMODIFIEDBYPATHL, "CThumbnailStore::CheckModifiedByPathL -- timestamp mds;aModified=%Ld", aModified );
           
             if (oldModified < aModified)
                 {
                 TN_DEBUG1( "CThumbnailStore::CheckModifiedL() -- timestamp is newer than original" );
+                OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSTORE_CHECKMODIFIEDBYPATHL, "CThumbnailStore::CheckModifiedByPathL -- timestamp is newer than original" );
                 modifiedChanged = ETrue;
                 break;
                 }
             else if (oldModified > aModified)
                 {
                 TN_DEBUG1( "CThumbnailStore::CheckModifiedL() -- timestamp is older than original" );
+                OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILSTORE_CHECKMODIFIEDBYPATHL, "CThumbnailStore::CheckModifiedByPathL -- timestamp is older than original" );
                 }
             else if (oldModified == aModified)
                 {
                 TN_DEBUG1( "CThumbnailStore::CheckModifiedL() -- timestamp is the same as original" );
+                OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILSTORE_CHECKMODIFIEDBYPATHL, "CThumbnailStore::CheckModifiedByPathL -- timestamp is the same as original" );
                 }
             
             rowStatus = stmt->Next();
@@ -2447,6 +2626,7 @@
         if(rowStatus != KSqlAtRow && !checkMain && !modifiedChanged)
             {
             TN_DEBUG1( "CThumbnailStore::CheckModifiedL() -- main" );
+            OstTrace0( TRACE_NORMAL, DUP7_CTHUMBNAILSTORE_CHECKMODIFIEDBYPATHL, "CThumbnailStore::CheckModifiedByPathL -- main" );
             //come here only once
             checkMain = ETrue;
            
@@ -2485,6 +2665,7 @@
 void CThumbnailStore::PrepareBlacklistedItemsForRetryL()
     {
     TN_DEBUG1( "CThumbnailStore::PrepareBlacklistedItemsForRetry()" );
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_PREPAREBLACKLISTEDITEMSFORRETRYL, "CThumbnailStore::PrepareBlacklistedItemsForRetryL" );
     
     RSqlStatement stmt;
     CleanupClosePushL( stmt );
@@ -2497,6 +2678,7 @@
     TInt err = stmt.Exec();
    
     TN_DEBUG2( "CThumbnailStore::PrepareBlacklistedItemsForRetryL() - main table, err=%d", err );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_PREPAREBLACKLISTEDITEMSFORRETRYL, "CThumbnailStore::PrepareBlacklistedItemsForRetryL - main table;err=%d", err );
     
     CleanupStack::PopAndDestroy( &stmt );
     }
@@ -2508,7 +2690,7 @@
 TInt CThumbnailStore::DeleteMarkedL()
     {
     TN_DEBUG1( "CThumbnailStore::DeleteMarkedL()" );
-    
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_DELETEMARKEDL, "CThumbnailStore::DeleteMarkedL" );
     if(iReadOnly)
         {
         TN_DEBUG1( "CThumbnailStore::DeleteMarkedL() read only, skip..." );
@@ -2573,6 +2755,7 @@
        deleteCount++;
        
        TN_DEBUG1( "CThumbnailStore::DeleteMarkedL() - thumbnail deleted" );
+       OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_DELETEMARKEDL, "CThumbnailStore::DeleteMarkedL - thumbnail deleted" );
        
        rowStatus = stmt->Next();
        }
@@ -2592,7 +2775,9 @@
     
 #ifdef _DEBUG
     aStop.UniversalTime();
+    TInt tookTime = (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000;
     TN_DEBUG2( "CThumbnailStore::DeleteMarkedL() took %d ms", (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000);
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_DELETEMARKEDL, "CThumbnailStore::DeleteMarkedL - took ms;tookTime=%d", tookTime );
 #endif
     
     return deleteCount;
@@ -2605,7 +2790,7 @@
 TInt CThumbnailStore::FileExistenceCheckL()
     {
     TN_DEBUG1( "CThumbnailStore::FileExistenceCheckL()" );
-	
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_FILEEXISTENCECHECKL, "CThumbnailStore::FileExistenceCheckL" );
     if(iReadOnly)
 		{
 		TN_DEBUG1( "CThumbnailStore::FileExistenceCheckL() read only, skip..." );
@@ -2696,7 +2881,9 @@
     
 #ifdef _DEBUG
     aStop.UniversalTime();
+    TInt tookTime = (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000;
     TN_DEBUG2( "CThumbnailStore::FileExistenceCheckL() took %d ms", (TInt)aStop.MicroSecondsFrom(aStart).Int64()/1000);
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_FILEEXISTENCECHECKL, "CThumbnailStore::FileExistenceCheckL - took ms;tookTime=%d", tookTime );
 #endif
     
     return finished;
@@ -2736,6 +2923,7 @@
     if (iUnrecoverable && !iReadOnly)
         {
         TN_DEBUG1( "CThumbnailStore::CheckDbState() - database in unrecoverable state" );
+        OstTrace0( TRACE_NORMAL, CTHUMBNAILSTORE_CHECKDBSTATE, "CThumbnailStore::CheckDbState" );
         __ASSERT_DEBUG( !iUnrecoverable, ThumbnailPanic( EThumbnailDatabaseUnrecoverable ));
         
         return KStoreUnrecoverableErr;
@@ -2749,6 +2937,7 @@
 void CThumbnailStore::HandleDiskSpaceNotificationL( TBool aDiskFull )
     {
     TN_DEBUG2( "CThumbnailStore::HandleDiskSpaceNotificationL() aDiskFull = %d", aDiskFull );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSTORE_HANDLEDISKSPACENOTIFICATIONL, "CThumbnailStore::HandleDiskSpaceNotificationL;aDiskFull=%u", aDiskFull );
     iDiskFull = aDiskFull;
     }
 
@@ -2759,6 +2948,9 @@
 #endif
     {
     TN_DEBUG2( "CThumbnailStore::HandleDiskSpaceError() aError = %d", aError );
+#ifdef _DEBUG
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSTORE_HANDLEDISKSPACEERROR, "CThumbnailStore::HandleDiskSpaceError;aError=%d", aError );
+#endif
     }
 
 TBool CThumbnailStore::IsDiskFull()
@@ -2778,7 +2970,7 @@
 void CThumbnailStore::ActivityChanged(const TBool aActive)
     {
     TN_DEBUG2( "CThumbnailStore::ActivityChanged() aActive == %d", aActive);
-    
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSTORE_ACTIVITYCHANGED, "CThumbnailStore::ActivityChanged;aActive=%u", aActive );
     if( iReadOnly )
         {
         TN_DEBUG1( "CThumbnailStore::ActivityChanged() read only, skip..." );
@@ -2798,6 +2990,7 @@
         if(ret != KErrNone || MPXHarvesting)
             {
             TN_DEBUG3( "CThumbnailStore::ActivityChanged() KMPXHarvesting err == %d, MPXHarvesting == %d", ret, MPXHarvesting);
+            OstTraceExt2( TRACE_NORMAL, DUP1_CTHUMBNAILSTORE_ACTIVITYCHANGED, "CThumbnailStore::ActivityChanged;ret=%d;MPXHarvesting=%d", ret, MPXHarvesting );
             iIdle = EFalse;
             return;
             }
@@ -2806,11 +2999,13 @@
         if(ret != KErrNone || DaemonProcessing)
             {
             TN_DEBUG3( "CThumbnailStore::ActivityChanged() KDaemonProcessing err == %d DaemonProcessing == %d", ret, DaemonProcessing );
+            OstTraceExt2( TRACE_NORMAL, DUP2_CTHUMBNAILSTORE_ACTIVITYCHANGED, "CThumbnailStore::ActivityChanged - KDaemonProcessing;ret=%d;DaemonProcessing=%d", ret, DaemonProcessing );
             iIdle = EFalse;
             return;
             }
         
         TN_DEBUG1( "CThumbnailStore::ActivityChanged() - starting maintenance");
+        OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSTORE_ACTIVITYCHANGED, "CThumbnailStore::ActivityChanged - starting maintenance" );
         iIdle = ETrue;
         StartMaintenance();
         }
@@ -2845,6 +3040,7 @@
 TDriveNumber CThumbnailStoreDiskSpaceNotifierAO::GetDriveNumberL( const TDesC& aFilename )
     {
     TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::GetDriveNumberL()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTOREDISKSPACENOTIFIERAO_GETDRIVENUMBERL, "CThumbnailStoreDiskSpaceNotifierAO::GetDriveNumberL" );
     TLex driveParser( aFilename );
     
     TChar driveChar = driveParser.Get();
@@ -2852,6 +3048,7 @@
     if( 0 == driveChar || TChar( ':' ) != driveParser.Peek() )
         {
         TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::GetDriveNumberL() KErrArgument");
+        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTOREDISKSPACENOTIFIERAO_GETDRIVENUMBERL, "CThumbnailStoreDiskSpaceNotifierAO::GetDriveNumberL - KErrArgument" );
         User::Leave( KErrArgument );
         }
         
@@ -2865,6 +3062,7 @@
 CThumbnailStoreDiskSpaceNotifierAO::~CThumbnailStoreDiskSpaceNotifierAO()
     {
     TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::~CThumbnailStoreDiskSpaceNotifierAO()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTOREDISKSPACENOTIFIERAO_CTHUMBNAILSTOREDISKSPACENOTIFIERAO, "CThumbnailStoreDiskSpaceNotifierAO::~CThumbnailStoreDiskSpaceNotifierAO" );
     Cancel();
 
     iFileServerSession.Close();
@@ -2873,6 +3071,7 @@
 void CThumbnailStoreDiskSpaceNotifierAO::RunL()
     {   
     TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::RunL()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTOREDISKSPACENOTIFIERAO_RUNL, "CThumbnailStoreDiskSpaceNotifierAO::RunL" );
     TVolumeInfo volumeInfo;
 
     if ( iState == CThumbnailStoreDiskSpaceNotifierAO::ENormal )
@@ -2892,6 +3091,7 @@
                     if( volumeInfo.iFree < iThreshold )
                         {
                         TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::RunL() FULL");
+                        OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTOREDISKSPACENOTIFIERAO_RUNL, "CThumbnailStoreDiskSpaceNotifierAO::RunL - FULL" );
                         iDiskFull = ETrue;
                         iObserver.HandleDiskSpaceNotificationL( iDiskFull );
                         iState = EIterate;
@@ -2904,6 +3104,7 @@
                     else
                         {
                         TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::RunL() NOT FULL");
+                        OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSTOREDISKSPACENOTIFIERAO_RUNL, "CThumbnailStoreDiskSpaceNotifierAO::RunL - NOT FULL" );
                         iDiskFull = EFalse;
                         iObserver.HandleDiskSpaceNotificationL( iDiskFull );
                         }
@@ -2911,6 +3112,7 @@
                 else
                     {
                     TN_DEBUG2( "CThumbnailStoreDiskSpaceNotifierAO::RunL() error %d NOT FULL", ret);
+                    OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSTOREDISKSPACENOTIFIERAO_RUNL, "CThumbnailStoreDiskSpaceNotifierAO::RunL - NOT FULL;ret=%d", ret );
                     iDiskFull = EFalse;
                     iObserver.HandleDiskSpaceNotificationL( iDiskFull );
                     User::Leave( ret );
@@ -2921,6 +3123,7 @@
 
             case KErrArgument:
                 TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::RunL() KErrArgument");
+                OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSTOREDISKSPACENOTIFIERAO_RUNL, "CThumbnailStoreDiskSpaceNotifierAO::RunL - KErrArgument" );
                 User::Leave( status );
                 break;
             default:
@@ -2949,6 +3152,7 @@
                 if ( volumeInfo.iFree >= iThreshold )
                     {
                     TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::RunL() NOT FULL");
+                    OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILSTOREDISKSPACENOTIFIERAO_RUNL, "CThumbnailStoreDiskSpaceNotifierAO::RunL - NOT FULL" );
                     iDiskFull = EFalse;
                     }
                 }
@@ -2956,6 +3160,7 @@
         else
             {
             TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::RunL() NOT FULL");
+            OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILSTOREDISKSPACENOTIFIERAO_RUNL, "CThumbnailStoreDiskSpaceNotifierAO::RunL - NOT FULL" );
             iDiskFull = EFalse;
             }
         iState = ENormal;
@@ -2965,6 +3170,7 @@
     else
         {
         TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::RunL() KErrGeneral");
+        OstTrace0( TRACE_NORMAL, DUP7_CTHUMBNAILSTOREDISKSPACENOTIFIERAO_RUNL, "CThumbnailStoreDiskSpaceNotifierAO::RunL - KErrGeneral" );
         User::Leave( KErrGeneral );
         }
     }
@@ -2972,6 +3178,7 @@
 TInt CThumbnailStoreDiskSpaceNotifierAO::RunError(TInt aError)
     {
     TN_DEBUG2( "CThumbnailStoreDiskSpaceNotifierAO::RunError() %d", aError);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSTOREDISKSPACENOTIFIERAO_RUNERROR, "CThumbnailStoreDiskSpaceNotifierAO::RunError;aError=%d", aError );
     
     iObserver.HandleDiskSpaceError( aError );
     
@@ -2981,6 +3188,7 @@
 void CThumbnailStoreDiskSpaceNotifierAO::DoCancel()
     {
     TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::DoCancel()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTOREDISKSPACENOTIFIERAO_DOCANCEL, "CThumbnailStoreDiskSpaceNotifierAO::DoCancel" );
     
     if( IsActive() )
         {   
@@ -2994,12 +3202,14 @@
     iObserver( aObserver ), iThreshold( aThreshold ), iDrive( aDrive ), iState( CThumbnailStoreDiskSpaceNotifierAO::ENormal ), iDiskFull( EFalse )
     {
     TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::CThumbnailStoreDiskSpaceNotifierAO()");
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTOREDISKSPACENOTIFIERAO_CTHUMBNAILSTOREDISKSPACENOTIFIERAO, "CThumbnailStoreDiskSpaceNotifierAO::CThumbnailStoreDiskSpaceNotifierAO" );
     CActiveScheduler::Add( this );
     }
 
 void CThumbnailStoreDiskSpaceNotifierAO::ConstructL()
     {   
     TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::ConstructL()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILSTOREDISKSPACENOTIFIERAO_CONSTRUCTL, "CThumbnailStoreDiskSpaceNotifierAO::ConstructL" );
     TInt KMessageSlotCount = 2; // slots for NotifyDiskSpace and NotifyDiskSpaceCancel
 
     User::LeaveIfError( iFileServerSession.Connect( KMessageSlotCount ) );
@@ -3012,12 +3222,14 @@
         if ( volumeInfo.iFree < iThreshold )
             {
             TN_DEBUG1( "CThumbnailStoreDiskSpaceNotifierAO::ConstructL() FULL");
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSTOREDISKSPACENOTIFIERAO_CONSTRUCTL, "CThumbnailStoreDiskSpaceNotifierAO::ConstructL - FULL" );
             iDiskFull = ETrue;
             }
         }
     else
         {
         TN_DEBUG2( "CThumbnailStoreDiskSpaceNotifierAO::ConstructL() error %d NOT FULL", ret);
+        OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSTOREDISKSPACENOTIFIERAO_CONSTRUCTL, "CThumbnailStoreDiskSpaceNotifierAO::ConstructL - NOT FULL;ret=%d", ret );
         iDiskFull = EFalse;
         User::Leave( ret );
         }
@@ -3030,6 +3242,7 @@
 void CThumbnailStoreDiskSpaceNotifierAO::StartNotifier()
     {   
     TN_DEBUG2( "CThumbnailStoreDiskSpaceNotifierAO::StartNotifier() iDrive == %d", iDrive);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILSTOREDISKSPACENOTIFIERAO_STARTNOTIFIER, "CThumbnailStoreDiskSpaceNotifierAO::StartNotifier;iDrive=%d", iDrive );
     iFileServerSession.NotifyDiskSpace( iThreshold, iDrive, iStatus );
     
     SetActive();
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtask.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtask.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -25,6 +25,11 @@
 #include "thumbnailpanic.h"
 #include "thumbnailserversession.h"  // ConvertSqlErrToE32Err()
 #include "thumbnailmanagerconstants.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailtaskTraces.h"
+#endif
+
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -85,6 +90,9 @@
 void CThumbnailTask::StartL()
     {
     TN_DEBUG3( "CThumbnailTask(0x%08x)::StartL() iState == %d ", this, iState );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILTASK_STARTL, "CThumbnailTask::StartL;this=%o", this );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILTASK_STARTL, "CThumbnailTask::StartL;iState=%u", iState );
+    
     __ASSERT_DEBUG(( iState != ERunning ), ThumbnailPanic( EThumbnailAlreadyRunning ));
     iState = ERunning;
     }
@@ -108,6 +116,8 @@
     {
     TN_DEBUG4( "CThumbnailTask(0x%08x)::Complete(aReason=%d) iState was %d",
         this, aReason, iState );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILTASK_COMPLETE, "CThumbnailTask::Complete;this=%o", this );
+    OstTraceExt2( TRACE_NORMAL, DUP1_CTHUMBNAILTASK_COMPLETE, "CThumbnailTask::Complete;aReason=%d;iState=%u", aReason, iState );
     
     if ( iState != EComplete )
         {
@@ -156,6 +166,9 @@
     // This is called if StartL() left. Complete this task with an error and
     // continue processing.
     TN_DEBUG3( "CThumbnailTask(0x%08x)::StartError(aError=%d)", this, aError );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILTASK_STARTERROR, "CThumbnailTask::StartError;this=%o", this );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILTASK_STARTERROR, "CThumbnailTask::StartError;aError=%d", aError );
+    
     Complete( aError );
     }
 
@@ -189,6 +202,7 @@
     else
         {
         TN_DEBUG2( "CThumbnailTask(0x%08x)::ClientThreadAlive() - message null", this);
+        OstTrace1( TRACE_NORMAL, CTHUMBNAILTASK_SETMESSAGEDATA, "CThumbnailTask::SetMessageData - message null;this=%o", this );
         }
     }
 
@@ -247,6 +261,7 @@
 TBool CThumbnailTask::ClientThreadAlive(const TBool aGetThread)
     {
     TN_DEBUG1( "CThumbnailTask::ClientThreadAlive()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILTASK_CLIENTTHREADALIVE, "CThumbnailTask::ClientThreadAlive" );
     
     if ( iMessage.Handle())
         {
@@ -257,6 +272,7 @@
             if (err != KErrNone)
                 {
                 TN_DEBUG2( "CThumbnailTask(0x%08x)::ClientThreadAlive() - client thread not found", this);
+                OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILTASK_CLIENTTHREADALIVE, "CThumbnailTask::ClientThreadAlive - client thread not found;this=%o", this );
             
                 ResetMessageData();
                 
@@ -269,6 +285,7 @@
         if( exitType != EExitPending )
             {
             TN_DEBUG2( "CThumbnailTask(0x%08x)::ClientThreadAlive() - client thread died", this);
+            OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILTASK_CLIENTTHREADALIVE, "CThumbnailTask::ClientThreadAlive -  client thread died;this=%o", this );
         
             ResetMessageData();
             
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtaskprocessor.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtaskprocessor.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -25,6 +25,11 @@
 #include "thumbnailmanagerconstants.h"
 #include "thumbnailgeneratetask.h"
 #include "thumbnailpanic.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailtaskprocessorTraces.h"
+#endif
+
 
 
 // ======== MEMBER FUNCTIONS ========
@@ -66,17 +71,21 @@
     // define PS property
     TInt ret = RProperty::Delete(KServerIdle, KIdle);
     TN_DEBUG2( "CThumbnailTaskProcessor::CThumbnailTaskProcessor() Delete KServerIdle %d", ret);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILTASKPROCESSOR_CONSTRUCTL, "CThumbnailTaskProcessor::ConstructL - Delete KServerIdle;ret=%d", ret );
     
     ret=RProperty::Define(KServerIdle, KIdle, RProperty::EInt);
     TN_DEBUG2( "CThumbnailTaskProcessor::ConstructL() Define KServerIdle %d", ret);
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILTASKPROCESSOR_CONSTRUCTL, "CThumbnailTaskProcessor::ConstructL - Define KServerIdle;ret=%d", ret );
     
     // attach to the property    
 	ret = iProperty.Attach(KServerIdle, KIdle, EOwnerThread);
     TN_DEBUG2( "CThumbnailTaskProcessor::ConstructL()Attach %d", ret);
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILTASKPROCESSOR_CONSTRUCTL, "CThumbnailTaskProcessor::ConstructL - Attach;ret=%d", ret );
     
 	// set initial PS value
     ret = iProperty.Set( ETrue );
     TN_DEBUG2( "CThumbnailTaskProcessor::ConstructL() Set IDLE ETrue %d", ret );
+    OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILTASKPROCESSOR_CONSTRUCTL, "CThumbnailTaskProcessor::ConstructL - Set IDLE ETrue;ret=%d", ret );
     iIdle = ETrue;
     
     iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityIdle);
@@ -99,6 +108,7 @@
     iProperty.Close();
     TInt ret = RProperty::Delete(KServerIdle, KIdle);
     TN_DEBUG2( "CThumbnailTaskProcessor::CThumbnailTaskProcessor() Delete KServerIdle %d", ret);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILTASKPROCESSOR_CTHUMBNAILTASKPROCESSOR, "CThumbnailTaskProcessor::~CThumbnailTaskProcessor - Delete KServerIdle;ret=%d", ret );
     
     if(iPeriodicTimer)
        {
@@ -117,6 +127,7 @@
 void CThumbnailTaskProcessor::AddTaskL( CThumbnailTask* aTask )
     {
     TN_DEBUG1( "CThumbnailTaskProcessor::AddTaskL()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILTASKPROCESSOR_ADDTASKL, "CThumbnailTaskProcessor::AddTaskL" );
     __ASSERT_DEBUG(( aTask ), ThumbnailPanic( EThumbnailNullPointer ));
     const TInt taskCount = iTasks.Count();
     iTasks.AppendL( aTask );
@@ -142,6 +153,7 @@
     aRequestId )
     {
     TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTask() - request ID: %d", aRequestId.iRequestId);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILTASKPROCESSOR_REMOVETASK, "CThumbnailTaskProcessor::RemoveTask;aRequestId.iRequestId=%u", aRequestId.iRequestId );
     
     TBool cancel = EFalse;
     TInt res = KErrNotFound;
@@ -159,6 +171,7 @@
                 iTasks.Remove( i );
                 
                 TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTask() - removed request ID: %d", aRequestId.iRequestId);
+                OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILTASKPROCESSOR_REMOVETASK, "CThumbnailTaskProcessor::RemoveTask - removed request ID:;aRequestId.iRequestId=%u", aRequestId.iRequestId );
                 }
             else
                 {
@@ -170,6 +183,7 @@
                 cancel = ETrue;
                 
                 TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTask() - canceled & removed request ID: %d", aRequestId.iRequestId);
+                OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILTASKPROCESSOR_REMOVETASK, "CThumbnailTaskProcessor::RemoveTask - canceled & removed request ID:;aRequestId.iRequestId=%u", aRequestId.iRequestId );
                 }
             
             res = KErrNone;
@@ -191,7 +205,7 @@
         }
     
     TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTask() - remaining task count: %d", iTasks.Count());
-    
+    OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILTASKPROCESSOR_REMOVETASK, "CThumbnailTaskProcessor::RemoveTask -  - remaining task count;iTasks.Count()=%d", iTasks.Count() );
     return res;
     }
 
@@ -203,6 +217,7 @@
 void CThumbnailTaskProcessor::RemoveTasks( CThumbnailServerSession* aSession )
     {
     TN_DEBUG1( "CThumbnailTaskProcessor::RemoveTasks()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILTASKPROCESSOR_REMOVETASKS, "CThumbnailTaskProcessor::RemoveTasks" );
     
     TBool cancel = EFalse;
     
@@ -222,10 +237,12 @@
                 iTasks.Remove( i );
                 
                 TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTasks() - removed request ID: %d", id);
+                OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILTASKPROCESSOR_REMOVETASKS, "CThumbnailTaskProcessor::RemoveTasks - removed request ID;id=%d", id );
                 }
             else
                 {
                 TN_DEBUG1( "CThumbnailTaskProcessor::RemoveTasks() - task still running");
+                OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILTASKPROCESSOR_REMOVETASKS, "CThumbnailTaskProcessor::RemoveTasks - task still running" );
                 
                 TThumbnailRequestId id = task->RequestId().iRequestId;
                 
@@ -237,6 +254,7 @@
                 cancel = ETrue;
                 
                 TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTasks() - canceled & removed request ID: %d", id);
+                OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILTASKPROCESSOR_REMOVETASKS, "CThumbnailTaskProcessor::RemoveTasks - canceled & removed request ID;id=%d", id );
                 }
             }
         }
@@ -249,6 +267,7 @@
         }
     
     TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTasks() - remaining task count: %d", iTasks.Count());
+    OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILTASKPROCESSOR_REMOVETASKS, "CThumbnailTaskProcessor::RemoveTasks - remaining task count;iTasks.Count()=%d", iTasks.Count() );
     }
 
 // ---------------------------------------------------------------------------
@@ -259,6 +278,7 @@
 void CThumbnailTaskProcessor::RemoveAllTasks()
     {
     TN_DEBUG1( "CThumbnailTaskProcessor::RemoveAllTasks()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILTASKPROCESSOR_REMOVEALLTASKS, "CThumbnailTaskProcessor::RemoveAllTasks" );
     
     TBool cancel = EFalse;
     
@@ -275,10 +295,12 @@
             iTasks.Remove( i );
             
             TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTasks() - removed request ID: %d", id);
+            OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILTASKPROCESSOR_REMOVEALLTASKS, "CThumbnailTaskProcessor::RemoveAllTasks -  removed request ID;id=%d", id );
             }
         else
             {
             TN_DEBUG1( "CThumbnailTaskProcessor::RemoveTasks() - task still running");
+            OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILTASKPROCESSOR_REMOVEALLTASKS, "CThumbnailTaskProcessor::RemoveAllTasks - task still running" );
             
             TThumbnailRequestId id = task->RequestId().iRequestId;
             
@@ -290,6 +312,7 @@
             cancel = ETrue;
             
             TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTasks() - canceled & removed request ID: %d", id);
+            OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILTASKPROCESSOR_REMOVEALLTASKS, "CThumbnailTaskProcessor::RemoveAllTasks - canceled & removed request ID;id=%d", id );
             }
         }
     
@@ -301,6 +324,7 @@
         }
     
     TN_DEBUG1( "CThumbnailTaskProcessor::RemoveAllTasks() - Task removed because of starting format" );
+    OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILTASKPROCESSOR_REMOVEALLTASKS, "CThumbnailTaskProcessor::RemoveAllTasks - Task removed because of starting format" );
     }
 
 // ---------------------------------------------------------------------------
@@ -339,6 +363,7 @@
     
 #ifdef _DEBUG
     TN_DEBUG2( "CThumbnailTaskProcessor::TASKPROCESSOR-COUNTER---------- in, Tasks = %d", iTasks.Count() );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILTASKPROCESSOR_RUNL, "CThumbnailTaskProcessor::TASKPROCESSOR-COUNTER---------- in, Tasks;iTasks.Count()=%d", iTasks.Count() );
 #endif
     
     // remove completed tasks and run priorised task
@@ -369,6 +394,7 @@
                 if(task->GetMessageData().Identity() != KDaemonUid )
                     {
                     TN_DEBUG1( "CThumbnailTaskProcessor::RunL() processingDaemonTasksOnly = EFalse" );
+                    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILTASKPROCESSOR_RUNL, "CThumbnailTaskProcessor::RunL processingDaemonTasksOnly = EFalse" );
                     processingDaemonTasksOnly = EFalse; 
                     }
                 }
@@ -382,6 +408,7 @@
     
 #ifdef _DEBUG
     TN_DEBUG2( "CThumbnailTaskProcessor::TASKPROCESSOR-COUNTER---------- out, Tasks = %d", iTasks.Count() );
+    OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILTASKPROCESSOR_RUNL, "CThumbnailTaskProcessor::TASKPROCESSOR-COUNTER---------- out, Tasks;iTasks.Count()=%d", iTasks.Count() );
 #endif
 
 	//update PS value for Daemon
@@ -395,6 +422,7 @@
            }
         TInt ret = iProperty.Set( EFalse );
         TN_DEBUG2( "CThumbnailTaskProcessor::RunL() iProperty Set EFalse %d", ret );
+        OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILTASKPROCESSOR_RUNL, "CThumbnailTaskProcessor::RunL - iProperty Set EFalse;ret=%d", ret );
         iIdle = EFalse;
         }
     else
@@ -410,6 +438,7 @@
                  iTimerActive = EFalse;
                  } 
                TN_DEBUG1( "CThumbnailTaskProcessor::RunL() - daemon is the process");
+               OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILTASKPROCESSOR_RUNL, "CThumbnailTaskProcessor::RunL - daemon is the process" );
                TInt ret = iProperty.Set( ETrue );
                TN_DEBUG2( "CThumbnailTaskProcessor::RunL() iProperty Set ETrue %d", ret );
                iIdle = ETrue;
@@ -417,6 +446,7 @@
             else
                {
                TN_DEBUG1( "CThumbnailTaskProcessor::RunL() - daemon is not the process - start timer");
+               OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILTASKPROCESSOR_RUNL, "CThumbnailTaskProcessor::RunL - daemon is not the process - start timer" );
                if(iTimerActive)
                   {
                   iPeriodicTimer->Cancel();
@@ -437,6 +467,7 @@
 TInt CThumbnailTaskProcessor::RunError( TInt aError )
     {
     TN_DEBUG1( "CThumbnailTaskProcessor::RunError()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILTASKPROCESSOR_RUNERROR, "CThumbnailTaskProcessor::RunError" );
     if ( iActiveTask )
         {
         // This will complete the task and continue processing from the
@@ -464,6 +495,7 @@
 void CThumbnailTaskProcessor::TaskComplete( CThumbnailTask*  /*aTask*/ )
     {
     TN_DEBUG1( "CThumbnailTaskProcessor::TaskComplete()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILTASKPROCESSOR_TASKCOMPLETE, "CThumbnailTaskProcessor::TaskComplete" );
  
     if ( iTasks.Count() && !IsActive())
         {
@@ -482,8 +514,10 @@
               iTimerActive = EFalse;
               } 
             TN_DEBUG1( "CThumbnailTaskProcessor::TaskComplete() - daemon is the process");
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILTASKPROCESSOR_TASKCOMPLETE, "CThumbnailTaskProcessor::TaskComplete - daemon is the process" );
             TInt ret = iProperty.Set( ETrue );
             TN_DEBUG2( "CThumbnailTaskProcessor::TaskComplete() iProperty Set ETrue %d", ret );
+            OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILTASKPROCESSOR_TASKCOMPLETE, "CThumbnailTaskProcessor::TaskComplete - iProperty Set ETrue;ret=%d", ret );
             iIdle = ETrue;
             }
         else
@@ -507,6 +541,7 @@
 TInt CThumbnailTaskProcessor::PeriodicTimerCallBack(TAny* aAny)
     {
     TN_DEBUG1( "CThumbnailTaskProcessor::PeriodicTimerCallBack()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILTASKPROCESSOR_PERIODICTIMERCALLBACK, "CThumbnailTaskProcessor::PeriodicTimerCallBack" );
     
     CThumbnailTaskProcessor* self = static_cast<CThumbnailTaskProcessor*>( aAny );
     
@@ -514,6 +549,7 @@
     self->iPeriodicTimer->Cancel();
     TInt ret = self->iProperty.Set( ETrue );
     TN_DEBUG2( "CThumbnailTaskProcessor::PeriodicTimerCallBack() iProperty Set ETrue %d", ret );
+    OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILTASKPROCESSOR_PERIODICTIMERCALLBACK, "CThumbnailTaskProcessor::PeriodicTimerCallBack - iProperty Set ETrue;ret=%d", ret );
     self->iIdle = ETrue;
 
     return KErrNone; // Return value ignored by CPeriodic
@@ -522,6 +558,7 @@
 void CThumbnailTaskProcessor::SetDaemonAsProcess(TBool aValue)
     {
     TN_DEBUG2( "CThumbnailTaskProcessor::SetDaemonAsProcess() Daemon set %d", aValue );
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILTASKPROCESSOR_SETDAEMONASPROCESS, "CThumbnailTaskProcessor::SetDaemonAsProcess - Daemon set;aValue=%d", aValue );
     iIsDaemonAsProcess = aValue;
     }
 
--- a/imagehandlingutilities/thumbnailmanager/tmcommon/src/tmactivitymanager.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/tmcommon/src/tmactivitymanager.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -17,6 +17,10 @@
 
 #include "tmactivitymanager.h"
 #include "thumbnaillog.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tmactivitymanagerTraces.h"
+#endif
 
 // ---------------------------------------------------------------------------
 // CTMActivityManager::NewL()
@@ -25,6 +29,7 @@
 CTMActivityManager* CTMActivityManager::NewL(MTMActivityManagerObserver* aObserver, TInt aTimeout)
     {
     TN_DEBUG1( "CTMActivityManager::NewL()");
+    OstTrace0( TRACE_NORMAL, CTMACTIVITYMANAGER_NEWL, "CTMActivityManager::NewL" );
     
     CTMActivityManager* self = new (ELeave) CTMActivityManager(aObserver, aTimeout);
     CleanupStack::PushL(self);
@@ -41,6 +46,7 @@
 : CActive(CActive::EPriorityHigh), iObserver(aObserver), iTimeout(aTimeout), iPreviousStatus(KErrNotFound)
     {
     TN_DEBUG1( "CTMActivityManager::CTMActivityManager()");
+    OstTrace0( TRACE_NORMAL, CTMACTIVITYMANAGER_CTMACTIVITYMANAGER, "CTMActivityManager::CTMActivityManager" );
     
     CActiveScheduler::Add(this);
     }
@@ -52,6 +58,7 @@
 CTMActivityManager::~CTMActivityManager()
     {
     TN_DEBUG1( "CTMActivityManager::~CTMActivityManager()");
+    OstTrace0( TRACE_NORMAL, DUP1_CTMACTIVITYMANAGER_CTMACTIVITYMANAGER, "CTMActivityManager::~CTMActivityManager" );
     
     iObserver = NULL;
     Cancel();
@@ -72,6 +79,7 @@
 void CTMActivityManager::ConstructL()
     {
     TN_DEBUG1( "CTMActivityManager::ConstructL()");
+    OstTrace0( TRACE_NORMAL, CTMACTIVITYMANAGER_CONSTRUCTL, "CTMActivityManager::ConstructL" );
     
     iTimer.CreateLocal();
     iWatch = ENone;
@@ -84,6 +92,7 @@
 void CTMActivityManager::SetTimeout(TInt aTimeout)
     {
     TN_DEBUG1( "CTMActivityManager::SetTimeout()");
+    OstTrace0( TRACE_NORMAL, CTMACTIVITYMANAGER_SETTIMEOUT, "CTMActivityManager::SetTimeout" );
     
     iTimeout = aTimeout;
     Reset();
@@ -96,6 +105,7 @@
 void CTMActivityManager::Reset()
     {
     TN_DEBUG1( "CTMActivityManager::Reset()");
+    OstTrace0( TRACE_NORMAL, CTMACTIVITYMANAGER_RESET, "CTMActivityManager::Reset" );
 
 #ifdef MONITOR_LIGHTS
     delete iLight;
@@ -112,6 +122,7 @@
 void CTMActivityManager::DoCancel()
     {
     TN_DEBUG1( "CTMActivityManager::DoCancel()");
+    OstTrace0( TRACE_NORMAL, CTMACTIVITYMANAGER_DOCANCEL, "CTMActivityManager::DoCancel" );
     
 #ifdef MONITOR_LIGHTS
     delete iLight;
@@ -129,6 +140,7 @@
 void CTMActivityManager::Start()
     {
     TN_DEBUG1( "CTMActivityManager::Start()");
+    OstTrace0( TRACE_NORMAL, CTMACTIVITYMANAGER_START, "CTMActivityManager::Start" );
     
 #ifdef MONITOR_LIGHTS
     if(!iLight)
@@ -157,10 +169,13 @@
 void CTMActivityManager::RunL()
     {
     TN_DEBUG4( "CTMActivityManager::RunL(0x%08x) %d, observer = 0x%08x", this, iStatus.Int(), iObserver);
+    OstTrace1( TRACE_NORMAL, CTMACTIVITYMANAGER_RUNL, "CTMActivityManager::RunL;this=%o", this );
+    OstTrace1( TRACE_NORMAL, DUP5_CTMACTIVITYMANAGER_RUNL, "CTMActivityManager::RunL;iStatus.Int()=%d", iStatus.Int() );
     
     if(iFirstRound)
         {
         TN_DEBUG1( "CTMActivityManager::RunL() iFirstRound");
+        OstTrace0( TRACE_NORMAL, DUP1_CTMACTIVITYMANAGER_RUNL, "CTMActivityManager::RunL - iFirstRound" );
         iFirstRound = EFalse;
         if (!IsActive())
              {
@@ -180,6 +195,7 @@
             if (inactivity >= iTimeout)
                 {
                 TN_DEBUG1( "CTMActivityManager::RunL() inactive");
+                OstTrace0( TRACE_NORMAL, DUP2_CTMACTIVITYMANAGER_RUNL, "CTMActivityManager::RunL - inactive" );
                 NotifyObserver();
 
                 if (!IsActive()) //observer might have called a Reset()
@@ -196,6 +212,7 @@
         else if (iWatch == EWaitingForActivity)
             {
             TN_DEBUG1( "CTMActivityManager::RunL() active");
+            OstTrace0( TRACE_NORMAL, DUP3_CTMACTIVITYMANAGER_RUNL, "CTMActivityManager::RunL - active" );
             NotifyObserver();
              
             if (!IsActive()) //observer might have called a Reset()
@@ -215,6 +232,7 @@
         iWatch = ENone;
         }
         TN_DEBUG1( "CTMActivityManager::RunL() end");
+        OstTrace0( TRACE_NORMAL, DUP4_CTMACTIVITYMANAGER_RUNL, "CTMActivityManager::RunL - end" );
     }
 
 // ---------------------------------------------------------------------------
@@ -224,6 +242,7 @@
 TInt CTMActivityManager::RunError(TInt aError)
     {
     TN_DEBUG2( "CTMActivityManager::RunError() %d", aError);
+    OstTrace1( TRACE_NORMAL, CTMACTIVITYMANAGER_RUNERROR, "CTMActivityManager::RunError;aError=%d", aError );
     
     if (aError != KErrNone)
         {
@@ -242,10 +261,14 @@
     {
 #ifdef MONITOR_LIGHTS
 #ifdef _DEBUG
+TInt inactivityTime = User::InactivityTime().Int();
 TN_DEBUG3( "CTMActivityManager::IsInactive()= %d, iLights = %d", User::InactivityTime().Int(), iLights);
+OstTrace1( TRACE_NORMAL, DUP6_CTMACTIVITYMANAGER_RUNL, "CTMActivityManager::RunL;inactivityTime=%d", inactivityTime );
 #endif
 #else
+TInt inactivityTime = User::InactivityTime().Int();
 TN_DEBUG2( "CTMActivityManager::IsInactive()= %d", User::InactivityTime().Int());
+OstTrace1( TRACE_NORMAL, DUP7_CTMACTIVITYMANAGER_RUNL, "CTMActivityManager::RunL;inactivityTime=%d", inactivityTime );
 #endif
 
     //if lights are off or inactivity timer is less that target the device is not idle
@@ -256,9 +279,11 @@
             )
       {
       TN_DEBUG1( "CTMActivityManager::IsInactive() ETrue");
+      OstTrace0( TRACE_NORMAL, CTMACTIVITYMANAGER_ISINACTIVE, "CTMActivityManager::IsInactive - ETrue" );
       return ETrue;
       }
     TN_DEBUG1( "CTMActivityManager::IsInactive() EFalse");
+    OstTrace0( TRACE_NORMAL, DUP1_CTMACTIVITYMANAGER_ISINACTIVE, "CTMActivityManager::IsInactive - EFalse" );
     return EFalse;
     }
 
@@ -270,17 +295,20 @@
 void CTMActivityManager::LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus)
     {
     TN_DEBUG3( "CTMActivityManager::LightStatusChanged() aTarget = %d, aStatus == %d", aTarget, aStatus);
+    OstTraceExt2( TRACE_NORMAL, CTMACTIVITYMANAGER_LIGHTSTATUSCHANGED, "CTMActivityManager::LightStatusChanged;aTarget=%d;aStatus=%u", aTarget, aStatus );    
     
     if(aTarget & CHWRMLight::EPrimaryDisplay)
         {
          if( aStatus == CHWRMLight::ELightOff )
             {
             TN_DEBUG1( "CTMActivityManager::LightStatusChanged() -- OFF");
+            OstTrace0( TRACE_NORMAL, DUP1_CTMACTIVITYMANAGER_LIGHTSTATUSCHANGED, "CTMActivityManager::LightStatusChanged - OFF" );
             iLights = EFalse;
             }
         else
             {
             TN_DEBUG1( "CTMActivityManager::LightStatusChanged() -- ON");
+            OstTrace0( TRACE_NORMAL, DUP2_CTMACTIVITYMANAGER_LIGHTSTATUSCHANGED, "CTMActivityManager::LightStatusChanged - ON" );
             iLights = ETrue;
             }
      
@@ -296,6 +324,7 @@
 void CTMActivityManager::NotifyObserver()
     {
     TN_DEBUG1( "void CTMAActivityManager::NotifyObserver()");
+    OstTrace0( TRACE_NORMAL, CTMACTIVITYMANAGER_NOTIFYOBSERVER, "CTMActivityManager::NotifyObserver" );
     
     TBool status = IsInactive();
     
--- a/imagehandlingutilities/thumbnailmanager/tmcommon/src/tmformatobserver.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/tmcommon/src/tmformatobserver.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -20,6 +20,10 @@
  
 #include <e32base.h>
 #include <f32file.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tmformatobserverTraces.h"
+#endif
 
 
 // ======== MEMBER FUNCTIONS ========
@@ -28,6 +32,7 @@
     iObserver( aObserver )
     {
     TN_DEBUG1( "CTMFormatObserver::CTMFormatObserver()");
+    OstTrace0( TRACE_NORMAL, CTMFORMATOBSERVER_CTMFORMATOBSERVER, "CTMFormatObserver::CTMFormatObserver" );
     }
     
     
@@ -38,6 +43,7 @@
 void CTMFormatObserver::ConstructL()
     {
     TN_DEBUG1("CTMFormatObserver::ConstructL");
+    OstTrace0( TRACE_NORMAL, CTMFORMATOBSERVER_CONSTRUCTL, "CTMFormatObserver::ConstructL" );
 
     iBackupSession = CBaBackupSessionWrapper::NewL();
     iBackupSession->RegisterBackupOperationObserverL( *this );
@@ -91,6 +97,7 @@
 void CTMFormatObserver::PollStatus()
     { 
     TN_DEBUG1("CTMFormatObserver::PollStatus()");
+    OstTrace0( TRACE_NORMAL, CTMFORMATOBSERVER_POLLSTATUS, "CTMFormatObserver::PollStatus" );
     
     TBool formatting = iBackupSession->IsBackupOperationRunning();
     
@@ -109,6 +116,7 @@
                   const TBackupOperationAttributes& aBackupOperationAttributes)
     {
     TN_DEBUG1("CTMFormatObserver::HandleBackupOperationEventL");
+    OstTrace0( TRACE_NORMAL, CTMFORMATOBSERVER_HANDLEBACKUPOPERATIONEVENTL, "CTMFormatObserver::HandleBackupOperationEventL" );
 
     if( aBackupOperationAttributes.iOperation == EStart )
         {
--- a/imagehandlingutilities/thumbnailmanager/tmcommon/src/tmshutdownobserver.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/tmcommon/src/tmshutdownobserver.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -21,6 +21,11 @@
 #include "tmshutdownobserver.h"
 #include "thumbnailmanagerconstants.h"
 #include "thumbnaillog.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tmshutdownobserverTraces.h"
+#endif
+
 
 // ---------------------------------------------------------------------------
 // CTMShutdownObserver::NewL()
@@ -62,10 +67,12 @@
 void CTMShutdownObserver::ConstructL()
     { 
     TN_DEBUG1( "CTMShutdownObserver::ConstructL()" );
+    OstTrace0( TRACE_NORMAL, CTMSHUTDOWNOBSERVER_CONSTRUCTL, "CTMShutdownObserver::ConstructL" );
     // define P&S property types
     if (iDefineKey)
         {
         TN_DEBUG1( "CTMShutdownObserver::ConstructL() define" );
+        OstTrace0( TRACE_NORMAL, DUP1_CTMSHUTDOWNOBSERVER_CONSTRUCTL, "CTMShutdownObserver::ConstructL - define" );
         RProperty::Define(iKeyCategory,iPropertyKey,
                           RProperty::EInt,KAllowAllPolicy,KPowerMgmtPolicy);
         }
@@ -73,11 +80,13 @@
     // attach to the property
     TInt err = iProperty.Attach(iKeyCategory,iPropertyKey,EOwnerThread);
     TN_DEBUG2( "CTMShutdownObserver::ConstructL() attach err = %d", err );
+    OstTrace1( TRACE_NORMAL, DUP2_CTMSHUTDOWNOBSERVER_CONSTRUCTL, "CTMShutdownObserver::ConstructL - attach;err=%d", err );
     User::LeaveIfError(err);
     
     // wait for the previously attached property to be updated
     iProperty.Subscribe(iStatus);
     TN_DEBUG1( "CTMShutdownObserver::ConstructL() subscribe" );
+    OstTrace0( TRACE_NORMAL, DUP3_CTMSHUTDOWNOBSERVER_CONSTRUCTL, "CTMShutdownObserver::ConstructL - subscribe" );
     SetActive();
     }
 
@@ -88,6 +97,7 @@
 CTMShutdownObserver::~CTMShutdownObserver()
     {
     TN_DEBUG1( "CTMShutdownObserver::~CTMShutdownObserver()" );
+    OstTrace0( TRACE_NORMAL, CTMSHUTDOWNOBSERVER_CTMSHUTDOWNOBSERVER, "CTMShutdownObserver::~CTMShutdownObserver" );
     Cancel();
     iProperty.Close();
     }
@@ -99,6 +109,7 @@
 void CTMShutdownObserver::RunL()
     {
     TN_DEBUG2( "CTMShutdownObserver::RunL(%d)", iStatus.Int() );
+    OstTrace1( TRACE_NORMAL, CTMSHUTDOWNOBSERVER_RUNL, "CTMShutdownObserver::RunL;iStatus.Int()=%d", iStatus.Int() );
     // resubscribe before processing new value to prevent missing updates
     iProperty.Subscribe(iStatus);
     SetActive();
@@ -108,6 +119,7 @@
     TInt err = iProperty.Get(value);
     
     TN_DEBUG2( "CTMShutdownObserver::RunL() Get err = %d", err );
+    OstTrace1( TRACE_NORMAL, DUP1_CTMSHUTDOWNOBSERVER_RUNL, "CTMShutdownObserver::RunL - get err;err=%d", err );
 
     // observer callback
     if (value)
@@ -123,6 +135,7 @@
 void CTMShutdownObserver::DoCancel()
     {
     TN_DEBUG1( "CTMShutdownObserver::DoCancel()" );
+    OstTrace0( TRACE_NORMAL, CTMSHUTDOWNOBSERVER_DOCANCEL, "CTMShutdownObserver::DoCancel" );
     iProperty.Cancel();
     }
 
--- a/imagehandlingutilities/thumbnailmanager/tmcommon/src/tmsrproptertyobserver.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/tmcommon/src/tmsrproptertyobserver.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -21,6 +21,11 @@
 #include "tmrpropertyobserver.h"
 #include "thumbnailmanagerconstants.h"
 #include "thumbnaillog.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tmsrproptertyobserverTraces.h"
+#endif
+
 
 // ---------------------------------------------------------------------------
 // CTMRPropertyObserver::NewL()
@@ -62,6 +67,7 @@
 void CTMRPropertyObserver::ConstructL()
     { 
     TN_DEBUG1( "CTMRPropertyObserver::ConstructL()");
+    OstTrace0( TRACE_NORMAL, CTMRPROPERTYOBSERVER_CONSTRUCTL, "CTMRPropertyObserver::ConstructL" );
     // define P&S property types
     if (iDefineKey)
         {
@@ -85,6 +91,7 @@
 CTMRPropertyObserver::~CTMRPropertyObserver()
     {
     TN_DEBUG1( "CTMRPropertyObserver::~CTMRPropertyObserver()");
+    OstTrace0( TRACE_NORMAL, CTMRPROPERTYOBSERVER_CTMRPROPERTYOBSERVER, "CTMRPropertyObserver::~CTMRPropertyObserver" );
     Cancel();
     iProperty.Close();
     }
@@ -96,6 +103,7 @@
 void CTMRPropertyObserver::RunL()
     {
     TN_DEBUG1( "CTMRPropertyObserver::RunL()");
+    OstTrace0( TRACE_NORMAL, CTMRPROPERTYOBSERVER_RUNL, "CTMRPropertyObserver::RunL" );
     // resubscribe before processing new value to prevent missing updates
     iProperty.Subscribe(iStatus);
     SetActive();
@@ -115,6 +123,7 @@
 void CTMRPropertyObserver::DoCancel()
     {
     TN_DEBUG1( "CTMRPropertyObserver::DoCancel()");
+    OstTrace0( TRACE_NORMAL, CTMRPROPERTYOBSERVER_DOCANCEL, "CTMRPropertyObserver::DoCancel" );
     iProperty.Cancel();
     }
 
--- a/imagehandlingutilities/thumbnailmanager/tmiadrestart/group/tmiadrestart.mmp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/tmiadrestart/group/tmiadrestart.mmp	Mon Aug 23 13:32:17 2010 +0300
@@ -35,7 +35,7 @@
 
 USERINCLUDE             ../inc
 USERINCLUDE             ../../inc
-USERINCLUDE             ../../thumbagdaemon/inc
+USERINCLUDE             ../../thumbagdaemon/inc ../traces
 
 LIBRARY                 euser.lib
 
--- a/imagehandlingutilities/thumbnailmanager/tmiadrestart/src/tmiadrestart.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/tmiadrestart/src/tmiadrestart.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -22,11 +22,17 @@
 #include "thumbnaillog.h"
 
 #include "thumbnailmanagerconstants.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tmiadrestartTraces.h"
+#endif
 
 LOCAL_C void MainL()
     {
     // delay so that cenrep has time to read new config
     TN_DEBUG1( "MainL() after" );
+    OstTrace0( TRACE_NORMAL, _MAINL, "::MainL - after" );
+    
     User::After(5000000);
     
     TInt res( KErrNone );
@@ -35,60 +41,74 @@
     
     // find and terminate Thumb AG Daemon
     TN_DEBUG1( "MainL() KTAGDaemonProcess find" );
+    OstTrace0( TRACE_NORMAL, DUP1__MAINL, "::MainL - find" );
     TFindProcess findProcess( KTAGDaemonProcess );   
 
     if ( findProcess.Next(name) == KErrNone )
         {
         res = process.Open(name);
         TN_DEBUG2( "MainL() KTAGDaemonProcess open res = %d", res );    
+        OstTrace1( TRACE_NORMAL, DUP2__MAINL, "::MainL;res=%d - open res", res );
         
         // logon to get termination signal
         TRequestStatus status;
         TN_DEBUG1( "MainL() KTAGDaemonProcess logon" );
+        OstTrace0( TRACE_NORMAL, DUP3__MAINL, "::MainL - logon" );
         process.Logon(status);
 
         // shutdown using P&S key
         TN_DEBUG2( "MainL() KTAGDaemonProcess Set = %d", res );
+        OstTrace1( TRACE_NORMAL, DUP4__MAINL, "::MainL - Set = res;res=%d", res );
         res = RProperty::Set(KTAGDPSNotification,KShutdown,1);
        
         // blocks here until thread is terminated
         TN_DEBUG1( "MainL() KTAGDaemonProcess wait" );
+        OstTrace0( TRACE_NORMAL, DUP5__MAINL, "::MainL - KTAGDaemonProcess wait" );
         User::WaitForRequest(status);
         
         // reset key
         TN_DEBUG1( "MainL() KTAGDaemonProcess reset" );
+        OstTrace0( TRACE_NORMAL, DUP6__MAINL, "::MainL - KTAGDaemonProcess reset" );
         res = RProperty::Set(KTAGDPSNotification, KShutdown, 0);
         
         TN_DEBUG1( "MainL() KTAGDaemonProcess close" );
+        OstTrace0( TRACE_NORMAL, DUP7__MAINL, "::MainL - close" );
         process.Close();
         }
     
     // find and terminate Thumbnail Server
     TFindProcess findProcess2( KThumbnailServerProcess );
     TN_DEBUG1( "MainL() KThumbnailServerProcess find" );
+    OstTrace0( TRACE_NORMAL, DUP8__MAINL, "::MainL - find" );
     if ( findProcess2.Next(name) == KErrNone )
         {
         res = process.Open(name);
         TN_DEBUG2( "MainL() KThumbnailServerProcess open res = %d", res );
+        OstTrace1( TRACE_NORMAL, DUP9__MAINL, "::MainL - KThumbnailServerProcess open;res=%d", res );
         
         // logon to get termination signal
         TRequestStatus status;
         TN_DEBUG1( "MainL() KThumbnailServerProcess logon" );
+        OstTrace0( TRACE_NORMAL, DUP10__MAINL, "::MainL - KThumbnailServerProcess logon" );
         process.Logon(status);
           
         // shutdown using P&S key
         TN_DEBUG2( "MainL() KThumbnailServerProcess Set res = %d", res );
+        OstTrace1( TRACE_NORMAL, DUP11__MAINL, "::MainL - KThumbnailServerProcess Set;res=%d", res );
         res = RProperty::Set(KTMPSNotification,KShutdown,1);
          
         // blocks here until thread is terminated
         TN_DEBUG1( "MainL() KThumbnailServerProcess wait" );
+        OstTrace0( TRACE_NORMAL, DUP12__MAINL, "::MainL - KThumbnailServerProcess wait" );
         User::WaitForRequest(status);
          
         // reset key
         TN_DEBUG2( "MainL() KThumbnailServerProcess reset res = %d", res );
+        OstTrace1( TRACE_NORMAL, DUP13__MAINL, "::MainL;res=%d - KThumbnailServerProcess reset", res );
         res = RProperty::Set(KTMPSNotification, KShutdown, 0);
 
         TN_DEBUG1( "MainL() KThumbnailServerProcess close" );
+        OstTrace0( TRACE_NORMAL, DUP14__MAINL, "::MainL - close" );
         process.Close();
         }    
     
@@ -103,21 +123,26 @@
     // Create the server process
     // KNullDesC param causes server's E32Main() to be run
     TN_DEBUG2( "MainL() KTAGDaemonExe create res = %d", res );
+    OstTrace1( TRACE_NORMAL, DUP15__MAINL, "::MainL - KTAGDaemonExe create res;res=%d", res );
     res = server.Create( KTAGDaemonExe, KNullDesC );
     
     // try again 3 times if fails
     while ( res != KErrNone)
         {
         TN_DEBUG1( "MainL() KTAGDaemonExe retry" );
+        OstTrace0( TRACE_NORMAL, DUP16__MAINL, "::MainL- KTAGDaemonExe retry" );
         if (retryCount > 2)
             {
             TN_DEBUG1( "MainL() KTAGDaemonExe retry > 2" );
+            OstTrace0( TRACE_NORMAL, DUP17__MAINL, "::MainL - KTAGDaemonExe retry > 2" );
             return;
             }
         
         TN_DEBUG1( "MainL() after" );
+        OstTrace0( TRACE_NORMAL, DUP18__MAINL, "::MainL - after" );
         User::After(2500000);
         TN_DEBUG2( "MainL() KTAGDaemonExe create res = %d", res );
+        OstTrace1( TRACE_NORMAL, DUP19__MAINL, "::MainL - KTAGDaemonExe create;res=%d", res );
         res = server.Create( KTAGDaemonExe, KNullDesC );
         retryCount++;
         }
@@ -125,15 +150,19 @@
     // Process created successfully
     TRequestStatus status;
     TN_DEBUG1( "MainL() Rendezvous" );
+    OstTrace0( TRACE_NORMAL, DUP20__MAINL, "::MainL - Rendezvous" );
     server.Rendezvous( status );
     TN_DEBUG1( "MainL() Resume" );
+    OstTrace0( TRACE_NORMAL, DUP21__MAINL, "::MainL - resume" );
     server.Resume(); // start it going
     
     
     // Wait until the completion of the server creation
     TN_DEBUG1( "MainL() wait" );
+    OstTrace0( TRACE_NORMAL, DUP22__MAINL, "::MainL - wait" );
     User::WaitForRequest( status );
     TN_DEBUG1( "MainL() wait done" );
+    OstTrace0( TRACE_NORMAL, DUP23__MAINL, "::MainL - wait done"  );
     
     // Server created successfully
     server.Close(); // we're no longer interested in the other process