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 MEMSPYDEVICEWIDEOPERATIONS_H
|
|
19 |
#define MEMSPYDEVICEWIDEOPERATIONS_H
|
|
20 |
|
|
21 |
// System includes
|
|
22 |
#include <e32base.h>
|
|
23 |
|
|
24 |
// Classes referenced
|
|
25 |
class CMemSpyEngine;
|
|
26 |
|
|
27 |
class MMemSpyDeviceWideOperationsObserver
|
|
28 |
{
|
|
29 |
public: // Enumerations
|
|
30 |
enum TEvent
|
|
31 |
{
|
|
32 |
// Indicates we've worked out how much work is required
|
|
33 |
EOperationSized = 0,
|
|
34 |
|
|
35 |
// Indicates that we are starting the requested operation
|
|
36 |
EOperationStarting,
|
|
37 |
|
|
38 |
// Indicates some work has been done
|
|
39 |
EOperationProgressStart,
|
|
40 |
EOperationProgressEnd,
|
|
41 |
|
|
42 |
// Indicates that the cancellation request has been acknowledged
|
|
43 |
EOperationCancelled,
|
|
44 |
|
|
45 |
// Indicates that we are entering the completion phase
|
|
46 |
EOperationCompleting,
|
|
47 |
|
|
48 |
// Indicates that the operation is complete and this object can be destroyed now
|
|
49 |
EOperationCompleted
|
|
50 |
};
|
|
51 |
|
|
52 |
public: // From MMemSpyDeviceWideOperationsObserver
|
|
53 |
virtual void HandleDeviceWideOperationEvent( TEvent aEvent, TInt aParam1, const TDesC& aParam2 ) = 0;
|
|
54 |
};
|
|
55 |
|
|
56 |
|
|
57 |
NONSHARABLE_CLASS( CMemSpyDeviceWideOperations ) : public CActive
|
|
58 |
{
|
|
59 |
public:
|
|
60 |
enum TOperation
|
|
61 |
{
|
|
62 |
// Brief overview of user thread
|
|
63 |
EPerEntityGeneralSummary = 0,
|
|
64 |
|
|
65 |
// Detailed information about user thread
|
|
66 |
EPerEntityGeneralDetailed,
|
|
67 |
|
|
68 |
// Thread handles for user thread (dumps thread info container)
|
|
69 |
EPerEntityGeneralHandles,
|
|
70 |
|
|
71 |
// Heap information for user or kernel thread
|
|
72 |
EPerEntityHeapInfo,
|
|
73 |
|
|
74 |
// Compact heap information for entire device (kernel & user threads)
|
|
75 |
EEntireDeviceHeapInfoCompact,
|
|
76 |
|
|
77 |
// Heap cell listings for specific user thread
|
|
78 |
EPerEntityHeapCellListing,
|
|
79 |
|
|
80 |
// Heap data for kernel or user threads
|
|
81 |
EPerEntityHeapData,
|
|
82 |
|
|
83 |
// Summary stack info
|
|
84 |
EPerEntityStackInfo,
|
|
85 |
|
|
86 |
// Compact stack information for the entire device (user threads only)
|
|
87 |
EEntireDeviceStackInfoCompact,
|
|
88 |
|
|
89 |
// User-side stack for user thread
|
|
90 |
EPerEntityStackDataUser,
|
|
91 |
|
|
92 |
// Supervisor-side stack for user thread
|
|
93 |
EPerEntityStackDataKernel,
|
|
94 |
};
|
|
95 |
|
|
96 |
public:
|
|
97 |
IMPORT_C static CMemSpyDeviceWideOperations* NewL( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationsObserver& aObserver, TOperation aOperation );
|
|
98 |
IMPORT_C ~CMemSpyDeviceWideOperations();
|
|
99 |
|
|
100 |
private:
|
|
101 |
CMemSpyDeviceWideOperations( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationsObserver& aObserver, TOperation aOperation );
|
|
102 |
void ConstructL();
|
|
103 |
|
|
104 |
public: // API
|
|
105 |
IMPORT_C void Cancel();
|
|
106 |
IMPORT_C TInt TotalOperationSize() const;
|
|
107 |
|
|
108 |
private: // From CActive
|
|
109 |
void RunL();
|
|
110 |
void DoCancel();
|
|
111 |
TInt RunError(TInt aError);
|
|
112 |
|
|
113 |
private: // Internal methods
|
|
114 |
void CompleteSelf( TInt aError );
|
|
115 |
void PerformNextStepL();
|
|
116 |
void PerformFinalOperationL();
|
|
117 |
void SetFinished();
|
|
118 |
TInt TotalNumberOfThreads() const;
|
|
119 |
|
|
120 |
private: // Member data
|
|
121 |
CMemSpyEngine& iEngine;
|
|
122 |
MMemSpyDeviceWideOperationsObserver& iObserver;
|
|
123 |
TOperation iOperation;
|
|
124 |
TInt iProcessIndex;
|
|
125 |
TInt iThreadIndex;
|
|
126 |
TBool iOperationCancelled;
|
|
127 |
TInt iTotalOperationSize;
|
|
128 |
};
|
|
129 |
|
|
130 |
|
|
131 |
#endif
|