analyzetool/dynamicmemoryhook/inc/analyzetoolmainallocator.h
branchRCL_3
changeset 49 7fdc9a71d314
parent 19 da2cedce4920
child 59 8ad140f3dd41
equal deleted inserted replaced
46:e26895079d7c 49:7fdc9a71d314
    20 #define ANALYZETOOLMAINALLOCATOR_H
    20 #define ANALYZETOOLMAINALLOCATOR_H
    21 
    21 
    22 // INCLUDES
    22 // INCLUDES
    23 #include <u32std.h>
    23 #include <u32std.h>
    24 #include "codeblock.h"
    24 #include "codeblock.h"
    25 #include <analyzetool/atstorageserverclnt.h>
       
    26 #include <analyzetool/analyzetool.h>
    25 #include <analyzetool/analyzetool.h>
    27 #include <analyzetool/atcommon.h>
    26 #include <analyzetool/atcommon.h>
    28 #include "analyzetoolmemoryallocator.h"
    27 #include "analyzetoolmemoryallocator.h"
    29 #include "analyzetooleventhandlernotifier.h"
    28 #include "analyzetooleventhandlernotifier.h"
       
    29 #include "analyzetoolfilelog.h"
    30 
    30 
    31 // FORWARD DECLARATIONS
    31 // FORWARD DECLARATIONS
    32 class CLibraryEventHandler;
    32 class CLibraryEventHandler;
    33 
    33 
    34 // CLASS DECLARATION
    34 // CLASS DECLARATION
    45 
    45 
    46         /**
    46         /**
    47         * C++ default constructor.
    47         * C++ default constructor.
    48         * @param aNotFirst Is this first thread using this heap
    48         * @param aNotFirst Is this first thread using this heap
    49         * @param aFileName The name of the log file
    49         * @param aFileName The name of the log file
    50         * @param aLogOption The logging option for storage server
    50         * @param aLogOption The logging option
    51         * @param aIsDebug Determines whether a binary is UDEB or UREL
    51         * @param aIsDebug Determines whether a binary is UDEB or UREL
    52         * @param aAllocCallStackSize Max number of stored callstack items when memory allocated
    52         * @param aAllocCallStackSize Max number of stored callstack items when memory allocated
    53         * @param aFreeCallStackSize Max number of stored callstack items when memory freed
    53         * @param aFreeCallStackSize Max number of stored callstack items when memory freed
       
    54         * @param aAtoolVersion Version of atool
       
    55         * @param aApiVersion Version of api
    54         */
    56         */
    55         RAnalyzeToolMainAllocator( TBool aNotFirst,
    57         RAnalyzeToolMainAllocator( TBool aNotFirst,
    56                 const TFileName aFileName,
    58                 const TFileName& aFileName,
       
    59                 const TPath& aFilePath,
    57                 TUint32 aLogOption, TUint32 aIsDebug,
    60                 TUint32 aLogOption, TUint32 aIsDebug,
    58                 TUint32 aAllocCallStackSize,
    61                 TUint32 aAllocCallStackSize,
    59                 TUint32 aFreeCallStackSize );
    62                 TUint32 aFreeCallStackSize,
       
    63                 const TDesC8& aAtoolVersion,
       
    64                 const TDesC8& aApiVersion );
    60 
    65 
    61         /**
    66         /**
    62         * Destructor.
    67         * Destructor.
    63         */
    68         */
    64         ~RAnalyzeToolMainAllocator();
    69         ~RAnalyzeToolMainAllocator();
   189         * Shares the heap
   194         * Shares the heap
   190         */
   195         */
   191         void ShareHeap();
   196         void ShareHeap();
   192 
   197 
   193     public: // inlines
   198     public: // inlines
   194     
   199             
   195         /**
       
   196         * Acquires the open RATStorageServer handle
       
   197         * @return RATStorageServer& The open RATStorageServer handle
       
   198         */
       
   199         inline RATStorageServer& StorageServer();
       
   200         
       
   201         /**
   200         /**
   202         * Acquires the codeblocks of the process
   201         * Acquires the codeblocks of the process
   203         * @return RArray<TCodeblock>& The process codeblocks
   202         * @return RArray<TCodeblock>& The process codeblocks
   204         */
   203         */
   205         inline RArray<TCodeblock>& Codeblocks();
   204         inline RArray<TCodeblock>& Codeblocks();
   219         /**
   218         /**
   220 		* Acquires the logical channel handle
   219 		* Acquires the logical channel handle
   221 		* @return RAnalyzeTool A reference to logical channel
   220 		* @return RAnalyzeTool A reference to logical channel
   222 		*/
   221 		*/
   223         inline RAnalyzeTool& AnalyzeTool();
   222         inline RAnalyzeTool& AnalyzeTool();
   224  
       
   225          /**
       
   226         * Acquires information if storage server is open
       
   227         * @return TBool iStorageServerOpen
       
   228         */
       
   229         inline TBool StorageServerOpen();
       
   230                 
   223                 
   231         /**
   224         /**
   232         * Acquires the log option type 
   225         * Acquires the log option type 
   233         * @return TUint32 iLogOption
   226         * @return TUint32 iLogOption
   234         */        
   227         */        
   243         /**
   236         /**
   244          * Acquires the max size of call stack when memory freed
   237          * Acquires the max size of call stack when memory freed
   245          * @return TUint32 iFreeMaxCallStack
   238          * @return TUint32 iFreeMaxCallStack
   246          */
   239          */
   247         inline TUint32 FreeMaxCallStack();
   240         inline TUint32 FreeMaxCallStack();
       
   241         
       
   242         /**
       
   243          * Acquires handle to lig file
       
   244          * @return RATFileLog iLogFile
       
   245          */
       
   246         inline RATFileLog& LogFile();
   248 
   247 
   249     private: // private functions
   248     private: // private functions
   250 
   249 
   251         /**
   250         /**
   252         * Log the process initial information
   251         * Log the process initial information
   253         * @param aFileName The name of the log file
   252         * @param aFileName The name of the log file
   254         * @param aLogOption The logging option for storage serve
   253         * @param aLogOption The logging option
   255         * @param aIsDebug Determines whether a binary is UDEB or UREL
   254         * @param aIsDebug Determines whether a binary is UDEB or UREL
   256         */
   255         */
   257         void LogProcessInformation( const TFileName aFileName, TUint32 aLogOption,
   256         void LogProcessInformation( const TFileName& aFileName,  const TPath& aFilePath,  TUint32 aLogOption,
   258                                                                 TUint32 aIsDebug );
   257         		TUint32 aIsDebug, const TDesC8& aAtoolVersion, const TDesC8& aApiVersion );
   259 
   258 
   260         /**
   259         /**
   261         * Find the current thread which is using the heap
   260         * Find the current thread which is using the heap
   262         * @param aStackStart A reference where the stack start is stored
   261         * @param aStackStart A reference where the stack start is stored
   263         * @return TBool ETrue if a thread can be found, EFalse otherwise
   262         * @return TBool ETrue if a thread can be found, EFalse otherwise
   266         
   265         
   267         /**
   266         /**
   268         * Installs the eventhandler, if possible
   267         * Installs the eventhandler, if possible
   269         */
   268         */
   270         void InstallEventHandler();
   269         void InstallEventHandler();
       
   270         
       
   271         /**
       
   272         * Logs version of ATApp, ATApi, S60 version and ROM checksum 
       
   273         * at the startup of hooked application
       
   274         */
       
   275         void LogDeviceInfo();
   271 
   276 
   272     private: // member variables
   277     private: // member variables
   273             
       
   274         /* Handle to the RATStorageServer */
       
   275         RATStorageServer iStorageServer;
       
   276 
   278 
   277         /* Handle to the RAnalyzeTool */		
   279         /* Handle to the RAnalyzeTool */		
   278         RAnalyzeTool iAnalyzeTool;           
   280         RAnalyzeTool iAnalyzeTool;           
   279         
   281         
   280         /* A flag for indicating that the RAnalyzeTool is open */
   282         /* A flag for indicating that the RAnalyzeTool is open */
   301         /* Array for storing the reallocation callstack */	
   303         /* Array for storing the reallocation callstack */	
   302         TFixedArray<TUint32, KATMaxFreeCallstackLength> iFreeCallStack;
   304         TFixedArray<TUint32, KATMaxFreeCallstackLength> iFreeCallStack;
   303                 
   305                 
   304         /* Array of threads using this heap */
   306         /* Array of threads using this heap */
   305         RArray<TThreadStack> iThreadArray;
   307         RArray<TThreadStack> iThreadArray;
   306 
       
   307         /* A flag for indicating that the RATStorageServer is open */
       
   308         TBool iStorageServerOpen;
       
   309         
   308         
   310         /* Log option */
   309         /* Log option */
   311         TUint32 iLogOption;
   310         TUint32 iLogOption;
   312 
   311 
   313         /* The process id */
   312         /* The process id */
   317         TUint32 iAllocMaxCallStack;
   316         TUint32 iAllocMaxCallStack;
   318         
   317         
   319         /* Max items on stored call stack when memory freed */
   318         /* Max items on stored call stack when memory freed */
   320         TUint32 iFreeMaxCallStack;
   319         TUint32 iFreeMaxCallStack;
   321         
   320         
       
   321         /* Binary log file */
       
   322         RATFileLog iLogFile;
       
   323        
       
   324         
   322     };
   325     };
   323 
   326 
   324 // INLINES
   327 // INLINES
   325 #include "analyzetoolmainallocator.inl"
   328 #include "analyzetoolmainallocator.inl"
   326 
   329