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(); |
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 */ |