51
|
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
|
52
|
59 |
IMPORT_C void GetHeapInfoKernelL( TMemSpyHeapInfo& aInfo, RArray<TMemSpyDriverFreeCell>* aFreeCells, TBool aCollectAllocatedCellsAsWellAsFree );
|
51
|
60 |
IMPORT_C void GetHeapInfoKernelL( TMemSpyHeapInfo& aInfo, RArray<TMemSpyDriverFreeCell>* aFreeCells = NULL );
|
|
61 |
IMPORT_C void OutputHeapInfoKernelL();
|
|
62 |
IMPORT_C void OutputHeapDataKernelL();
|
|
63 |
|
|
64 |
public: // API - Common
|
|
65 |
IMPORT_C void OutputHeapInfoL( const TMemSpyHeapInfo& aInfo, const TDesC& aThreadName, const RArray<TMemSpyDriverCell>* aCells = NULL );
|
|
66 |
IMPORT_C void OutputHeapInfoForDeviceL( TBool aIncludeKernel = ETrue );
|
|
67 |
IMPORT_C CMemSpyEngineOutputList* NewHeapSummaryShortLC( const TMemSpyHeapInfo& aInfo );
|
|
68 |
IMPORT_C CMemSpyEngineOutputList* NewHeapSummaryExtendedLC( const TMemSpyHeapInfo& aInfo, const RArray<TMemSpyDriverCell>* aCells = NULL );
|
|
69 |
//cigasto
|
|
70 |
IMPORT_C TMemSpyHeapData NewHeapRawInfo( const TMemSpyHeapInfo& aInfo ); //not formatted heap info
|
|
71 |
|
|
72 |
public: // But not exported
|
52
|
73 |
void GetHeapInfoKernelL( TMemSpyHeapInfo& aInfo, RArray<TMemSpyDriverFreeCell>* aFreeCells, TBool aCollectAllocatedCellsAsWellAsFree, TBool aUseKernelCopy = EFalse );
|
51
|
74 |
void OutputHeapDataUserL( const CMemSpyThread& aThread, TBool aCreateDataStream );
|
|
75 |
void OutputHeapDataUserL( const TProcessId& aPid, const TThreadId& aTid, const TDesC& aThreadName, const TMemSpyHeapInfo& aInfo, TBool aCreateDataStream, const RArray<TMemSpyDriverFreeCell>* aFreeCells );
|
52
|
76 |
void OutputHeapDataKernelL( TBool aCreateDataStream );
|
|
77 |
void OutputHeapDataKernelL(const TMemSpyHeapInfo& aHeapInfo, TBool aCreateDataStream, const RArray<TMemSpyDriverCell>* aCells);
|
51
|
78 |
|
|
79 |
private:
|
|
80 |
static TUint DescriptorAsDWORD( const TDesC8& aItem );
|
|
81 |
void AppendMetaDataL( const TMemSpyHeapInfo& aInfo, CMemSpyEngineOutputList& aList );
|
|
82 |
void AppendStatisticsL( const TMemSpyHeapInfo& aInfo, CMemSpyEngineOutputList& aList );
|
|
83 |
void AppendCellsL(const RArray<TMemSpyDriverCell>& aCells, CMemSpyEngineOutputList& aList);
|
|
84 |
void OutputCSVEntryL( TInt aIndex, const TMemSpyHeapInfo& aInfo, const TDesC& aThreadName, const TDesC& aProcessName );
|
|
85 |
void UpdateSharedHeapInfoL( const TProcessId& aProcess, const TThreadId& aThread, TMemSpyHeapInfo& aInfo );
|
52
|
86 |
static void CleanupHeapDataKernel( TAny* aPtr );
|
|
87 |
|
51
|
88 |
private:
|
|
89 |
CMemSpyEngine& iEngine;
|
|
90 |
};
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
#endif
|