perfsrv/analyzetool/dynamicmemoryhook/src/customuser.cpp
changeset 51 98307c651589
equal deleted inserted replaced
42:0ff24a8f6ca2 51:98307c651589
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Definitions for the class CustomUser.
       
    15 *
       
    16 */
       
    17 
       
    18 #include <f32file.h>
       
    19 #include <utf.h>
       
    20 #include "customuser.h"
       
    21 #include "analyzetoolmainallocator.h"
       
    22 #include "analyzetoolallocator.h"
       
    23 #include "atlog.h"
       
    24 #include "analyzetoolmemoryallocator.h"
       
    25 #include "analyzetoolpanics.pan"
       
    26 #include "atdriveinfo.h"
       
    27 #include <analyzetool/analyzetooltraceconstants.h>
       
    28 #include "analyzetoolfastlog.h"
       
    29 
       
    30 #ifdef USE_CLEANER_DLL
       
    31 // Global variable to detect dll attach & detach in process.
       
    32 // Note! This is initialized after SetupThreadHeap so its not usable there.
       
    33 // This is used to store the main thread id and track when the process ends
       
    34 // to load the cleaner dll with call back feature to cleanup allocator at the
       
    35 // last possible phase.
       
    36 #include <analyzetool/analyzetoolcleaner.h>
       
    37 
       
    38 // CONSTANTS
       
    39 const TInt KAToolCleanerOrdinal = 1;
       
    40 
       
    41 class TAnalyzeToolGlobalTracker : public TAnalyzeToolCleanerBase
       
    42     {
       
    43 public:
       
    44     /* Main thread id */
       
    45     TThreadId iMainId;
       
    46     
       
    47     /* Inform if panic occured */
       
    48     TBool iPanic;
       
    49     
       
    50     // -----------------------------------------------------------------------------
       
    51     // TAnalyzeToolGlobalTracker::TAnalyzeToolGlobalTracker()
       
    52     // C++ default constructor 
       
    53     // -----------------------------------------------------------------------------
       
    54     //
       
    55     TAnalyzeToolGlobalTracker()
       
    56         {
       
    57         LOGSTR1( "ATMH TAnalyzeToolGlobalTracker::TAnalyzeToolGlobalTracker()" );
       
    58         
       
    59         iPanic = EFalse; // no panic occured
       
    60         iMainId = RThread().Id(); // set main thread id
       
    61         LOGSTR2( "ATMH TAnalyzeToolGlobalTracker() > Main id set: %d", 
       
    62                 iMainId.operator TUint() );
       
    63         }
       
    64     
       
    65     // -----------------------------------------------------------------------------
       
    66     // TAnalyzeToolGlobalTracker::~TAnalyzeToolGlobalTracker()
       
    67     // Destructor.
       
    68     // -----------------------------------------------------------------------------
       
    69     //
       
    70     ~TAnalyzeToolGlobalTracker()
       
    71         {
       
    72         LOGSTR1( "ATMH TAnalyzeToolGlobalTracker::~TAnalyzeToolGlobalTracker()" );
       
    73         
       
    74         // We dont load dll if panic has happened (uninstallation has been done).
       
    75         if ( iPanic )
       
    76             {
       
    77             LOGSTR1( "ATMH ~TAnalyzeToolGlobalTracker > Panic set not loading cleaner dll." );
       
    78             return;
       
    79             }
       
    80         
       
    81         LOGSTR1( "ATMH ~TAnalyzeToolGlobalTracker > about to load cleaner dll" );
       
    82         // Load cleaner library and set a call back to our cleanup
       
    83         RLibrary lib;
       
    84         TInt error( lib.Load( KATCleanerDllName ) );
       
    85         if ( error == KErrNone )
       
    86             {
       
    87             // Set address to point to ourself
       
    88             TLibraryFunction func = lib.Lookup( KAToolCleanerOrdinal ); // Ordinal 1 of the dll
       
    89             ATCLEANERTABLE* cleaner = (ATCLEANERTABLE*) func(); // Use function to get address
       
    90             cleaner->At( 0 ) = (TUint32) this; // Set address
       
    91             LOGSTR1( "ATMH ~TAnalyzeToolGlobalTracker() > cleaner dll loaded and call back set" );
       
    92             }
       
    93         else
       
    94             {
       
    95             // Error loading cleanup dll
       
    96             LOGSTR2( "ATMH ~TAnalyzeToolGlobalTracker() > cleaner dll load error(%i) uninstalling allocator now!", 
       
    97                     error );
       
    98             Cleanup();
       
    99             }
       
   100         }
       
   101     
       
   102     // -----------------------------------------------------------------------------
       
   103     // TAnalyzeToolGlobalTracker::Cleanup()
       
   104     // 
       
   105     // -----------------------------------------------------------------------------
       
   106     //
       
   107     void Cleanup()
       
   108         {
       
   109         LOGSTR1( "ATMH TAnalyzeToolGlobalTracker::Cleanup() - allocator uninstall" );
       
   110         
       
   111         // Uninstall allocator
       
   112         ( (RAnalyzeToolMemoryAllocator&) User::Allocator() ).Uninstall();
       
   113         }
       
   114     
       
   115     };
       
   116 
       
   117 // Global variable definition.
       
   118 TAnalyzeToolGlobalTracker gGlobalTracker;
       
   119 #endif
       
   120 
       
   121 // CONSTANTS
       
   122 // When needed, update the version number directly inside _LIT macro.
       
   123 // Constant for the atool API(staticlib) version.
       
   124 _LIT( KAtoolApiVersion, "1.7.6" );
       
   125 
       
   126 // Version number buffer length
       
   127 const TInt KAtoolVersionNumberLength = 10;
       
   128 
       
   129 // Wrong version error code
       
   130 const TInt KAtoolVersionError = -1999;
       
   131 
       
   132 // Version number separator
       
   133 _LIT( KVersionSeparator, ";" );
       
   134 
       
   135 // Incorrect version error strings 
       
   136 _LIT( KIncorrectText, "ERR INCORRECT_ATOOL_VERSION [API v.%S][ATOOL v.%S]" );
       
   137 _LIT( KIncorrectTextTrace, "<AT> " );
       
   138 
       
   139 // -----------------------------------------------------------------------------
       
   140 // CustomUser::Panic()
       
   141 // Overloaded User::Panic() function
       
   142 // -----------------------------------------------------------------------------
       
   143 //
       
   144 EXPORT_C void CustomUser::Panic( const TDesC& aCategory, TInt aReason )
       
   145     {
       
   146     LOGSTR3( "ATMH CustomUser::Panic() %S %i", &aCategory, aReason );
       
   147     
       
   148 #ifdef USE_CLEANER_DLL
       
   149     // Set global tracker that panic has happened.
       
   150     gGlobalTracker.iPanic = ETrue;
       
   151 #endif
       
   152     
       
   153     // Uninstall thread's RAllocator
       
   154     ( (RAnalyzeToolMemoryAllocator&) User::Allocator() ).Uninstall();
       
   155        
       
   156     // Call the "real" User::Panic()
       
   157     User::Panic( aCategory, aReason );
       
   158     }
       
   159 
       
   160 // -----------------------------------------------------------------------------
       
   161 // CustomUser::Exit()
       
   162 // Overloaded User::Exit() function
       
   163 // -----------------------------------------------------------------------------
       
   164 //
       
   165 EXPORT_C void CustomUser::Exit( TInt aReason )
       
   166     {
       
   167     LOGSTR3( "ATMH CustomUser::Exit() %i %i", aReason, RThread().Id().Id() );
       
   168     
       
   169     if ( aReason != KAtoolVersionError )
       
   170     	{
       
   171 #ifdef USE_CLEANER_DLL
       
   172         // Only uninstall allocator if its not the process main/first thread.
       
   173         LOGSTR3( "ATMH CustomUser::Exit() - Thread id: %d - Main Id: %d",
       
   174                 RThread().Id().operator TUint(), gGlobalTracker.iMainId.operator TUint() );
       
   175         
       
   176         if ( RThread().Id() != gGlobalTracker.iMainId )
       
   177             {
       
   178             LOGSTR2("ATMH CustomUser::Exit() - Calling allocator uninstall in thread: %d" , RThread().Id().operator TUint() );
       
   179             ( (RAnalyzeToolMemoryAllocator&) User::Allocator() ).Uninstall();
       
   180             }
       
   181 #else
       
   182     	// Uninstall thread's RAllocator
       
   183     	( (RAnalyzeToolMemoryAllocator&) User::Allocator() ).Uninstall();
       
   184     	LOGSTR1( "ATMH CustomUser::Exit() - about to User::Exit" );
       
   185 #endif
       
   186     	}
       
   187     
       
   188     // Call the "real" User::Exit()
       
   189     User::Exit( aReason );
       
   190     }
       
   191 
       
   192 // -----------------------------------------------------------------------------
       
   193 // CustomUser::SetCritical()
       
   194 // Overloaded User::SetCritical() function which returns
       
   195 // KErrNone, if successful; KErrArgument, if EAllThreadsCritical is 
       
   196 // passed - this is a state associated with a process, and you use 
       
   197 // User::SetProcessCritical() to set it.
       
   198 // -----------------------------------------------------------------------------
       
   199 //
       
   200 EXPORT_C TInt CustomUser::SetCritical( User::TCritical aCritical )
       
   201     {
       
   202     LOGSTR1( "ATMH CustomUser::SetCritical()" );
       
   203     // Check the given User::TCritical type
       
   204     if ( aCritical == User::EAllThreadsCritical )
       
   205         {
       
   206         return KErrArgument;
       
   207         }
       
   208     else
       
   209         {
       
   210         return KErrNone;
       
   211         }
       
   212     }
       
   213   
       
   214 // -----------------------------------------------------------------------------
       
   215 // CustomUser::SetProcessCritical()
       
   216 // Overloaded User::SetProcessCritical() function
       
   217 // KErrNone, if successful; KErrArgument, if either EProcessCritical or 
       
   218 // EProcessPermanent is passed - these are states associated with a 
       
   219 // thread, and you use User::SetCritical() to set them.
       
   220 // -----------------------------------------------------------------------------
       
   221 //
       
   222 EXPORT_C TInt CustomUser::SetProcessCritical( User::TCritical aCritical )
       
   223     {
       
   224     LOGSTR1( "ATMH CustomUser::SetProcessCritical()" );
       
   225      // Check the given User::TCritical type 
       
   226     if ( aCritical == User::EProcessCritical || 
       
   227          User::EProcessPermanent == aCritical )
       
   228         {
       
   229         return KErrArgument;
       
   230         }
       
   231     else
       
   232         {
       
   233         return KErrNone;
       
   234         }
       
   235     }
       
   236 
       
   237 // -----------------------------------------------------------------------------
       
   238 // CustomUser::SetupThreadHeap()
       
   239 // Overloaded UserHeap::SetupThreadHeap function
       
   240 // -----------------------------------------------------------------------------
       
   241 //
       
   242 EXPORT_C TInt CustomUser::SetupThreadHeap( TBool aNotFirst, 
       
   243     SStdEpocThreadCreateInfo& aInfo, const TFileName& aFileName, const TPath& aFilePath,
       
   244     TUint32 aLogOption, TUint32 aIsDebug, const TATVersion& aVersion,
       
   245     TUint32 aAllocCallStackSize, TUint32 aFreeCallStackSize,
       
   246     TRefByValue<const TDesC> aFmt, ... )
       
   247     {
       
   248     LOGSTR1( "ATMH CustomUser::SetupThreadHeap()" );
       
   249     LOGSTR2( "ATMH > Thread id(%d)", RThread().Id().operator TUint() );
       
   250     
       
   251     // Add handling of the argument list here.
       
   252         
       
   253     TInt ret( KErrNone ); 
       
   254     
       
   255     // Check version number
       
   256     TBuf<KAtoolVersionNumberLength> atoolVer;
       
   257     TBuf<KApiVersionLength> apiVer;
       
   258     TInt err( KErrNone );
       
   259     err = CheckVersion( aVersion, atoolVer, apiVer );
       
   260     
       
   261     if ( err )
       
   262     	{
       
   263     	LOGSTR1( "ATMH > Wrong API version > Inform user and Exit." );
       
   264     	ReportIncorrectVersion( aLogOption, aFileName, aFilePath, atoolVer );
       
   265     	return KAtoolVersionError;
       
   266     	}
       
   267     
       
   268     // Check is this shared heap
       
   269     if ( aInfo.iAllocator == NULL )
       
   270         {
       
   271         LOGSTR1( "ATMH creating a new heap" );
       
   272         // RAllocator is NULL so heap is not shared, creating a new heap
       
   273         ret = UserHeap::SetupThreadHeap( aNotFirst, aInfo );
       
   274         __ASSERT_ALWAYS( KErrNone == ret, AssertPanic( EFailedToCreateHeap ) );
       
   275         
       
   276 #if ( SYMBIAN_VERSION_SUPPORT >= SYMBIAN_3 )
       
   277     #ifndef __WINS__
       
   278         // Set dummy Tls value
       
   279         TAny* dummyPtr( NULL );
       
   280         TInt setErr( UserSvr::DllSetTls( KDummyHandle, dummyPtr ) );
       
   281         LOGSTR2( "ATMH > Set Tls err(%i)", setErr );
       
   282     #endif
       
   283 #endif
       
   284         // Install the RAllocator
       
   285         TBuf8<KAtoolVersionLength> atoolVer8;
       
   286         atoolVer8.Copy(atoolVer);
       
   287         TBuf8<KApiVersionLength> apiVer8;
       
   288         apiVer8.Copy(apiVer);
       
   289         aInfo.iAllocator = &InstallAllocator( aNotFirst, aFileName, aFilePath, aLogOption, aIsDebug,
       
   290                 aAllocCallStackSize, aFreeCallStackSize, atoolVer8, apiVer8 );
       
   291         }
       
   292     else
       
   293         {
       
   294         LOGSTR1( "ATMH sharing the heap" );
       
   295         // The heap is shared. Acquire pointer to the original heap
       
   296         RAnalyzeToolMemoryAllocator* allocator = 
       
   297 			(RAnalyzeToolMemoryAllocator*) aInfo.iAllocator;
       
   298         // Share the heap
       
   299         allocator->ShareHeap();
       
   300         // Switch thread heap 
       
   301         User::SwitchAllocator( allocator );
       
   302         }
       
   303     
       
   304 
       
   305     return ret;
       
   306     }
       
   307 
       
   308 // -----------------------------------------------------------------------------
       
   309 // CustomUser::InstallAllocator
       
   310 // Installs the RAllocator
       
   311 // -----------------------------------------------------------------------------
       
   312 //
       
   313 //lint -e{429} suppress "Custodial pointer 'allocator' has not been freed or returned"
       
   314 EXPORT_C RAllocator& CustomUser::InstallAllocator( TBool aNotFirst, 
       
   315 	const TFileName& aFileName,  const TPath& aFilePath, TUint32 aLogOption, TUint32 aIsDebug,
       
   316 	TUint32 aAllocCallStackSize, TUint32 aFreeCallStackSize, const TDesC8& aAtoolVersion, const TDesC8& aApiVersion )
       
   317     {
       
   318     LOGSTR1( "ATMH CustomUser::InstallAllocator()" );
       
   319     
       
   320     // Open handle to the device driver
       
   321     RAnalyzeTool analyzetool;
       
   322     TInt error = analyzetool.Open();
       
   323     
       
   324     // Check if the device driver has already loaded
       
   325     if ( KErrNone == error )
       
   326         {
       
   327         LOGSTR1( "ATMH CustomUser::InstallAllocator() - analyzetool.Open() returned KErrNone" );
       
   328         // The device driver has already loaded
       
   329         // Get pointer to the main thread allocator
       
   330         TMainThreadParamsBuf params;
       
   331         params().iProcessId = RProcess().Id().operator TUint();
       
   332         error = analyzetool.MainThreadAlloctor( params );
       
   333 
       
   334         __ASSERT_ALWAYS( KErrNone == error, AssertPanic( ECantOpenHandle ) );
       
   335         
       
   336         // Close handle to the device driver
       
   337         analyzetool.Close();
       
   338         
       
   339         // Is this the first thread of the program
       
   340         if ( params().iAlone )
       
   341             {
       
   342             LOGSTR1( "ATMH CustomUser::InstallAllocator() - first thread of the program" );
       
   343             // Only one thread in the program. Must be main thread
       
   344             RAnalyzeToolMainAllocator* allocator = 
       
   345 				new RAnalyzeToolMainAllocator( aNotFirst, aFileName, aFilePath, aLogOption,
       
   346 				                               aIsDebug, aAllocCallStackSize, aFreeCallStackSize, 
       
   347 				                               aAtoolVersion, aApiVersion );
       
   348             
       
   349             __ASSERT_ALWAYS( allocator != NULL, AssertPanic( ENoMemory ) );
       
   350             
       
   351             // Change threads allocator
       
   352             User::SwitchAllocator( allocator );
       
   353             
       
   354             // Return reference to the RAllocator
       
   355             return *allocator;
       
   356             }
       
   357         // This is not the first thread. A new thread with a new heap created
       
   358         else
       
   359             {
       
   360             LOGSTR1( "ATMH CustomUser::InstallAllocator() - create a new allocator for the new thread" );
       
   361             // Create new RAllocator with handles from the main thread
       
   362             RAnalyzeToolAllocator* allocator = new RAnalyzeToolAllocator( 
       
   363                     aNotFirst,
       
   364                     ((RAnalyzeToolMainAllocator*)params().iAllocator)->Codeblocks(), 
       
   365                     ((RAnalyzeToolMainAllocator*)params().iAllocator)->Mutex(), 
       
   366                     ((RAnalyzeToolMainAllocator*)params().iAllocator)->ProcessId(), 
       
   367                     ((RAnalyzeToolMainAllocator*)params().iAllocator)->AnalyzeTool(),
       
   368                     ((RAnalyzeToolMainAllocator*)params().iAllocator)->LogOption(),
       
   369                     ((RAnalyzeToolMainAllocator*)params().iAllocator)->AllocMaxCallStack(),
       
   370                     ((RAnalyzeToolMainAllocator*)params().iAllocator)->FreeMaxCallStack(),
       
   371                     ((RAnalyzeToolMainAllocator*)params().iAllocator)->LogFile() );
       
   372 
       
   373             __ASSERT_ALWAYS( allocator != NULL, AssertPanic( ENoMemory ) );
       
   374             
       
   375             // Change threads allocator
       
   376             User::SwitchAllocator( allocator );
       
   377             
       
   378             // Return reference to the RAllocator
       
   379             return *allocator;
       
   380             }
       
   381         }
       
   382     // The device driver does not exists so this must be the first thread
       
   383     else
       
   384         {
       
   385         LOGSTR1( "ATMH CustomUser::InstallAllocator() - analyzetool.Open() returned error, creating DD" );
       
   386         RAnalyzeToolMainAllocator* allocator = 
       
   387 			new RAnalyzeToolMainAllocator( aNotFirst, aFileName, aFilePath, aLogOption, aIsDebug,
       
   388 			        aAllocCallStackSize, aFreeCallStackSize, aAtoolVersion, aApiVersion );
       
   389         
       
   390         __ASSERT_ALWAYS( allocator != NULL, AssertPanic( ENoMemory ) );
       
   391         
       
   392         // Change threads allocator
       
   393         User::SwitchAllocator( allocator );
       
   394 
       
   395         // Return reference to the RAllocator
       
   396         return *allocator;
       
   397         }
       
   398     } 
       
   399     
       
   400 // -----------------------------------------------------------------------------
       
   401 // CustomUser::CheckVersion
       
   402 // Check atool version
       
   403 // -----------------------------------------------------------------------------
       
   404 //
       
   405 TInt CustomUser::CheckVersion( const TATVersion& aVersion, TDes& aToolVersion, TDes& aApiVersion )
       
   406     { 
       
   407     LOGSTR2( "ATMH CustomUser::CheckVersion(), aVersion( %S )", &aVersion );
       
   408     
       
   409     TFileName version;
       
   410     version.Copy( aVersion );
       
   411     TBuf<KAtoolVersionNumberLength> apiVer;
       
   412     	
       
   413     // Find separator place
       
   414     TInt findplace( version.Find( KVersionSeparator() ) );
       
   415     // Parse API version first [x.x.x;x.x.x]
       
   416     if ( findplace >= 0 && findplace <= aApiVersion.MaxLength() )
       
   417 		{
       
   418         aApiVersion.Copy( version.Mid( 0, findplace ) ); 
       
   419 		version.Delete( 0, findplace + KVersionSeparator().Length() );
       
   420 		}
       
   421  
       
   422     if ( version.Length() <= aToolVersion.MaxLength() )
       
   423     	{
       
   424     	aToolVersion.Copy( version );
       
   425     	if ( aToolVersion.Compare( KAtoolApiVersion ) == KErrNone &&
       
   426     	     aApiVersion.Length() == 0 )
       
   427     		{
       
   428     		// Support 1.5.0 version (Version info: [1.5.0])
       
   429     	    aApiVersion.Copy( version );
       
   430     		}
       
   431     	}
       
   432     
       
   433     LOGSTR3( "ATMH > API version( %S ), ATOOL version( %S )", 
       
   434     		&aApiVersion, &aToolVersion );
       
   435         
       
   436     // Check version numbers 
       
   437     if ( aApiVersion.Compare( KAtoolApiVersion ) == KErrNone )
       
   438     	{
       
   439     	return KErrNone;
       
   440     	}
       
   441     return KErrCancel;    
       
   442     }
       
   443 
       
   444 // -----------------------------------------------------------------------------
       
   445 // CustomUser::ReportIncorrectVersion
       
   446 // Function for showing incorrect version information
       
   447 // -----------------------------------------------------------------------------
       
   448 //
       
   449 void CustomUser::ReportIncorrectVersion( const TUint32 aLogOption,
       
   450 	const TFileName& aFileName, const TPath& aFilePath, const TDes& aToolVersion )
       
   451 	{
       
   452 	LOGSTR2( "ATMH CustomUser::ReportIncorrectVersion(), aFileName( %S )", 
       
   453 			&aFileName );
       
   454 
       
   455 	switch ( aLogOption )
       
   456 		{
       
   457 		case EATLogToFile:
       
   458 			{
       
   459 			LOGSTR1( "ATMH ReportIncorrectVersion > EATLogToFile" );			
       
   460 			
       
   461 			// A handle to a file server session.
       
   462 			RFs fs;
       
   463 			// Creates and opens a file, 
       
   464 			// and performs all operations on a single open file.
       
   465 			RFile file;	
       
   466 			// Create full path buffer
       
   467 			TBuf<KMaxFileName> logFileBuf;
       
   468 			// Connects a client to the file server.
       
   469 			TInt err( fs.Connect() );
       
   470 			
       
   471 			if ( !err )
       
   472 				{				
       
   473                 err = TATDriveInfo::CreatePath( logFileBuf, aFileName, aFilePath, fs );
       
   474 			    
       
   475 				// Replace file if exists
       
   476 				if ( err && err != KErrAlreadyExists )
       
   477 					{
       
   478 					LOGSTR2( "ATMH > TATDriveInfo::CreatePath() err( %i )", err );
       
   479 					return;
       
   480 					}
       
   481 				
       
   482 				// Replace file if exists (drive C)
       
   483 				err = file.Replace( fs, logFileBuf, EFileWrite );
       
   484 										
       
   485 				// Write to file
       
   486 				if ( !err )
       
   487 					{
       
   488 					err = file.Write( KDataFileVersion );
       
   489 					// Error msg buffer
       
   490 					TBuf8<KMaxFileName> msg;				     
       
   491 					// Write the error code to the buffer  
       
   492 					logFileBuf.Format( KIncorrectText, &KAtoolApiVersion, &aToolVersion );	
       
   493 					CnvUtfConverter::ConvertFromUnicodeToUtf8( msg, logFileBuf );
       
   494 					err = file.Write( msg );
       
   495 					}
       
   496 				// Closes the file.
       
   497 				file.Close();
       
   498 				}
       
   499 			
       
   500 			LOGSTR2( "ATMH > File err( %i )", err );			
       
   501 			// Closes the handle.
       
   502 			fs.Close();
       
   503 			}
       
   504 			break;
       
   505 			
       
   506 		case EATUseDefault:
       
   507 		case EATLogToTraceFast:
       
   508 			{
       
   509 			LOGSTR1( "ATMH > ReportIncorrectVersion > EATLogToTraceFast" );
       
   510 			// Error msg buffer
       
   511 			TBuf<KMaxFileName> msg;	
       
   512 			msg.Copy( KIncorrectTextTrace );
       
   513 			msg.Append( KIncorrectText );
       
   514 			TBuf<KMaxFileName> traceMsg;	
       
   515 			// Write the error code to the buffer  
       
   516 			traceMsg.Format( msg, &KAtoolApiVersion, &aToolVersion );
       
   517 			RDebug::Print( traceMsg );
       
   518 			}
       
   519 			break;
       
   520 		
       
   521 		default:
       
   522 			{
       
   523 			LOGSTR1( "ATMH > ReportIncorrectVersion > default" );
       
   524 			}
       
   525 			break;
       
   526 		}	
       
   527 	}
       
   528 
       
   529 // End of File