|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MEMSPYENGINEHELPERHEAP_H |
|
19 #define MEMSPYENGINEHELPERHEAP_H |
|
20 |
|
21 // System includes |
|
22 #include <e32base.h> |
|
23 #include <s32strm.h> |
|
24 #include <bamdesca.h> |
|
25 |
|
26 // Driver includes |
|
27 #include <memspy/driver/memspydriverobjectsshared.h> |
|
28 |
|
29 // MemSpyClient includes |
|
30 #include <memspy/engine/memspyheapdata.h> |
|
31 |
|
32 // Classes referenced |
|
33 class CMemSpyThread; |
|
34 class CMemSpyEngine; |
|
35 class CMemSpyProcess; |
|
36 class CMemSpyEngineOutputList; |
|
37 |
|
38 |
|
39 NONSHARABLE_CLASS( CMemSpyEngineHelperHeap ) : public CBase |
|
40 { |
|
41 public: |
|
42 static CMemSpyEngineHelperHeap* NewL( CMemSpyEngine& aEngine ); |
|
43 ~CMemSpyEngineHelperHeap(); |
|
44 |
|
45 private: |
|
46 CMemSpyEngineHelperHeap( CMemSpyEngine& aEngine ); |
|
47 void ConstructL(); |
|
48 |
|
49 public: // API - User Heap |
|
50 IMPORT_C void GetHeapInfoUserL( const TProcessId& aProcess, const TThreadId& aThread, TMemSpyHeapInfo& aInfo, RArray<TMemSpyDriverCell>* aCells = NULL ); |
|
51 IMPORT_C void GetHeapInfoUserL(const TProcessId& aProcess, const TThreadId& aThread, TMemSpyHeapInfo& aInfo, RArray<TMemSpyDriverCell>* aCells, TBool aCollectAllocatedCellsAsWellAsFree); |
|
52 IMPORT_C void GetHeapInfoUserL( const CMemSpyProcess& aProcess, RArray<TMemSpyHeapInfo >& aInfos ); |
|
53 IMPORT_C void OutputHeapInfoUserL( const CMemSpyThread& aThread ); |
|
54 IMPORT_C void OutputHeapDataUserL( const CMemSpyThread& aThread ); |
|
55 IMPORT_C void OutputHeapDataUserL( const TProcessId& aPid, const TThreadId& aTid, const TDesC& aThreadName, const TMemSpyHeapInfo& aInfo, const RArray<TMemSpyDriverFreeCell>* aFreeCells = NULL ); |
|
56 IMPORT_C void OutputCellListingUserL( const CMemSpyThread& aThread ); |
|
57 |
|
58 public: // API - Kernel Heap |
|
59 IMPORT_C void GetHeapInfoKernelL( TMemSpyHeapInfo& aInfo, RArray<TMemSpyDriverFreeCell>* aFreeCells = NULL ); |
|
60 IMPORT_C void OutputHeapInfoKernelL(); |
|
61 IMPORT_C void OutputHeapDataKernelL(); |
|
62 |
|
63 public: // API - Common |
|
64 IMPORT_C void OutputHeapInfoL( const TMemSpyHeapInfo& aInfo, const TDesC& aThreadName, const RArray<TMemSpyDriverCell>* aCells = NULL ); |
|
65 IMPORT_C void OutputHeapInfoForDeviceL( TBool aIncludeKernel = ETrue ); |
|
66 IMPORT_C CMemSpyEngineOutputList* NewHeapSummaryShortLC( const TMemSpyHeapInfo& aInfo ); |
|
67 IMPORT_C CMemSpyEngineOutputList* NewHeapSummaryExtendedLC( const TMemSpyHeapInfo& aInfo, const RArray<TMemSpyDriverCell>* aCells = NULL ); |
|
68 //cigasto |
|
69 IMPORT_C TMemSpyHeapData NewHeapRawInfo( const TMemSpyHeapInfo& aInfo ); //not formatted heap info |
|
70 |
|
71 public: // But not exported |
|
72 void OutputHeapDataKernelL( TBool aCreateDataStream ); |
|
73 void OutputHeapDataUserL( const CMemSpyThread& aThread, TBool aCreateDataStream ); |
|
74 void OutputHeapDataUserL( const TProcessId& aPid, const TThreadId& aTid, const TDesC& aThreadName, const TMemSpyHeapInfo& aInfo, TBool aCreateDataStream, const RArray<TMemSpyDriverFreeCell>* aFreeCells ); |
|
75 |
|
76 private: |
|
77 static TUint DescriptorAsDWORD( const TDesC8& aItem ); |
|
78 void AppendMetaDataL( const TMemSpyHeapInfo& aInfo, CMemSpyEngineOutputList& aList ); |
|
79 void AppendStatisticsL( const TMemSpyHeapInfo& aInfo, CMemSpyEngineOutputList& aList ); |
|
80 void AppendCellsL(const RArray<TMemSpyDriverCell>& aCells, CMemSpyEngineOutputList& aList); |
|
81 void OutputCSVEntryL( TInt aIndex, const TMemSpyHeapInfo& aInfo, const TDesC& aThreadName, const TDesC& aProcessName ); |
|
82 void UpdateSharedHeapInfoL( const TProcessId& aProcess, const TThreadId& aThread, TMemSpyHeapInfo& aInfo ); |
|
83 |
|
84 private: |
|
85 CMemSpyEngine& iEngine; |
|
86 }; |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 #endif |