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 |
#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
|
|
19 |
|
|
20 |
// System includes
|
|
21 |
#include <f32file.h>
|
|
22 |
#include <hal.h>
|
|
23 |
#include <kernel/arm/arm_types.h>
|
|
24 |
#include <memspy/driver/memspydriverclient.h>
|
|
25 |
#include <memspy/engine/memspyengine.h>
|
|
26 |
#include <memspy/engine/memspyengineutils.h>
|
|
27 |
#include <memspy/engine/memspyengineoutputlist.h>
|
|
28 |
#include <memspy/engine/memspyenginehelpercodesegment.h>
|
|
29 |
#include <memspy/engine/memspyenginehelperactiveobject.h>
|
|
30 |
#include <memspy/engine/memspyenginehelperchunk.h>
|
|
31 |
#include <memspy/engine/memspyenginehelperheap.h>
|
|
32 |
#include <memspy/engine/memspyenginehelperprocess.h>
|
|
33 |
#include <memspy/engine/memspyengineobjectprocess.h>
|
|
34 |
#include <memspy/engine/memspyengineobjectthread.h>
|
|
35 |
#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
|
|
36 |
#include <memspy/engine/memspyengineoutputsink.h>
|
|
37 |
|
|
38 |
// User includes
|
|
39 |
#include "MemSpyEngineOutputListItem.h"
|
|
40 |
|
|
41 |
// Constants
|
|
42 |
const TInt KMemSpyNumericFormatBufferSize = 20;
|
|
43 |
|
|
44 |
// Literal constants
|
|
45 |
_LIT( KMemSpyNumericHexFormat, "0x%08x" );
|
|
46 |
_LIT( KMemSpyNumericDecFormat, "%d" );
|
|
47 |
_LIT( KMemSpyNumericLongFormat, "%Ld" );
|
|
48 |
_LIT( KMemSpyCaptionYes, "Yes" );
|
|
49 |
_LIT( KMemSpyCaptionNo, "No" );
|
|
50 |
_LIT( KMemSpyCaptionOn, "On" );
|
|
51 |
_LIT( KMemSpyCaptionOff, "Off" );
|
|
52 |
_LIT( KMemSpyUnavailable, "Unavailable" );
|
|
53 |
_LIT( KMemSpyDead, "Dead" );
|
|
54 |
_LIT( KMemSpyNoItems, "(No items)" );
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
CMemSpyThreadInfoItemBase::CMemSpyThreadInfoItemBase( CMemSpyThreadInfoContainer& aContainer, TMemSpyThreadInfoItemType aType, TBool aAsyncConstruction )
|
|
59 |
: CMemSpyEngineObject( aContainer ), iContainer( aContainer ), iCallBack( CActive::EPriorityLow ), iType( aType )
|
|
60 |
{
|
|
61 |
if ( aAsyncConstruction )
|
|
62 |
{
|
|
63 |
TCallBack callBackMethod( CallConstructL, this );
|
|
64 |
iCallBack.Set( callBackMethod );
|
|
65 |
iCallBack.CallBack();
|
|
66 |
}
|
|
67 |
}
|
|
68 |
|
|
69 |
|
|
70 |
CMemSpyThreadInfoItemBase::~CMemSpyThreadInfoItemBase()
|
|
71 |
{
|
|
72 |
TRAP_IGNORE( iContainer.NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemDestroyed, iType ) );
|
|
73 |
//
|
|
74 |
iItems.ResetAndDestroy();
|
|
75 |
iItems.Close();
|
|
76 |
}
|
|
77 |
|
|
78 |
|
|
79 |
TInt CMemSpyThreadInfoItemBase::CallConstructL( TAny* aSelf )
|
|
80 |
{
|
|
81 |
CMemSpyThreadInfoItemBase* self = reinterpret_cast< CMemSpyThreadInfoItemBase* >( aSelf );
|
|
82 |
self->iReady = EFalse;
|
|
83 |
|
|
84 |
// Don't try to refresh dead thread
|
|
85 |
TInt err = KErrNone;
|
|
86 |
if ( !self->Container().Thread().IsDead() )
|
|
87 |
{
|
|
88 |
TRAP(err, self->ConstructL());
|
|
89 |
if ( err != KErrNone )
|
|
90 |
{
|
|
91 |
#ifdef _DEBUG
|
|
92 |
RDebug::Printf( "CMemSpyThreadInfoItemBase::CallConstructL() - construction err: %d, iType: %d", err, self->iType );
|
|
93 |
#endif
|
|
94 |
self->AddItemL( KMemSpyUnavailable, KNullDesC );
|
|
95 |
self->iIsEmpty = ETrue;
|
|
96 |
}
|
|
97 |
else if ( self->MdcaCount() == 0 )
|
|
98 |
{
|
|
99 |
self->AddItemL( KMemSpyNoItems, KNullDesC );
|
|
100 |
self->iIsEmpty = ETrue;
|
|
101 |
}
|
|
102 |
}
|
|
103 |
else
|
|
104 |
{
|
|
105 |
self->AddItemL( KMemSpyDead, KNullDesC );
|
|
106 |
self->iIsEmpty = ETrue;
|
|
107 |
}
|
|
108 |
//
|
|
109 |
self->iReady = ETrue;
|
|
110 |
return KErrNone;
|
|
111 |
}
|
|
112 |
|
|
113 |
|
|
114 |
EXPORT_C TInt CMemSpyThreadInfoItemBase::MdcaCount() const
|
|
115 |
{
|
|
116 |
return iItems.Count();
|
|
117 |
}
|
|
118 |
|
|
119 |
|
|
120 |
EXPORT_C TPtrC CMemSpyThreadInfoItemBase::MdcaPoint( TInt aIndex ) const
|
|
121 |
{
|
|
122 |
CItem* item = iItems[ aIndex ];
|
|
123 |
return TPtrC( item->Combined() );
|
|
124 |
}
|
|
125 |
|
|
126 |
EXPORT_C TPtrC CMemSpyThreadInfoItemBase::Caption(TInt aIndex ) const
|
|
127 |
{
|
|
128 |
CItem* item = iItems[ aIndex ];
|
|
129 |
return TPtrC( item->Caption() );
|
|
130 |
}
|
|
131 |
|
|
132 |
EXPORT_C TPtrC CMemSpyThreadInfoItemBase::Value(TInt aIndex ) const
|
|
133 |
{
|
|
134 |
CItem* item = iItems[ aIndex ];
|
|
135 |
return TPtrC( item->Value() );
|
|
136 |
}
|
|
137 |
|
|
138 |
EXPORT_C CMemSpyEngine& CMemSpyThreadInfoItemBase::Engine() const
|
|
139 |
{
|
|
140 |
return iContainer.Engine();
|
|
141 |
}
|
|
142 |
|
|
143 |
|
|
144 |
EXPORT_C void CMemSpyThreadInfoItemBase::PrintL()
|
|
145 |
{
|
|
146 |
const TInt count = iItems.Count();
|
|
147 |
if ( count > 0 && !iIsEmpty )
|
|
148 |
{
|
|
149 |
CMemSpyEngine& engine = Engine();
|
|
150 |
CMemSpyEngineOutputSink& sink = engine.Sink();
|
|
151 |
|
|
152 |
HBufC* name = MemSpyEngineUtils::CleanupTextLC( Name() );
|
|
153 |
sink.OutputSectionHeadingL( *name, TChar('-') );
|
|
154 |
CleanupStack::PopAndDestroy( name );
|
|
155 |
sink.OutputPrefixSetLC( _L(" ") ); // Slight insertion
|
|
156 |
|
|
157 |
// First pass to get max lengths
|
|
158 |
TInt maxLengthCaption = 0;
|
|
159 |
TInt maxLengthValue = 0;
|
|
160 |
|
|
161 |
for( TInt j=0; j<count; j++ )
|
|
162 |
{
|
|
163 |
const CItem* item = iItems[ j ];
|
|
164 |
maxLengthCaption = Max( maxLengthCaption, item->Caption().Length() );
|
|
165 |
maxLengthValue = Max( maxLengthValue, item->Value().Length() );
|
|
166 |
}
|
|
167 |
|
|
168 |
// Second pass - real this time - to print the values
|
|
169 |
HBufC* line = HBufC::NewLC( ( maxLengthCaption + maxLengthValue ) + 20 );
|
|
170 |
TPtr pLine( line->Des() );
|
|
171 |
//
|
|
172 |
for( TInt i=0; i<count; i++ )
|
|
173 |
{
|
|
174 |
const CItem* item = iItems[ i ];
|
|
175 |
|
|
176 |
// Remove initial tabs in caption
|
|
177 |
HBufC* caption = MemSpyEngineUtils::CleanupTextLC( item->Caption() );
|
|
178 |
|
|
179 |
// Create value item & replace any further tabs
|
|
180 |
HBufC* value = MemSpyEngineUtils::CleanupTextLC( item->Value() );
|
|
181 |
|
|
182 |
// Now format the final line, with padding.
|
|
183 |
pLine.Justify( *caption, maxLengthCaption + 3, ELeft, TChar(' ') );
|
|
184 |
pLine.Append( *value );
|
|
185 |
CleanupStack::PopAndDestroy( 2, caption );
|
|
186 |
|
|
187 |
// Sink output
|
|
188 |
sink.OutputLineL( pLine );
|
|
189 |
}
|
|
190 |
//
|
|
191 |
CleanupStack::PopAndDestroy( line );
|
|
192 |
sink.OutputBlankLineL();
|
|
193 |
CleanupStack::PopAndDestroy(); // clear prefix
|
|
194 |
}
|
|
195 |
}
|
|
196 |
|
|
197 |
|
|
198 |
|
|
199 |
void CMemSpyThreadInfoItemBase::AddItemL( const TDesC& aCaption, const TDesC& aValue )
|
|
200 |
{
|
|
201 |
CItem* item = CItem::NewLC( aCaption, aValue );
|
|
202 |
iItems.AppendL( item );
|
|
203 |
CleanupStack::Pop( item );
|
|
204 |
}
|
|
205 |
|
|
206 |
|
|
207 |
void CMemSpyThreadInfoItemBase::AddItemHexL( const TDesC& aCaption, TUint aValue )
|
|
208 |
{
|
|
209 |
TBuf<KMemSpyNumericFormatBufferSize> val;
|
|
210 |
val.Format( KMemSpyNumericHexFormat, aValue );
|
|
211 |
AddItemL( aCaption, val );
|
|
212 |
}
|
|
213 |
|
|
214 |
|
|
215 |
void CMemSpyThreadInfoItemBase::AddItemDecimalL( const TDesC& aCaption, TInt aValue )
|
|
216 |
{
|
|
217 |
TBuf<KMemSpyNumericFormatBufferSize> val;
|
|
218 |
val.Format( KMemSpyNumericDecFormat, aValue );
|
|
219 |
AddItemL( aCaption, val );
|
|
220 |
}
|
|
221 |
|
|
222 |
|
|
223 |
void CMemSpyThreadInfoItemBase::AddItemLongL( const TDesC& aCaption, const TInt64& aValue )
|
|
224 |
{
|
|
225 |
TBuf<KMemSpyNumericFormatBufferSize> val;
|
|
226 |
val.Format( KMemSpyNumericLongFormat, aValue );
|
|
227 |
AddItemL( aCaption, val );
|
|
228 |
}
|
|
229 |
|
|
230 |
|
|
231 |
void CMemSpyThreadInfoItemBase::AddItemYesNoL( const TDesC& aCaption, TBool aYes )
|
|
232 |
{
|
|
233 |
CItem* item = CItem::NewYesNoLC( aCaption, aYes );
|
|
234 |
iItems.AppendL( item );
|
|
235 |
CleanupStack::Pop( item );
|
|
236 |
}
|
|
237 |
|
|
238 |
|
|
239 |
void CMemSpyThreadInfoItemBase::AddItemOnOffL( const TDesC& aCaption, TBool aOn )
|
|
240 |
{
|
|
241 |
CItem* item = CItem::NewOnOffLC( aCaption, aOn );
|
|
242 |
iItems.AppendL( item );
|
|
243 |
CleanupStack::Pop( item );
|
|
244 |
}
|
|
245 |
|
|
246 |
|
|
247 |
void CMemSpyThreadInfoItemBase::AddItemPercentageL( const TDesC& aCaption, TInt aOneHundredPercentValue, TInt aValue )
|
|
248 |
{
|
|
249 |
const TMemSpyPercentText val( MemSpyEngineUtils::FormatPercentage( TReal( aOneHundredPercentValue ), TReal( aValue ) ) );
|
|
250 |
AddItemL( aCaption, val );
|
|
251 |
}
|
|
252 |
|
|
253 |
|
|
254 |
EXPORT_C void CMemSpyThreadInfoItemBase::RebuildL()
|
|
255 |
{
|
|
256 |
Reset();
|
|
257 |
CallConstructL( this );
|
|
258 |
}
|
|
259 |
|
|
260 |
|
|
261 |
EXPORT_C TBool CMemSpyThreadInfoItemBase::IsReady() const
|
|
262 |
{
|
|
263 |
return iReady;
|
|
264 |
}
|
|
265 |
|
|
266 |
|
|
267 |
EXPORT_C TMemSpyThreadInfoItemType CMemSpyThreadInfoItemBase::Type() const
|
|
268 |
{
|
|
269 |
return iType;
|
|
270 |
}
|
|
271 |
|
|
272 |
|
|
273 |
void CMemSpyThreadInfoItemBase::Reset()
|
|
274 |
{
|
|
275 |
iItems.ResetAndDestroy();
|
|
276 |
}
|
|
277 |
|
|
278 |
|
|
279 |
void CMemSpyThreadInfoItemBase::StripProcessAndThreadNames( TDes& aText )
|
|
280 |
{
|
|
281 |
StripProcessName( aText );
|
|
282 |
StripThreadName( aText );
|
|
283 |
}
|
|
284 |
|
|
285 |
|
|
286 |
void CMemSpyThreadInfoItemBase::StripProcessName( TDes& aText )
|
|
287 |
{
|
|
288 |
CMemSpyProcess& process = Container().Thread().Process();
|
|
289 |
const TPtrC processName( process.Name() );
|
|
290 |
TFullName temp;
|
|
291 |
//
|
|
292 |
_LIT( KProcessNameUidFormat1, "%S.exe[%08x]" );
|
|
293 |
temp.Format( KProcessNameUidFormat1, &processName, process.SID() );
|
|
294 |
const TBool stripped = MemSpyEngineUtils::StripText( aText, temp );
|
|
295 |
//
|
|
296 |
if ( stripped == EFalse )
|
|
297 |
{
|
|
298 |
_LIT( KProcessNameUidFormat2, "%S[%08x]" );
|
|
299 |
temp.Format( KProcessNameUidFormat2, &processName, process.SID() );
|
|
300 |
MemSpyEngineUtils::StripText( aText, temp );
|
|
301 |
}
|
|
302 |
}
|
|
303 |
|
|
304 |
|
|
305 |
void CMemSpyThreadInfoItemBase::StripThreadName( TDes& aText )
|
|
306 |
{
|
|
307 |
CMemSpyThread& thread = Container().Thread();
|
|
308 |
const TPtrC threadName( thread.Name() );
|
|
309 |
const TBool stripped = MemSpyEngineUtils::StripText( aText, threadName );
|
|
310 |
(void) stripped;
|
|
311 |
}
|
|
312 |
|
|
313 |
|
|
314 |
CMemSpyThreadInfoItemBase::CItem& CMemSpyThreadInfoItemBase::Item( TInt aIndex )
|
|
315 |
{
|
|
316 |
CItem* item = iItems[ aIndex ];
|
|
317 |
return *item;
|
|
318 |
}
|
|
319 |
|
|
320 |
|
|
321 |
const CMemSpyThreadInfoItemBase::CItem& CMemSpyThreadInfoItemBase::Item( TInt aIndex ) const
|
|
322 |
{
|
|
323 |
const CItem* item = iItems[ aIndex ];
|
|
324 |
return *item;
|
|
325 |
}
|
|
326 |
|
|
327 |
|
|
328 |
|
|
329 |
|
|
330 |
|
|
331 |
|
|
332 |
|
|
333 |
|
|
334 |
|
|
335 |
|
|
336 |
|
|
337 |
|
|
338 |
|
|
339 |
|
|
340 |
|
|
341 |
|
|
342 |
|
|
343 |
|
|
344 |
|
|
345 |
|
|
346 |
CMemSpyThreadInfoItemBase::CItem::CItem()
|
|
347 |
{
|
|
348 |
}
|
|
349 |
|
|
350 |
|
|
351 |
CMemSpyThreadInfoItemBase::CItem::~CItem()
|
|
352 |
{
|
|
353 |
delete iCaption;
|
|
354 |
delete iValue;
|
|
355 |
delete iCombined;
|
|
356 |
}
|
|
357 |
|
|
358 |
|
|
359 |
void CMemSpyThreadInfoItemBase::CItem::ConstructL( const TDesC& aCaption, const TDesC& aValue )
|
|
360 |
{
|
|
361 |
iCaption = aCaption.AllocL();
|
|
362 |
iValue = aValue.AllocL();
|
|
363 |
//
|
|
364 |
UpdateCombinedL();
|
|
365 |
}
|
|
366 |
|
|
367 |
|
|
368 |
CMemSpyThreadInfoItemBase::CItem* CMemSpyThreadInfoItemBase::CItem::NewLC( const CItem& aCopyMe )
|
|
369 |
{
|
|
370 |
CItem* self = new(ELeave) CItem();
|
|
371 |
CleanupStack::PushL( self );
|
|
372 |
self->ConstructL( aCopyMe.Caption(), aCopyMe.Value() );
|
|
373 |
return self;
|
|
374 |
}
|
|
375 |
|
|
376 |
|
|
377 |
CMemSpyThreadInfoItemBase::CItem* CMemSpyThreadInfoItemBase::CItem::NewLC( const TDesC& aCaption )
|
|
378 |
{
|
|
379 |
CItem* self = new(ELeave) CItem();
|
|
380 |
CleanupStack::PushL( self );
|
|
381 |
self->ConstructL( aCaption, KNullDesC );
|
|
382 |
return self;
|
|
383 |
}
|
|
384 |
|
|
385 |
|
|
386 |
CMemSpyThreadInfoItemBase::CItem* CMemSpyThreadInfoItemBase::CItem::NewLC( const TDesC& aCaption, const TDesC& aValue )
|
|
387 |
{
|
|
388 |
CItem* self = new(ELeave) CItem();
|
|
389 |
CleanupStack::PushL( self );
|
|
390 |
self->ConstructL( aCaption, aValue );
|
|
391 |
return self;
|
|
392 |
}
|
|
393 |
|
|
394 |
|
|
395 |
CMemSpyThreadInfoItemBase::CItem* CMemSpyThreadInfoItemBase::CItem::NewHexLC( const TDesC& aCaption, TUint aValue )
|
|
396 |
{
|
|
397 |
CItem* ret = CItem::NewLC( aCaption );
|
|
398 |
ret->SetHexL( aValue );
|
|
399 |
return ret;
|
|
400 |
}
|
|
401 |
|
|
402 |
|
|
403 |
CMemSpyThreadInfoItemBase::CItem* CMemSpyThreadInfoItemBase::CItem::NewDecimalLC( const TDesC& aCaption, TInt aValue )
|
|
404 |
{
|
|
405 |
CItem* ret = CItem::NewLC( aCaption );
|
|
406 |
ret->SetDecimalL( aValue );
|
|
407 |
return ret;
|
|
408 |
}
|
|
409 |
|
|
410 |
|
|
411 |
CMemSpyThreadInfoItemBase::CItem* CMemSpyThreadInfoItemBase::CItem::NewLongLC( const TDesC& aCaption, const TInt64& aValue )
|
|
412 |
{
|
|
413 |
CItem* ret = CItem::NewLC( aCaption );
|
|
414 |
ret->SetLongL( aValue );
|
|
415 |
return ret;
|
|
416 |
}
|
|
417 |
|
|
418 |
|
|
419 |
CMemSpyThreadInfoItemBase::CItem* CMemSpyThreadInfoItemBase::CItem::NewYesNoLC( const TDesC& aCaption, TBool aYes )
|
|
420 |
{
|
|
421 |
CItem* ret = CItem::NewLC( aCaption );
|
|
422 |
ret->SetYesNoL( aYes );
|
|
423 |
return ret;
|
|
424 |
}
|
|
425 |
|
|
426 |
|
|
427 |
CMemSpyThreadInfoItemBase::CItem* CMemSpyThreadInfoItemBase::CItem::NewOnOffLC( const TDesC& aCaption, TBool aOn )
|
|
428 |
{
|
|
429 |
CItem* ret = CItem::NewLC( aCaption );
|
|
430 |
ret->SetOnOffL( aOn );
|
|
431 |
return ret;
|
|
432 |
}
|
|
433 |
|
|
434 |
|
|
435 |
CMemSpyThreadInfoItemBase::CItem* CMemSpyThreadInfoItemBase::CItem::NewPercentageLC( const TDesC& aCaption, TInt aOneHundredPercentValue, TInt aValue )
|
|
436 |
{
|
|
437 |
CItem* ret = CItem::NewLC( aCaption );
|
|
438 |
ret->SetPercentageL( aOneHundredPercentValue, aValue );
|
|
439 |
return ret;
|
|
440 |
}
|
|
441 |
|
|
442 |
|
|
443 |
void CMemSpyThreadInfoItemBase::CItem::SetValueL( const TDesC& aValue )
|
|
444 |
{
|
|
445 |
if ( iValue == NULL )
|
|
446 |
{
|
|
447 |
iValue = aValue.AllocL();
|
|
448 |
}
|
|
449 |
else
|
|
450 |
{
|
|
451 |
if ( iValue->Des().MaxLength() < aValue.Length() )
|
|
452 |
{
|
|
453 |
iValue = iValue->ReAllocL( aValue.Length() );
|
|
454 |
}
|
|
455 |
|
|
456 |
// Now its safe to assign new content
|
|
457 |
*iValue = aValue;
|
|
458 |
}
|
|
459 |
|
|
460 |
UpdateCombinedL();
|
|
461 |
}
|
|
462 |
|
|
463 |
|
|
464 |
void CMemSpyThreadInfoItemBase::CItem::SetHexL( TUint aValue )
|
|
465 |
{
|
|
466 |
TBuf<KMemSpyNumericFormatBufferSize> val;
|
|
467 |
val.Format( KMemSpyNumericHexFormat, aValue );
|
|
468 |
SetValueL( val );
|
|
469 |
}
|
|
470 |
|
|
471 |
|
|
472 |
void CMemSpyThreadInfoItemBase::CItem::SetDecimalL( TInt aValue )
|
|
473 |
{
|
|
474 |
TBuf<KMemSpyNumericFormatBufferSize> val;
|
|
475 |
val.Format( KMemSpyNumericDecFormat, aValue );
|
|
476 |
SetValueL( val );
|
|
477 |
}
|
|
478 |
|
|
479 |
|
|
480 |
void CMemSpyThreadInfoItemBase::CItem::SetLongL( const TInt64& aValue )
|
|
481 |
{
|
|
482 |
TBuf<KMemSpyNumericFormatBufferSize> val;
|
|
483 |
val.Format( KMemSpyNumericLongFormat, aValue );
|
|
484 |
SetValueL( val );
|
|
485 |
}
|
|
486 |
|
|
487 |
|
|
488 |
void CMemSpyThreadInfoItemBase::CItem::SetYesNoL( TBool aYes )
|
|
489 |
{
|
|
490 |
if ( aYes )
|
|
491 |
{
|
|
492 |
SetValueL( KMemSpyCaptionYes );
|
|
493 |
}
|
|
494 |
else
|
|
495 |
{
|
|
496 |
SetValueL( KMemSpyCaptionNo );
|
|
497 |
}
|
|
498 |
}
|
|
499 |
|
|
500 |
|
|
501 |
void CMemSpyThreadInfoItemBase::CItem::SetOnOffL( TBool aOn )
|
|
502 |
{
|
|
503 |
if ( aOn )
|
|
504 |
{
|
|
505 |
SetValueL( KMemSpyCaptionOn );
|
|
506 |
}
|
|
507 |
else
|
|
508 |
{
|
|
509 |
SetValueL( KMemSpyCaptionOff );
|
|
510 |
}
|
|
511 |
}
|
|
512 |
|
|
513 |
|
|
514 |
void CMemSpyThreadInfoItemBase::CItem::SetPercentageL( TInt aOneHundredPercentValue, TInt aValue )
|
|
515 |
{
|
|
516 |
const TMemSpyPercentText val( MemSpyEngineUtils::FormatPercentage( TReal( aOneHundredPercentValue ), TReal( aValue ) ) );
|
|
517 |
SetValueL( val );
|
|
518 |
}
|
|
519 |
|
|
520 |
|
|
521 |
void CMemSpyThreadInfoItemBase::CItem::UpdateCombinedL()
|
|
522 |
{
|
|
523 |
const TInt requiredLength = Caption().Length() + Value().Length() + 10;
|
|
524 |
//
|
|
525 |
if ( iCombined == NULL )
|
|
526 |
{
|
|
527 |
iCombined = HBufC::NewL( requiredLength );
|
|
528 |
}
|
|
529 |
else if ( iCombined->Des().MaxLength() < requiredLength )
|
|
530 |
{
|
|
531 |
iCombined = iCombined->ReAllocL( requiredLength );
|
|
532 |
}
|
|
533 |
|
|
534 |
TPtr pCombined( iCombined->Des() );
|
|
535 |
pCombined.Zero();
|
|
536 |
pCombined.Append( _L("\t") );
|
|
537 |
pCombined.Append( Caption() );
|
|
538 |
pCombined.Append( _L("\t\t") );
|
|
539 |
pCombined.Append( Value() );
|
|
540 |
}
|
|
541 |
|
|
542 |
|
|
543 |
|
|
544 |
|
|
545 |
|
|
546 |
|
|
547 |
|
|
548 |
|
|
549 |
|
|
550 |
|
|
551 |
|
|
552 |
|
|
553 |
|
|
554 |
|
|
555 |
|
|
556 |
|
|
557 |
|
|
558 |
|
|
559 |
|
|
560 |
|
|
561 |
|
|
562 |
|
|
563 |
|
|
564 |
|
|
565 |
|
|
566 |
|
|
567 |
|
|
568 |
|
|
569 |
|
|
570 |
|
|
571 |
|
|
572 |
|
|
573 |
|
|
574 |
|
|
575 |
|
|
576 |
|
|
577 |
|
|
578 |
|
|
579 |
|
|
580 |
CMemSpyThreadInfoGeneral::CMemSpyThreadInfoGeneral( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
581 |
: CMemSpyThreadInfoItemBase( aContainer, EMemSpyThreadInfoItemTypeGeneralInfo, aAsyncConstruction )
|
|
582 |
{
|
|
583 |
}
|
|
584 |
|
|
585 |
|
|
586 |
void CMemSpyThreadInfoGeneral::ConstructL()
|
|
587 |
{
|
|
588 |
TBuf<50> temp;
|
|
589 |
RThread thread;
|
|
590 |
Container().Thread().OpenLC( thread );
|
|
591 |
const CMemSpyProcess& process = Container().Thread().Process();
|
|
592 |
|
|
593 |
_LIT( KItem1, "Thread Id" );
|
|
594 |
AddItemLongL( KItem1, thread.Id() );
|
|
595 |
|
|
596 |
_LIT( KItem1a, "Process Id" );
|
|
597 |
AddItemLongL( KItem1a, (TUint) process.Id() );
|
|
598 |
|
|
599 |
_LIT( KItem1b, "SID" );
|
|
600 |
AddItemHexL( KItem1b, process.SID() );
|
|
601 |
|
|
602 |
_LIT( KItem1c, "VID" );
|
|
603 |
AddItemHexL( KItem1c, process.VID() );
|
|
604 |
|
|
605 |
_LIT( KItem2, "Thread Priority" );
|
|
606 |
CMemSpyThread::AppendPriority( temp, thread.Priority() );
|
|
607 |
AddItemL( KItem2, temp );
|
|
608 |
temp.Zero();
|
|
609 |
|
|
610 |
_LIT( KItem3, "Process Priority" );
|
|
611 |
CMemSpyProcess::AppendPriority( temp, thread.ProcessPriority() );
|
|
612 |
AddItemL( KItem3, temp );
|
|
613 |
temp.Zero();
|
|
614 |
|
|
615 |
_LIT( KItem4, "Request Count" );
|
|
616 |
AddItemDecimalL( KItem4, thread.RequestCount() );
|
|
617 |
|
|
618 |
TInt processHandleCount = 0;
|
|
619 |
TInt threadHandleCount = 0;
|
|
620 |
thread.HandleCount( processHandleCount, threadHandleCount );
|
|
621 |
|
|
622 |
_LIT( KItem5a, "Process Handles" );
|
|
623 |
AddItemDecimalL( KItem5a, processHandleCount );
|
|
624 |
|
|
625 |
_LIT( KItem5b, "Thread Handles" );
|
|
626 |
AddItemDecimalL( KItem5b, threadHandleCount );
|
|
627 |
|
|
628 |
// Thread handle info
|
|
629 |
THandleInfo handleInfo;
|
|
630 |
thread.HandleInfo( &handleInfo );
|
|
631 |
|
|
632 |
_LIT( KItem5c, "Num. Proc. (Using)" );
|
|
633 |
AddItemDecimalL( KItem5c, handleInfo.iNumProcesses );
|
|
634 |
|
|
635 |
_LIT( KItem5d, "Num. Thread (Using)" );
|
|
636 |
AddItemDecimalL( KItem5d, handleInfo.iNumThreads );
|
|
637 |
|
|
638 |
_LIT( KItem5e, "Attributes" );
|
|
639 |
AddItemDecimalL( KItem5e, thread.Attributes() );
|
|
640 |
|
|
641 |
// CPU time (request special kernel build)
|
|
642 |
TTimeIntervalMicroSeconds cpuTime;
|
|
643 |
if ( thread.GetCpuTime( cpuTime ) == KErrNone )
|
|
644 |
{
|
|
645 |
_LIT( KItem5f, "CPU Time (us)" );
|
|
646 |
const TInt64 time = cpuTime.Int64();
|
|
647 |
AddItemLongL( KItem5f, time );
|
|
648 |
}
|
|
649 |
|
|
650 |
// Exit info
|
|
651 |
_LIT( KItem6, "Exit Type" );
|
|
652 |
CMemSpyThread::AppendExitType( temp, thread.ExitType() );
|
|
653 |
AddItemL( KItem6, temp );
|
|
654 |
temp.Zero();
|
|
655 |
|
|
656 |
if ( thread.ExitType() != EExitPending )
|
|
657 |
{
|
|
658 |
_LIT( KItem7, "Exit Reason" );
|
|
659 |
AddItemDecimalL( KItem7, thread.ExitReason() );
|
|
660 |
|
|
661 |
_LIT( KItem8, "Exit Category" );
|
|
662 |
const TExitCategoryName cat( thread.ExitCategory() );
|
|
663 |
AddItemL( KItem8, cat );
|
|
664 |
}
|
|
665 |
|
|
666 |
// Registers
|
|
667 |
MakeRegisterListingL( thread );
|
|
668 |
|
|
669 |
CleanupStack::PopAndDestroy( &thread );
|
|
670 |
|
|
671 |
Container().NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemChanged, Type() );
|
|
672 |
}
|
|
673 |
|
|
674 |
|
|
675 |
CMemSpyThreadInfoGeneral* CMemSpyThreadInfoGeneral::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
676 |
{
|
|
677 |
CMemSpyThreadInfoGeneral* self = new(ELeave) CMemSpyThreadInfoGeneral( aContainer, aAsyncConstruction );
|
|
678 |
CleanupStack::PushL( self );
|
|
679 |
if ( !aAsyncConstruction )
|
|
680 |
{
|
|
681 |
self->ConstructL();
|
|
682 |
}
|
|
683 |
return self;
|
|
684 |
}
|
|
685 |
|
|
686 |
|
|
687 |
EXPORT_C TPtrC CMemSpyThreadInfoGeneral::Name() const
|
|
688 |
{
|
|
689 |
_LIT(KName, "\tGeneral");
|
|
690 |
return TPtrC( KName );
|
|
691 |
}
|
|
692 |
|
|
693 |
|
|
694 |
void CMemSpyThreadInfoGeneral::MakeRegisterListingL( RThread& aThread )
|
|
695 |
{
|
|
696 |
#ifndef __WINS__
|
|
697 |
_LIT(KRegFormatGeneral, "R%02d");
|
|
698 |
_LIT(KRegFormatSP, "SP");
|
|
699 |
_LIT(KRegFormatLR, "LR");
|
|
700 |
_LIT(KRegFormatPC, "PC");
|
|
701 |
_LIT(KRegFormatFlags, "Flags");
|
|
702 |
_LIT(KRegFormatDACR, "DACR"); // Data access control register
|
|
703 |
//
|
|
704 |
TArmRegSet regList;
|
|
705 |
TPckg<TArmRegSet> pRegList( regList );
|
|
706 |
//
|
|
707 |
aThread.Context( pRegList );
|
|
708 |
TArmReg* pReg = reinterpret_cast<TArmReg*>( ®List );
|
|
709 |
//
|
|
710 |
for( TInt i=0; i<KArmRegisterCount; i++ )
|
|
711 |
{
|
|
712 |
const TArmReg regValue = pReg[ i ];
|
|
713 |
//
|
|
714 |
if ( i <= EArmR12 )
|
|
715 |
{
|
|
716 |
TBuf<128> buf;
|
|
717 |
buf.Format( KRegFormatGeneral, i );
|
|
718 |
AddItemHexL( buf, regValue );
|
|
719 |
}
|
|
720 |
else
|
|
721 |
{
|
|
722 |
TPtrC pCaption( KRegFormatGeneral );
|
|
723 |
//
|
|
724 |
if ( i == EArmSp )
|
|
725 |
{
|
|
726 |
pCaption.Set( KRegFormatSP );
|
|
727 |
}
|
|
728 |
else if ( i == EArmLr )
|
|
729 |
{
|
|
730 |
pCaption.Set( KRegFormatLR );
|
|
731 |
}
|
|
732 |
else if ( i == EArmPc )
|
|
733 |
{
|
|
734 |
pCaption.Set( KRegFormatPC );
|
|
735 |
}
|
|
736 |
else if ( i == EArmFlags )
|
|
737 |
{
|
|
738 |
pCaption.Set( KRegFormatFlags );
|
|
739 |
}
|
|
740 |
else if ( i == EArmDacr )
|
|
741 |
{
|
|
742 |
pCaption.Set( KRegFormatDACR );
|
|
743 |
}
|
|
744 |
//
|
|
745 |
AddItemHexL( pCaption, regValue );
|
|
746 |
}
|
|
747 |
}
|
|
748 |
#else
|
|
749 |
(void) aThread;
|
|
750 |
#endif
|
|
751 |
}
|
|
752 |
|
|
753 |
|
|
754 |
|
|
755 |
|
|
756 |
|
|
757 |
|
|
758 |
|
|
759 |
|
|
760 |
|
|
761 |
|
|
762 |
|
|
763 |
|
|
764 |
|
|
765 |
|
|
766 |
CMemSpyThreadInfoHeap::CMemSpyThreadInfoHeap( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
767 |
: CMemSpyThreadInfoItemBase( aContainer, EMemSpyThreadInfoItemTypeHeap, aAsyncConstruction )
|
|
768 |
{
|
|
769 |
}
|
|
770 |
|
|
771 |
|
|
772 |
void CMemSpyThreadInfoHeap::ConstructL()
|
|
773 |
{
|
|
774 |
CMemSpyEngineHelperHeap& heapHelper = Engine().HelperHeap();
|
|
775 |
|
|
776 |
// Get heap info first of all
|
|
777 |
TMemSpyHeapInfo info;
|
|
778 |
heapHelper.GetHeapInfoUserL( Container().Thread().Process().Id(), Container().Thread().Id(), info );
|
|
779 |
CMemSpyEngineOutputList* list = heapHelper.NewHeapSummaryShortLC( info );
|
|
780 |
|
|
781 |
// Now add each item to our view
|
|
782 |
const TInt count = list->Count();
|
|
783 |
for( TInt i=0; i<count; i++ )
|
|
784 |
{
|
|
785 |
const CMemSpyEngineOutputListItem& item = list->Item( i );
|
|
786 |
//
|
|
787 |
AddItemL( item.Caption(), item.Value() );
|
|
788 |
}
|
|
789 |
|
|
790 |
// Tidy up
|
|
791 |
CleanupStack::PopAndDestroy( list );
|
|
792 |
Container().NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemChanged, Type() );
|
|
793 |
}
|
|
794 |
|
|
795 |
|
|
796 |
CMemSpyThreadInfoHeap* CMemSpyThreadInfoHeap::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
797 |
{
|
|
798 |
CMemSpyThreadInfoHeap* self = new(ELeave) CMemSpyThreadInfoHeap( aContainer, aAsyncConstruction );
|
|
799 |
CleanupStack::PushL( self );
|
|
800 |
if ( !aAsyncConstruction )
|
|
801 |
{
|
|
802 |
self->ConstructL();
|
|
803 |
}
|
|
804 |
return self;
|
|
805 |
}
|
|
806 |
|
|
807 |
|
|
808 |
EXPORT_C TPtrC CMemSpyThreadInfoHeap::Name() const
|
|
809 |
{
|
|
810 |
_LIT(KName, "\tHeap");
|
|
811 |
return TPtrC( KName );
|
|
812 |
}
|
|
813 |
|
|
814 |
|
|
815 |
|
|
816 |
|
|
817 |
|
|
818 |
|
|
819 |
|
|
820 |
|
|
821 |
|
|
822 |
|
|
823 |
|
|
824 |
|
|
825 |
|
|
826 |
|
|
827 |
|
|
828 |
|
|
829 |
CMemSpyThreadInfoActiveObjects::CMemSpyThreadInfoActiveObjects( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
830 |
: CMemSpyThreadInfoItemBase( aContainer, EMemSpyThreadInfoItemTypeActiveObject, aAsyncConstruction )
|
|
831 |
{
|
|
832 |
}
|
|
833 |
|
|
834 |
|
|
835 |
CMemSpyThreadInfoActiveObjects::~CMemSpyThreadInfoActiveObjects()
|
|
836 |
{
|
|
837 |
delete iItems;
|
|
838 |
}
|
|
839 |
|
|
840 |
|
|
841 |
void CMemSpyThreadInfoActiveObjects::ConstructL()
|
|
842 |
{
|
|
843 |
CMemSpyEngine& engine = Container().Thread().Process().Engine();
|
|
844 |
engine.ProcessSuspendLC( Container().Thread().Process().Id() );
|
|
845 |
//
|
|
846 |
CMemSpyEngineActiveObjectArray* activeObjects = engine.HelperActiveObject().ActiveObjectListL( Container().Thread() );
|
|
847 |
delete iItems;
|
|
848 |
iItems = activeObjects;
|
|
849 |
//
|
|
850 |
CleanupStack::PopAndDestroy(); // ProcessSuspendLC
|
|
851 |
|
|
852 |
Container().NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemChanged, Type() );
|
|
853 |
}
|
|
854 |
|
|
855 |
|
|
856 |
CMemSpyThreadInfoActiveObjects* CMemSpyThreadInfoActiveObjects::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
857 |
{
|
|
858 |
CMemSpyThreadInfoActiveObjects* self = new(ELeave) CMemSpyThreadInfoActiveObjects( aContainer, aAsyncConstruction );
|
|
859 |
CleanupStack::PushL( self );
|
|
860 |
if ( !aAsyncConstruction )
|
|
861 |
{
|
|
862 |
self->ConstructL();
|
|
863 |
}
|
|
864 |
return self;
|
|
865 |
}
|
|
866 |
|
|
867 |
|
|
868 |
EXPORT_C TPtrC CMemSpyThreadInfoActiveObjects::Name() const
|
|
869 |
{
|
|
870 |
_LIT(KName, "\tActive Objects");
|
|
871 |
return TPtrC( KName );
|
|
872 |
}
|
|
873 |
|
|
874 |
|
|
875 |
EXPORT_C TInt CMemSpyThreadInfoActiveObjects::MdcaCount() const
|
|
876 |
{
|
|
877 |
TInt count = 0;
|
|
878 |
//
|
|
879 |
if ( iItems )
|
|
880 |
{
|
|
881 |
count = iItems->MdcaCount();
|
|
882 |
}
|
|
883 |
//
|
|
884 |
return count;
|
|
885 |
}
|
|
886 |
|
|
887 |
|
|
888 |
EXPORT_C TPtrC CMemSpyThreadInfoActiveObjects::MdcaPoint(TInt aIndex) const
|
|
889 |
{
|
|
890 |
TPtrC ret( KNullDesC );
|
|
891 |
//
|
|
892 |
if ( iItems )
|
|
893 |
{
|
|
894 |
ret.Set( iItems->MdcaPoint( aIndex ) );
|
|
895 |
}
|
|
896 |
//
|
|
897 |
return ret;
|
|
898 |
}
|
|
899 |
|
|
900 |
|
|
901 |
|
|
902 |
|
|
903 |
|
|
904 |
|
|
905 |
|
|
906 |
|
|
907 |
|
|
908 |
|
|
909 |
|
|
910 |
|
|
911 |
CMemSpyThreadInfoOpenFiles::CMemSpyThreadInfoOpenFiles( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
912 |
: CMemSpyThreadInfoItemBase( aContainer, EMemSpyThreadInfoItemTypeOpenFiles, aAsyncConstruction )
|
|
913 |
{
|
|
914 |
}
|
|
915 |
|
|
916 |
|
|
917 |
void CMemSpyThreadInfoOpenFiles::ConstructL()
|
|
918 |
{
|
|
919 |
_LIT(KSpace, " ");
|
|
920 |
//
|
|
921 |
const TThreadId myThreadId = Container().Thread().Id();
|
|
922 |
CMemSpyEngine& engine = Container().Thread().Process().Engine();
|
|
923 |
RFs& fsSession = engine.FsSession();
|
|
924 |
//
|
|
925 |
TMemSpySizeText valueBuf;
|
|
926 |
TBuf<128> timeBuf;
|
|
927 |
TOpenFileScan scanner( fsSession );
|
|
928 |
//
|
|
929 |
CFileList* list = NULL;
|
|
930 |
scanner.NextL( list );
|
|
931 |
|
|
932 |
while( list != NULL )
|
|
933 |
{
|
|
934 |
if ( scanner.ThreadId() == myThreadId )
|
|
935 |
{
|
|
936 |
CleanupStack::PushL( list );
|
|
937 |
|
|
938 |
const TInt entryCount = list->Count();
|
|
939 |
for(TInt i=0; i<entryCount; i++)
|
|
940 |
{
|
|
941 |
const TEntry& entry = (*list)[ i ];
|
|
942 |
|
|
943 |
// Get time and size format strings
|
|
944 |
valueBuf = MemSpyEngineUtils::FormatSizeText( entry.iSize );
|
|
945 |
MemSpyEngineUtils::FormatTimeL( timeBuf, entry.iModified );
|
|
946 |
timeBuf.Insert( 0, KSpace );
|
|
947 |
timeBuf.Insert( 0, valueBuf );
|
|
948 |
|
|
949 |
// Get just file name
|
|
950 |
TParsePtrC parser( entry.iName );
|
|
951 |
const TPtrC pJustName( parser.NameAndExt() );
|
|
952 |
|
|
953 |
// Create item
|
|
954 |
AddItemL( pJustName, timeBuf );
|
|
955 |
}
|
|
956 |
|
|
957 |
CleanupStack::Pop( list );
|
|
958 |
}
|
|
959 |
|
|
960 |
delete list;
|
|
961 |
list = NULL;
|
|
962 |
scanner.NextL( list );
|
|
963 |
}
|
|
964 |
|
|
965 |
Container().NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemChanged, Type() );
|
|
966 |
}
|
|
967 |
|
|
968 |
|
|
969 |
CMemSpyThreadInfoOpenFiles* CMemSpyThreadInfoOpenFiles::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
970 |
{
|
|
971 |
CMemSpyThreadInfoOpenFiles* self = new(ELeave) CMemSpyThreadInfoOpenFiles( aContainer, aAsyncConstruction );
|
|
972 |
CleanupStack::PushL( self );
|
|
973 |
if ( !aAsyncConstruction )
|
|
974 |
{
|
|
975 |
self->ConstructL();
|
|
976 |
}
|
|
977 |
return self;
|
|
978 |
}
|
|
979 |
|
|
980 |
|
|
981 |
EXPORT_C TPtrC CMemSpyThreadInfoOpenFiles::Name() const
|
|
982 |
{
|
|
983 |
_LIT(KName, "\tOpen Files");
|
|
984 |
return TPtrC( KName );
|
|
985 |
}
|
|
986 |
|
|
987 |
|
|
988 |
|
|
989 |
|
|
990 |
|
|
991 |
|
|
992 |
|
|
993 |
|
|
994 |
|
|
995 |
|
|
996 |
|
|
997 |
|
|
998 |
|
|
999 |
|
|
1000 |
|
|
1001 |
|
|
1002 |
CMemSpyThreadInfoStack::CMemSpyThreadInfoStack( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1003 |
: CMemSpyThreadInfoItemBase( aContainer, EMemSpyThreadInfoItemTypeStack, aAsyncConstruction )
|
|
1004 |
{
|
|
1005 |
}
|
|
1006 |
|
|
1007 |
|
|
1008 |
void CMemSpyThreadInfoStack::ConstructL()
|
|
1009 |
{
|
|
1010 |
CMemSpyEngine& engine = Container().Thread().Process().Engine();
|
|
1011 |
engine.ProcessSuspendLC( Container().Thread().Process().Id() );
|
|
1012 |
//
|
|
1013 |
TMemSpyDriverStackInfo info;
|
|
1014 |
const TInt error = engine.Driver().GetStackInfo( Container().Thread().Id(), info );
|
|
1015 |
User::LeaveIfError( error );
|
|
1016 |
|
|
1017 |
_LIT( KItem1, "Size" );
|
|
1018 |
AddItemDecimalL( KItem1, info.iUserStackSize );
|
|
1019 |
|
|
1020 |
#ifndef __WINS__
|
|
1021 |
const TInt userStackUsage = (TInt) ( info.iUserStackBase + info.iUserStackSize ) - info.iUserStackPointer;
|
|
1022 |
const TInt userStackHighWaterMarkUsage = (TInt) ( info.iUserStackBase + info.iUserStackSize ) - info.iUserStackHighWatermark;
|
|
1023 |
|
|
1024 |
_LIT( KItem2, "Stack used" );
|
|
1025 |
AddItemDecimalL( KItem2, userStackUsage );
|
|
1026 |
|
|
1027 |
_LIT( KItem3, "(percentage)" );
|
|
1028 |
AddItemPercentageL( KItem3, info.iUserStackSize, userStackUsage );
|
|
1029 |
|
|
1030 |
_LIT( KItem4, "High watermark" );
|
|
1031 |
AddItemDecimalL( KItem4, userStackHighWaterMarkUsage );
|
|
1032 |
|
|
1033 |
_LIT( KItem5, "(percentage)" );
|
|
1034 |
AddItemPercentageL( KItem5, info.iUserStackSize, userStackHighWaterMarkUsage );
|
|
1035 |
#endif
|
|
1036 |
|
|
1037 |
_LIT( KItem6, "Base address" );
|
|
1038 |
AddItemHexL( KItem6, info.iUserStackBase );
|
|
1039 |
|
|
1040 |
#ifndef __WINS__
|
|
1041 |
_LIT( KItem7, "Current pointer" );
|
|
1042 |
AddItemHexL( KItem7, info.iUserStackPointer );
|
|
1043 |
#endif
|
|
1044 |
//
|
|
1045 |
CleanupStack::PopAndDestroy(); // ProcessSuspendLC
|
|
1046 |
|
|
1047 |
Container().NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemChanged, Type() );
|
|
1048 |
}
|
|
1049 |
|
|
1050 |
|
|
1051 |
CMemSpyThreadInfoStack* CMemSpyThreadInfoStack::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1052 |
{
|
|
1053 |
CMemSpyThreadInfoStack* self = new(ELeave) CMemSpyThreadInfoStack( aContainer, aAsyncConstruction );
|
|
1054 |
CleanupStack::PushL( self );
|
|
1055 |
if ( !aAsyncConstruction )
|
|
1056 |
{
|
|
1057 |
self->ConstructL();
|
|
1058 |
}
|
|
1059 |
return self;
|
|
1060 |
}
|
|
1061 |
|
|
1062 |
|
|
1063 |
EXPORT_C TPtrC CMemSpyThreadInfoStack::Name() const
|
|
1064 |
{
|
|
1065 |
_LIT(KName, "\tStack");
|
|
1066 |
return TPtrC( KName );
|
|
1067 |
}
|
|
1068 |
|
|
1069 |
|
|
1070 |
|
|
1071 |
|
|
1072 |
|
|
1073 |
|
|
1074 |
|
|
1075 |
|
|
1076 |
|
|
1077 |
|
|
1078 |
|
|
1079 |
|
|
1080 |
|
|
1081 |
|
|
1082 |
|
|
1083 |
|
|
1084 |
|
|
1085 |
|
|
1086 |
|
|
1087 |
|
|
1088 |
|
|
1089 |
|
|
1090 |
|
|
1091 |
|
|
1092 |
|
|
1093 |
|
|
1094 |
|
|
1095 |
|
|
1096 |
|
|
1097 |
|
|
1098 |
CMemSpyThreadInfoChunk::CMemSpyThreadInfoChunk( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1099 |
: CMemSpyThreadInfoItemBase( aContainer, EMemSpyThreadInfoItemTypeChunk, aAsyncConstruction )
|
|
1100 |
{
|
|
1101 |
}
|
|
1102 |
|
|
1103 |
|
|
1104 |
CMemSpyThreadInfoChunk::~CMemSpyThreadInfoChunk()
|
|
1105 |
{
|
|
1106 |
delete iList;
|
|
1107 |
}
|
|
1108 |
|
|
1109 |
|
|
1110 |
void CMemSpyThreadInfoChunk::ConstructL()
|
|
1111 |
{
|
|
1112 |
CMemSpyEngine& engine = Container().Thread().Process().Engine();
|
|
1113 |
engine.ProcessSuspendLC( Container().Thread().Process().Id() );
|
|
1114 |
//
|
|
1115 |
CMemSpyEngineChunkList* list = engine.HelperChunk().ListForThreadL( Container().Thread().Id() );
|
|
1116 |
delete iList;
|
|
1117 |
iList = list;
|
|
1118 |
//
|
|
1119 |
CleanupStack::PopAndDestroy(); // ProcessSuspendLC
|
|
1120 |
|
|
1121 |
Container().NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemChanged, Type() );
|
|
1122 |
}
|
|
1123 |
|
|
1124 |
|
|
1125 |
CMemSpyThreadInfoChunk* CMemSpyThreadInfoChunk::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1126 |
{
|
|
1127 |
CMemSpyThreadInfoChunk* self = new(ELeave) CMemSpyThreadInfoChunk( aContainer, aAsyncConstruction );
|
|
1128 |
CleanupStack::PushL( self );
|
|
1129 |
if ( !aAsyncConstruction )
|
|
1130 |
{
|
|
1131 |
self->ConstructL();
|
|
1132 |
}
|
|
1133 |
return self;
|
|
1134 |
}
|
|
1135 |
|
|
1136 |
|
|
1137 |
EXPORT_C TPtrC CMemSpyThreadInfoChunk::Name() const
|
|
1138 |
{
|
|
1139 |
_LIT(KName, "\tChunks");
|
|
1140 |
return TPtrC( KName );
|
|
1141 |
}
|
|
1142 |
|
|
1143 |
|
|
1144 |
EXPORT_C TInt CMemSpyThreadInfoChunk::MdcaCount() const
|
|
1145 |
{
|
|
1146 |
TInt count = 0;
|
|
1147 |
//
|
|
1148 |
if ( iList )
|
|
1149 |
{
|
|
1150 |
count = iList->MdcaCount();
|
|
1151 |
}
|
|
1152 |
//
|
|
1153 |
return count;
|
|
1154 |
}
|
|
1155 |
|
|
1156 |
|
|
1157 |
EXPORT_C TPtrC CMemSpyThreadInfoChunk::MdcaPoint(TInt aIndex) const
|
|
1158 |
{
|
|
1159 |
TPtrC ret( KNullDesC );
|
|
1160 |
//
|
|
1161 |
if ( iList )
|
|
1162 |
{
|
|
1163 |
ret.Set( iList->MdcaPoint( aIndex ) );
|
|
1164 |
}
|
|
1165 |
//
|
|
1166 |
return ret;
|
|
1167 |
}
|
|
1168 |
|
|
1169 |
|
|
1170 |
|
|
1171 |
|
|
1172 |
|
|
1173 |
|
|
1174 |
|
|
1175 |
|
|
1176 |
|
|
1177 |
|
|
1178 |
|
|
1179 |
|
|
1180 |
|
|
1181 |
|
|
1182 |
|
|
1183 |
|
|
1184 |
|
|
1185 |
|
|
1186 |
CMemSpyThreadInfoCodeSeg::CMemSpyThreadInfoCodeSeg( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1187 |
: CMemSpyThreadInfoItemBase( aContainer, EMemSpyThreadInfoItemTypeCodeSeg, aAsyncConstruction )
|
|
1188 |
{
|
|
1189 |
}
|
|
1190 |
|
|
1191 |
|
|
1192 |
CMemSpyThreadInfoCodeSeg::~CMemSpyThreadInfoCodeSeg()
|
|
1193 |
{
|
|
1194 |
delete iList;
|
|
1195 |
}
|
|
1196 |
|
|
1197 |
|
|
1198 |
void CMemSpyThreadInfoCodeSeg::ConstructL()
|
|
1199 |
{
|
|
1200 |
CMemSpyEngine& engine = Container().Thread().Process().Engine();
|
|
1201 |
engine.ProcessSuspendLC( Container().Thread().Process().Id() );
|
|
1202 |
//
|
|
1203 |
CMemSpyEngineCodeSegList* list = engine.HelperCodeSegment().CodeSegmentListL( Container().Thread().Process().Id() );
|
|
1204 |
delete iList;
|
|
1205 |
iList = list;
|
|
1206 |
//
|
|
1207 |
CleanupStack::PopAndDestroy(); // ProcessSuspendLC
|
|
1208 |
|
|
1209 |
Container().NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemChanged, Type() );
|
|
1210 |
}
|
|
1211 |
|
|
1212 |
|
|
1213 |
CMemSpyThreadInfoCodeSeg* CMemSpyThreadInfoCodeSeg::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1214 |
{
|
|
1215 |
CMemSpyThreadInfoCodeSeg* self = new(ELeave) CMemSpyThreadInfoCodeSeg( aContainer, aAsyncConstruction );
|
|
1216 |
CleanupStack::PushL( self );
|
|
1217 |
if ( !aAsyncConstruction )
|
|
1218 |
{
|
|
1219 |
self->ConstructL();
|
|
1220 |
}
|
|
1221 |
return self;
|
|
1222 |
}
|
|
1223 |
|
|
1224 |
|
|
1225 |
EXPORT_C TPtrC CMemSpyThreadInfoCodeSeg::Name() const
|
|
1226 |
{
|
|
1227 |
_LIT(KName, "\tCode Segments");
|
|
1228 |
return TPtrC( KName );
|
|
1229 |
}
|
|
1230 |
|
|
1231 |
|
|
1232 |
EXPORT_C TInt CMemSpyThreadInfoCodeSeg::MdcaCount() const
|
|
1233 |
{
|
|
1234 |
TInt count = 0;
|
|
1235 |
//
|
|
1236 |
if ( iList )
|
|
1237 |
{
|
|
1238 |
count = iList->MdcaCount();
|
|
1239 |
}
|
|
1240 |
//
|
|
1241 |
return count;
|
|
1242 |
}
|
|
1243 |
|
|
1244 |
|
|
1245 |
EXPORT_C TPtrC CMemSpyThreadInfoCodeSeg::MdcaPoint(TInt aIndex) const
|
|
1246 |
{
|
|
1247 |
TPtrC ret( KNullDesC );
|
|
1248 |
//
|
|
1249 |
if ( iList )
|
|
1250 |
{
|
|
1251 |
ret.Set( iList->MdcaPoint( aIndex ) );
|
|
1252 |
}
|
|
1253 |
//
|
|
1254 |
return ret;
|
|
1255 |
}
|
|
1256 |
|
|
1257 |
|
|
1258 |
|
|
1259 |
|
|
1260 |
|
|
1261 |
|
|
1262 |
|
|
1263 |
|
|
1264 |
|
|
1265 |
|
|
1266 |
|
|
1267 |
|
|
1268 |
|
|
1269 |
|
|
1270 |
|
|
1271 |
|
|
1272 |
|
|
1273 |
|
|
1274 |
|
|
1275 |
|
|
1276 |
|
|
1277 |
|
|
1278 |
|
|
1279 |
|
|
1280 |
|
|
1281 |
CMemSpyThreadInfoHandleObjectBase::CMemSpyThreadInfoHandleObjectBase( CMemSpyThreadInfoContainer& aContainer, TMemSpyThreadInfoItemType aItemType, TMemSpyDriverContainerType aContainerType, TBool aAsyncConstruction )
|
|
1282 |
: CMemSpyThreadInfoItemBase( aContainer, aItemType, aAsyncConstruction ), iContainerType( aContainerType )
|
|
1283 |
{
|
|
1284 |
}
|
|
1285 |
|
|
1286 |
|
|
1287 |
CMemSpyThreadInfoHandleObjectBase::~CMemSpyThreadInfoHandleObjectBase()
|
|
1288 |
{
|
|
1289 |
#ifdef _DEBUG
|
|
1290 |
RDebug::Printf( "CMemSpyThreadInfoHandleObjectBase::~CMemSpyThreadInfoHandleObjectBase() - this: 0x%08x", this );
|
|
1291 |
#endif
|
|
1292 |
iInfoItems.Close();
|
|
1293 |
}
|
|
1294 |
|
|
1295 |
|
|
1296 |
void CMemSpyThreadInfoHandleObjectBase::ConstructL()
|
|
1297 |
{
|
|
1298 |
#ifdef _DEBUG
|
|
1299 |
RDebug::Printf( "CMemSpyThreadInfoHandleObjectBase::ConstructL() - START" );
|
|
1300 |
#endif
|
|
1301 |
iInfoItems.Reset();
|
|
1302 |
//
|
|
1303 |
CMemSpyProcess& process = Container().Thread().Process();
|
|
1304 |
CMemSpyEngine& engine = process.Engine();
|
|
1305 |
engine.ProcessSuspendLC( process.Id() );
|
|
1306 |
//
|
|
1307 |
RArray<THandleWrapper> handles;
|
|
1308 |
CleanupClosePushL( handles );
|
|
1309 |
GetHandlesL( handles );
|
|
1310 |
#ifdef _DEBUG
|
|
1311 |
RDebug::Printf( "CMemSpyThreadInfoHandleObjectBase::ConstructL() - got %d handle entries...", handles.Count() );
|
|
1312 |
#endif
|
|
1313 |
//
|
|
1314 |
TFullName name;
|
|
1315 |
TMemSpyDriverHandleInfoGeneric info;
|
|
1316 |
//
|
|
1317 |
const TInt count = handles.Count();
|
|
1318 |
for (TInt i=0; i<count; i++)
|
|
1319 |
{
|
|
1320 |
const THandleWrapper& handleWrapper = handles[ i ];
|
|
1321 |
//
|
|
1322 |
const TInt r = engine.Driver().GetGenericHandleInfo( Container().Thread().Id(), handleWrapper.iType, handleWrapper.iHandle, info );
|
|
1323 |
//
|
|
1324 |
#ifdef _DEBUG
|
|
1325 |
RDebug::Printf( "CMemSpyThreadInfoHandleObjectBase::ConstructL() - handle[%3d] 0x%08x, type: %d, refCount: %d, r: %d", i, handleWrapper.iHandle, handleWrapper.iType, handleWrapper.iRefCount, r );
|
|
1326 |
#endif
|
|
1327 |
//
|
|
1328 |
if (r == KErrNone)
|
|
1329 |
{
|
|
1330 |
name.Copy( info.iName );
|
|
1331 |
#ifdef _DEBUG
|
|
1332 |
RDebug::Print( _L( "CMemSpyThreadInfoHandleObjectBase::ConstructL() - HANDLE [%3d] %S"), handleWrapper.iRefCount, &name );
|
|
1333 |
#endif
|
|
1334 |
StripProcessAndThreadNames( name );
|
|
1335 |
//
|
|
1336 |
iInfoItems.AppendL( info );
|
|
1337 |
HandleContainerItemL( info, handleWrapper.iRefCount, name );
|
|
1338 |
}
|
|
1339 |
}
|
|
1340 |
|
|
1341 |
CleanupStack::PopAndDestroy( &handles );
|
|
1342 |
CleanupStack::PopAndDestroy(); // ProcessSuspendLC
|
|
1343 |
|
|
1344 |
HandleAllItemsLocatedL();
|
|
1345 |
|
|
1346 |
Container().NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemChanged, Type() );
|
|
1347 |
}
|
|
1348 |
|
|
1349 |
|
|
1350 |
TBool CMemSpyThreadInfoHandleObjectBase::THandleWrapper::Match( const THandleWrapper& aLeft, const THandleWrapper& aRight )
|
|
1351 |
{
|
|
1352 |
return ( aLeft.iHandle == aRight.iHandle );
|
|
1353 |
}
|
|
1354 |
|
|
1355 |
|
|
1356 |
EXPORT_C TInt CMemSpyThreadInfoHandleObjectBase::DetailsIndexByEntry( const TMemSpyDriverHandleInfoGeneric& aEntry ) const
|
|
1357 |
{
|
|
1358 |
#ifdef _DEBUG
|
|
1359 |
RDebug::Printf( "CMemSpyThreadInfoHandleObjectBase::DetailsIndexByEntry() - START - this: 0x%08x, aEntry.iHandle: 0x%08x", this, aEntry.iHandle );
|
|
1360 |
#endif
|
|
1361 |
//
|
|
1362 |
const TInt ret = DetailsIndexByHandle( aEntry.iHandle );
|
|
1363 |
//
|
|
1364 |
#ifdef _DEBUG
|
|
1365 |
RDebug::Printf( "CMemSpyThreadInfoHandleObjectBase::DetailsIndexByEntry() - END - ret: %d", ret );
|
|
1366 |
#endif
|
|
1367 |
return ret;
|
|
1368 |
}
|
|
1369 |
|
|
1370 |
|
|
1371 |
EXPORT_C TInt CMemSpyThreadInfoHandleObjectBase::DetailsIndexByHandle( TAny* aHandle ) const
|
|
1372 |
{
|
|
1373 |
#ifdef _DEBUG
|
|
1374 |
RDebug::Printf( "CMemSpyThreadInfoHandleObjectBase::DetailsIndexByHandle() - START - this: 0x%08x, aHandle: 0x%08x", this, aHandle );
|
|
1375 |
#endif
|
|
1376 |
TInt ret = KErrNotFound;
|
|
1377 |
//
|
|
1378 |
const TInt count = DetailsCount();
|
|
1379 |
for(TInt i=0; i<count; i++)
|
|
1380 |
{
|
|
1381 |
const TMemSpyDriverHandleInfoGeneric& item = DetailsAt( i );
|
|
1382 |
if ( item.iHandle == aHandle )
|
|
1383 |
{
|
|
1384 |
ret = i;
|
|
1385 |
break;
|
|
1386 |
}
|
|
1387 |
}
|
|
1388 |
//
|
|
1389 |
#ifdef _DEBUG
|
|
1390 |
RDebug::Printf( "CMemSpyThreadInfoHandleObjectBase::DetailsIndexByHandle() - END - ret: %d", ret );
|
|
1391 |
#endif
|
|
1392 |
return ret;
|
|
1393 |
}
|
|
1394 |
|
|
1395 |
|
|
1396 |
|
|
1397 |
|
|
1398 |
|
|
1399 |
|
|
1400 |
|
|
1401 |
|
|
1402 |
|
|
1403 |
|
|
1404 |
|
|
1405 |
|
|
1406 |
|
|
1407 |
|
|
1408 |
CMemSpyThreadInfoHandleByContainer::CMemSpyThreadInfoHandleByContainer( CMemSpyThreadInfoContainer& aContainer, TMemSpyThreadInfoItemType aItemType, TMemSpyDriverContainerType aContainerType, TBool aAsyncConstruction )
|
|
1409 |
: CMemSpyThreadInfoHandleObjectBase( aContainer, aItemType, aContainerType, aAsyncConstruction )
|
|
1410 |
{
|
|
1411 |
}
|
|
1412 |
|
|
1413 |
|
|
1414 |
void CMemSpyThreadInfoHandleByContainer::GetHandlesL( RArray<THandleWrapper>& aArray )
|
|
1415 |
{
|
|
1416 |
#ifdef _DEBUG
|
|
1417 |
RDebug::Printf( "CMemSpyThreadInfoHandleByContainer::GetHandlesL() - START - container: %d", ContainerType() );
|
|
1418 |
#endif
|
|
1419 |
|
|
1420 |
aArray.Reset();
|
|
1421 |
|
|
1422 |
// Our handles will be stored here... duplicates are filtered out
|
|
1423 |
TInt r = KErrNone;
|
|
1424 |
TInt c = KMemSpyDefaultMaxHandleCount;
|
|
1425 |
TAny* handles[ KMemSpyDefaultMaxHandleCount ];
|
|
1426 |
|
|
1427 |
CMemSpyProcess& process = Container().Thread().Process();
|
|
1428 |
CMemSpyEngine& engine = process.Engine();
|
|
1429 |
TIdentityRelation<CMemSpyThreadInfoHandleObjectBase::THandleWrapper> finder( THandleWrapper::Match );
|
|
1430 |
|
|
1431 |
// First get the handles for the process
|
|
1432 |
if ( r == KErrNone )
|
|
1433 |
{
|
|
1434 |
c = KMemSpyDefaultMaxHandleCount;
|
|
1435 |
r = engine.Driver().GetProcessHandlesByType( process.Id(), ContainerType(), handles, c );
|
|
1436 |
if ( r == KErrNone && c > 0 )
|
|
1437 |
{
|
|
1438 |
c = Min( c, KMemSpyDefaultMaxHandleCount );
|
|
1439 |
for( TInt i=0; i<c; i++ )
|
|
1440 |
{
|
|
1441 |
TAny* handle = handles[ i ];
|
|
1442 |
|
|
1443 |
// Create temporary entry that we'll use as the key in our array...
|
|
1444 |
CMemSpyThreadInfoHandleObjectBase::THandleWrapper entry( handle, ContainerType() );
|
|
1445 |
|
|
1446 |
// Find existing duplicate entry (if there is one...)
|
|
1447 |
const TInt errorOrIndex = aArray.Find( entry, finder );
|
|
1448 |
#ifdef _DEBUG
|
|
1449 |
RDebug::Printf( "CMemSpyThreadInfoHandleByContainer::GetHandlesL() - PROC[%03d/%03d] - handle: 0x%08x, foundIndex: %d", i+1, c, handle, errorOrIndex );
|
|
1450 |
#endif
|
|
1451 |
|
|
1452 |
if ( errorOrIndex == KErrNotFound )
|
|
1453 |
{
|
|
1454 |
// Not a duplicate handle, so keep it
|
|
1455 |
aArray.AppendL( entry );
|
|
1456 |
#ifdef _DEBUG
|
|
1457 |
RDebug::Printf( " new entry: 0x%08x", handle );
|
|
1458 |
#endif
|
|
1459 |
}
|
|
1460 |
else if ( errorOrIndex >= 0 )
|
|
1461 |
{
|
|
1462 |
// Increment reference count for duplicates...
|
|
1463 |
CMemSpyThreadInfoHandleObjectBase::THandleWrapper& existingEntry = aArray[ errorOrIndex ];
|
|
1464 |
++existingEntry.iRefCount;
|
|
1465 |
#ifdef _DEBUG
|
|
1466 |
RDebug::Printf( " dupe entry - count is now: %d", existingEntry.iRefCount );
|
|
1467 |
#endif
|
|
1468 |
}
|
|
1469 |
}
|
|
1470 |
}
|
|
1471 |
}
|
|
1472 |
|
|
1473 |
// Next get the handles for the thread
|
|
1474 |
if ( r == KErrNone )
|
|
1475 |
{
|
|
1476 |
c = KMemSpyDefaultMaxHandleCount;
|
|
1477 |
r = engine.Driver().GetThreadHandlesByType( Container().Thread().Id(), ContainerType(), handles, c );
|
|
1478 |
if ( r == KErrNone && c > 0 )
|
|
1479 |
{
|
|
1480 |
c = Min( c, KMemSpyDefaultMaxHandleCount );
|
|
1481 |
for( TInt i=0; i<c; i++ )
|
|
1482 |
{
|
|
1483 |
TAny* handle = handles[ i ];
|
|
1484 |
|
|
1485 |
// Create temporary entry that we'll use as the key in our array...
|
|
1486 |
CMemSpyThreadInfoHandleObjectBase::THandleWrapper entry( handle, ContainerType() );
|
|
1487 |
|
|
1488 |
// Find existing duplicate entry (if there is one...)
|
|
1489 |
const TInt errorOrIndex = aArray.Find( entry, finder );
|
|
1490 |
#ifdef _DEBUG
|
|
1491 |
RDebug::Printf( "CMemSpyThreadInfoHandleByContainer::GetHandlesL() - THRD[%03d/%03d] - handle: 0x%08x, foundIndex: %d", i+1, c, handle, errorOrIndex );
|
|
1492 |
#endif
|
|
1493 |
|
|
1494 |
if ( errorOrIndex == KErrNotFound )
|
|
1495 |
{
|
|
1496 |
// Not a duplicate handle, so keep it
|
|
1497 |
aArray.AppendL( entry );
|
|
1498 |
#ifdef _DEBUG
|
|
1499 |
RDebug::Printf( " new entry: 0x%08x", handle );
|
|
1500 |
#endif
|
|
1501 |
}
|
|
1502 |
else if ( errorOrIndex >= 0 )
|
|
1503 |
{
|
|
1504 |
// Increment reference count for duplicates...
|
|
1505 |
CMemSpyThreadInfoHandleObjectBase::THandleWrapper& existingEntry = aArray[ errorOrIndex ];
|
|
1506 |
++existingEntry.iRefCount;
|
|
1507 |
#ifdef _DEBUG
|
|
1508 |
RDebug::Printf( " dupe entry - count is now: %d", existingEntry.iRefCount );
|
|
1509 |
#endif
|
|
1510 |
}
|
|
1511 |
}
|
|
1512 |
}
|
|
1513 |
}
|
|
1514 |
|
|
1515 |
#ifdef _DEBUG
|
|
1516 |
RDebug::Printf( "CMemSpyThreadInfoHandleByContainer::GetHandlesL() - final handle listing: " );
|
|
1517 |
|
|
1518 |
const TInt finalCount = aArray.Count();
|
|
1519 |
for( TInt i=0; i<finalCount; i++ )
|
|
1520 |
{
|
|
1521 |
const THandleWrapper& handle = aArray[ i ];
|
|
1522 |
RDebug::Printf( "entry[%03d/%03d] - handle: 0x%08x, type: %d, refCount: %d", i+1, finalCount, handle.iHandle, handle.iType, handle.iRefCount );
|
|
1523 |
}
|
|
1524 |
|
|
1525 |
RDebug::Printf( "CMemSpyThreadInfoHandleByContainer::GetHandlesL() - END - container: %d, finalCount: %d", ContainerType(), finalCount );
|
|
1526 |
#endif
|
|
1527 |
}
|
|
1528 |
|
|
1529 |
|
|
1530 |
|
|
1531 |
|
|
1532 |
|
|
1533 |
|
|
1534 |
|
|
1535 |
|
|
1536 |
|
|
1537 |
|
|
1538 |
|
|
1539 |
|
|
1540 |
|
|
1541 |
|
|
1542 |
|
|
1543 |
|
|
1544 |
|
|
1545 |
|
|
1546 |
|
|
1547 |
|
|
1548 |
|
|
1549 |
|
|
1550 |
|
|
1551 |
|
|
1552 |
|
|
1553 |
|
|
1554 |
|
|
1555 |
|
|
1556 |
|
|
1557 |
|
|
1558 |
|
|
1559 |
|
|
1560 |
|
|
1561 |
|
|
1562 |
|
|
1563 |
|
|
1564 |
|
|
1565 |
|
|
1566 |
|
|
1567 |
|
|
1568 |
|
|
1569 |
|
|
1570 |
|
|
1571 |
|
|
1572 |
|
|
1573 |
|
|
1574 |
|
|
1575 |
|
|
1576 |
|
|
1577 |
CMemSpyThreadInfoServer::CMemSpyThreadInfoServer( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1578 |
: CMemSpyThreadInfoHandleByContainer( aContainer, EMemSpyThreadInfoItemTypeServer, EMemSpyDriverContainerTypeServer, aAsyncConstruction )
|
|
1579 |
{
|
|
1580 |
}
|
|
1581 |
|
|
1582 |
|
|
1583 |
CMemSpyThreadInfoServer* CMemSpyThreadInfoServer::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1584 |
{
|
|
1585 |
CMemSpyThreadInfoServer* self = new(ELeave) CMemSpyThreadInfoServer( aContainer, aAsyncConstruction );
|
|
1586 |
CleanupStack::PushL( self );
|
|
1587 |
if ( !aAsyncConstruction )
|
|
1588 |
{
|
|
1589 |
self->ConstructL();
|
|
1590 |
}
|
|
1591 |
return self;
|
|
1592 |
}
|
|
1593 |
|
|
1594 |
|
|
1595 |
EXPORT_C TPtrC CMemSpyThreadInfoServer::Name() const
|
|
1596 |
{
|
|
1597 |
_LIT(KName, "\tServers Running in Thread");
|
|
1598 |
return TPtrC( KName );
|
|
1599 |
}
|
|
1600 |
|
|
1601 |
|
|
1602 |
void CMemSpyThreadInfoServer::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& /*aItem*/, TInt /*aRefCount*/, TDes& aFullName )
|
|
1603 |
{
|
|
1604 |
AddItemL( aFullName, KNullDesC );
|
|
1605 |
}
|
|
1606 |
|
|
1607 |
|
|
1608 |
EXPORT_C TPtrC CMemSpyThreadInfoServer::SessionType( TIpcSessionType aType )
|
|
1609 |
{
|
|
1610 |
_LIT( KUnsharable, "Unsharable" );
|
|
1611 |
_LIT( KSharable, "Sharable" );
|
|
1612 |
_LIT( KGlobalSharable, "Global Sharable" );
|
|
1613 |
//
|
|
1614 |
TPtrC pType(KNullDesC);
|
|
1615 |
switch( aType )
|
|
1616 |
{
|
|
1617 |
case EIpcSession_Unsharable:
|
|
1618 |
pType.Set( KUnsharable );
|
|
1619 |
break;
|
|
1620 |
case EIpcSession_Sharable:
|
|
1621 |
pType.Set( KSharable );
|
|
1622 |
break;
|
|
1623 |
case EIpcSession_GlobalSharable:
|
|
1624 |
pType.Set( KGlobalSharable );
|
|
1625 |
break;
|
|
1626 |
default:
|
|
1627 |
pType.Set( KMemSpyUnavailable );
|
|
1628 |
break;
|
|
1629 |
}
|
|
1630 |
//
|
|
1631 |
return pType;
|
|
1632 |
}
|
|
1633 |
|
|
1634 |
|
|
1635 |
|
|
1636 |
|
|
1637 |
|
|
1638 |
|
|
1639 |
|
|
1640 |
|
|
1641 |
|
|
1642 |
|
|
1643 |
|
|
1644 |
|
|
1645 |
|
|
1646 |
|
|
1647 |
|
|
1648 |
|
|
1649 |
|
|
1650 |
|
|
1651 |
|
|
1652 |
|
|
1653 |
|
|
1654 |
|
|
1655 |
|
|
1656 |
|
|
1657 |
CMemSpyThreadInfoSession::CMemSpyThreadInfoSession( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1658 |
: CMemSpyThreadInfoHandleByContainer( aContainer, EMemSpyThreadInfoItemTypeSession, EMemSpyDriverContainerTypeSession, aAsyncConstruction )
|
|
1659 |
{
|
|
1660 |
}
|
|
1661 |
|
|
1662 |
|
|
1663 |
CMemSpyThreadInfoSession::~CMemSpyThreadInfoSession()
|
|
1664 |
{
|
|
1665 |
iServerNames.ResetAndDestroy();
|
|
1666 |
iServerNames.Close();
|
|
1667 |
}
|
|
1668 |
|
|
1669 |
|
|
1670 |
CMemSpyThreadInfoSession* CMemSpyThreadInfoSession::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1671 |
{
|
|
1672 |
CMemSpyThreadInfoSession* self = new(ELeave) CMemSpyThreadInfoSession( aContainer, aAsyncConstruction );
|
|
1673 |
CleanupStack::PushL( self );
|
|
1674 |
if ( !aAsyncConstruction )
|
|
1675 |
{
|
|
1676 |
self->ConstructL();
|
|
1677 |
}
|
|
1678 |
return self;
|
|
1679 |
}
|
|
1680 |
|
|
1681 |
|
|
1682 |
EXPORT_C TPtrC CMemSpyThreadInfoSession::Name() const
|
|
1683 |
{
|
|
1684 |
_LIT(KName, "\tClient <-> Server\nConnections");
|
|
1685 |
return TPtrC( KName );
|
|
1686 |
}
|
|
1687 |
|
|
1688 |
|
|
1689 |
void CMemSpyThreadInfoSession::Reset()
|
|
1690 |
{
|
|
1691 |
CMemSpyThreadInfoHandleByContainer::Reset();
|
|
1692 |
iServerNames.ResetAndDestroy();
|
|
1693 |
}
|
|
1694 |
|
|
1695 |
|
|
1696 |
EXPORT_C TInt CMemSpyThreadInfoSession::ConnectionCount( const TDesC& aName ) const
|
|
1697 |
{
|
|
1698 |
TInt ret = 0;
|
|
1699 |
|
|
1700 |
#ifdef _DEBUG
|
|
1701 |
RDebug::Print( _L("CMemSpyThreadInfoSession::ConnectionCount() - START - aName: %S"), &aName );
|
|
1702 |
#endif
|
|
1703 |
|
|
1704 |
// See if we have an entry with that name...
|
|
1705 |
TInt foundIndex = 0;
|
|
1706 |
TRAP(ret, foundIndex = FindServerL(aName));
|
|
1707 |
|
|
1708 |
if (ret == KErrNone)
|
|
1709 |
{
|
|
1710 |
// If we did, get the count
|
|
1711 |
if ( foundIndex >=0 && foundIndex < iServerNames.Count() )
|
|
1712 |
{
|
|
1713 |
ret = iServerNames[ foundIndex ]->iCount;
|
|
1714 |
}
|
|
1715 |
}
|
|
1716 |
|
|
1717 |
#ifdef _DEBUG
|
|
1718 |
RDebug::Printf( "CMemSpyThreadInfoSession::ConnectionCount() - END - ret: %d", ret );
|
|
1719 |
#endif
|
|
1720 |
//
|
|
1721 |
return ret;
|
|
1722 |
}
|
|
1723 |
|
|
1724 |
TInt CMemSpyThreadInfoSession::FindServerL( const TDesC& aName ) const
|
|
1725 |
{
|
|
1726 |
TIdentityRelation<CSessionInfoEntry> comparer( CompareEntries );
|
|
1727 |
HBufC* name = aName.AllocLC();
|
|
1728 |
CSessionInfoEntry* entry = new(ELeave) CSessionInfoEntry( name );
|
|
1729 |
CleanupStack::Pop( name ); // don't destroy it as name is now owned by entry
|
|
1730 |
CleanupStack::PushL( entry );
|
|
1731 |
const TInt foundIndex = iServerNames.Find( entry, comparer );
|
|
1732 |
User::LeaveIfError(foundIndex); // so we only return a real index
|
|
1733 |
CleanupStack::PopAndDestroy( entry );
|
|
1734 |
return foundIndex;
|
|
1735 |
}
|
|
1736 |
|
|
1737 |
void CMemSpyThreadInfoSession::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& aItem, TInt /*aRefCount*/, TDes& aFullName )
|
|
1738 |
{
|
|
1739 |
// Check whether we have the item already
|
|
1740 |
TIdentityRelation<CSessionInfoEntry> comparer( CompareEntries );
|
|
1741 |
|
|
1742 |
// Prepare object, just in case we don't find it...
|
|
1743 |
HBufC* name = aFullName.AllocLC();
|
|
1744 |
|
|
1745 |
#ifdef _DEBUG
|
|
1746 |
TBuf<KMaxName> origName; origName.Copy( aItem.iName );
|
|
1747 |
RDebug::Print( _L("CMemSpyThreadInfoSession::HandleContainerItemL() - START - handle: 0x%08x, type: %d, origName: %S, modName: %S"), aItem.iHandle, aItem.iType, &origName, name );
|
|
1748 |
#else
|
|
1749 |
(void) aItem;
|
|
1750 |
#endif
|
|
1751 |
|
|
1752 |
CSessionInfoEntry* entry = new(ELeave) CSessionInfoEntry( name );
|
|
1753 |
CleanupStack::Pop( name );
|
|
1754 |
CleanupStack::PushL( entry );
|
|
1755 |
|
|
1756 |
// Search
|
|
1757 |
const TInt foundIndex = iServerNames.Find( entry, comparer );
|
|
1758 |
if ( foundIndex == KErrNotFound )
|
|
1759 |
{
|
|
1760 |
// Make new entry
|
|
1761 |
iServerNames.AppendL( entry );
|
|
1762 |
CleanupStack::Pop( entry );
|
|
1763 |
}
|
|
1764 |
else if ( foundIndex >= 0 )
|
|
1765 |
{
|
|
1766 |
// Existing entry, increment count
|
|
1767 |
CleanupStack::PopAndDestroy( entry );
|
|
1768 |
entry = iServerNames[ foundIndex ];
|
|
1769 |
++entry->iCount;
|
|
1770 |
}
|
|
1771 |
else
|
|
1772 |
{
|
|
1773 |
CleanupStack::PopAndDestroy( entry );
|
|
1774 |
}
|
|
1775 |
|
|
1776 |
#ifdef _DEBUG
|
|
1777 |
RDebug::Printf( "CMemSpyThreadInfoSession::HandleContainerItemL() - END - foundIndex: %d", foundIndex );
|
|
1778 |
#endif
|
|
1779 |
}
|
|
1780 |
|
|
1781 |
|
|
1782 |
void CMemSpyThreadInfoSession::HandleAllItemsLocatedL()
|
|
1783 |
{
|
|
1784 |
_LIT(KSecondLineFormatStringCount1, "1 connection");
|
|
1785 |
_LIT(KSecondLineFormatStringCountMoreThanOne, "%d connections");
|
|
1786 |
TBuf<50> buf;
|
|
1787 |
|
|
1788 |
// All items have been found, now create listbox entries
|
|
1789 |
const TInt count = iServerNames.Count();
|
|
1790 |
for( TInt i=0; i<count; i++ )
|
|
1791 |
{
|
|
1792 |
CSessionInfoEntry* entry = iServerNames[ i ];
|
|
1793 |
|
|
1794 |
if ( entry->iCount == 1 )
|
|
1795 |
{
|
|
1796 |
buf.Copy( KSecondLineFormatStringCount1 );
|
|
1797 |
}
|
|
1798 |
else
|
|
1799 |
{
|
|
1800 |
buf.Format( KSecondLineFormatStringCountMoreThanOne, entry->iCount );
|
|
1801 |
}
|
|
1802 |
|
|
1803 |
AddItemL( *entry->iName, buf );
|
|
1804 |
}
|
|
1805 |
}
|
|
1806 |
|
|
1807 |
|
|
1808 |
TBool CMemSpyThreadInfoSession::CompareEntries( const CSessionInfoEntry& aLeft, const CSessionInfoEntry& aRight )
|
|
1809 |
{
|
|
1810 |
return ( aLeft.iName->CompareF( *aRight.iName ) == 0 );
|
|
1811 |
}
|
|
1812 |
|
|
1813 |
|
|
1814 |
|
|
1815 |
|
|
1816 |
|
|
1817 |
|
|
1818 |
|
|
1819 |
|
|
1820 |
|
|
1821 |
|
|
1822 |
|
|
1823 |
|
|
1824 |
|
|
1825 |
|
|
1826 |
|
|
1827 |
|
|
1828 |
|
|
1829 |
|
|
1830 |
|
|
1831 |
|
|
1832 |
|
|
1833 |
|
|
1834 |
|
|
1835 |
|
|
1836 |
|
|
1837 |
|
|
1838 |
CMemSpyThreadInfoSemaphore::CMemSpyThreadInfoSemaphore( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1839 |
: CMemSpyThreadInfoHandleByContainer( aContainer, EMemSpyThreadInfoItemTypeSemaphore, EMemSpyDriverContainerTypeSemaphore, aAsyncConstruction )
|
|
1840 |
{
|
|
1841 |
}
|
|
1842 |
|
|
1843 |
|
|
1844 |
CMemSpyThreadInfoSemaphore* CMemSpyThreadInfoSemaphore::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1845 |
{
|
|
1846 |
CMemSpyThreadInfoSemaphore* self = new(ELeave) CMemSpyThreadInfoSemaphore( aContainer, aAsyncConstruction );
|
|
1847 |
CleanupStack::PushL( self );
|
|
1848 |
if ( !aAsyncConstruction )
|
|
1849 |
{
|
|
1850 |
self->ConstructL();
|
|
1851 |
}
|
|
1852 |
return self;
|
|
1853 |
}
|
|
1854 |
|
|
1855 |
|
|
1856 |
EXPORT_C TPtrC CMemSpyThreadInfoSemaphore::Name() const
|
|
1857 |
{
|
|
1858 |
_LIT(KName, "\tSemaphores");
|
|
1859 |
return TPtrC( KName );
|
|
1860 |
}
|
|
1861 |
|
|
1862 |
|
|
1863 |
void CMemSpyThreadInfoSemaphore::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& aItem, TInt /*aRefCount*/, TDes& aFullName )
|
|
1864 |
{
|
|
1865 |
_LIT( KFormatSpec, "Count: %d" );
|
|
1866 |
TBuf<50> buf;
|
|
1867 |
buf.AppendFormat( KFormatSpec, aItem.iCount );
|
|
1868 |
|
|
1869 |
AddItemL( aFullName, buf );
|
|
1870 |
}
|
|
1871 |
|
|
1872 |
|
|
1873 |
|
|
1874 |
|
|
1875 |
|
|
1876 |
|
|
1877 |
|
|
1878 |
|
|
1879 |
|
|
1880 |
|
|
1881 |
|
|
1882 |
|
|
1883 |
|
|
1884 |
|
|
1885 |
|
|
1886 |
|
|
1887 |
|
|
1888 |
|
|
1889 |
|
|
1890 |
|
|
1891 |
|
|
1892 |
|
|
1893 |
|
|
1894 |
|
|
1895 |
CMemSpyThreadInfoMutex::CMemSpyThreadInfoMutex( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1896 |
: CMemSpyThreadInfoHandleByContainer( aContainer, EMemSpyThreadInfoItemTypeMutex, EMemSpyDriverContainerTypeMutex, aAsyncConstruction )
|
|
1897 |
{
|
|
1898 |
}
|
|
1899 |
|
|
1900 |
|
|
1901 |
CMemSpyThreadInfoMutex* CMemSpyThreadInfoMutex::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1902 |
{
|
|
1903 |
CMemSpyThreadInfoMutex* self = new(ELeave) CMemSpyThreadInfoMutex( aContainer, aAsyncConstruction );
|
|
1904 |
CleanupStack::PushL( self );
|
|
1905 |
if ( !aAsyncConstruction )
|
|
1906 |
{
|
|
1907 |
self->ConstructL();
|
|
1908 |
}
|
|
1909 |
return self;
|
|
1910 |
}
|
|
1911 |
|
|
1912 |
|
|
1913 |
EXPORT_C TPtrC CMemSpyThreadInfoMutex::Name() const
|
|
1914 |
{
|
|
1915 |
_LIT(KName, "\tMutexes");
|
|
1916 |
return TPtrC( KName );
|
|
1917 |
}
|
|
1918 |
|
|
1919 |
|
|
1920 |
void CMemSpyThreadInfoMutex::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& aItem, TInt /*aRefCount*/, TDes& aFullName )
|
|
1921 |
{
|
|
1922 |
_LIT( KFormatSpec, "Count: %d" );
|
|
1923 |
TBuf<50> buf;
|
|
1924 |
buf.AppendFormat( KFormatSpec, aItem.iCount );
|
|
1925 |
|
|
1926 |
AddItemL( aFullName, buf );
|
|
1927 |
}
|
|
1928 |
|
|
1929 |
|
|
1930 |
|
|
1931 |
|
|
1932 |
|
|
1933 |
|
|
1934 |
|
|
1935 |
|
|
1936 |
|
|
1937 |
|
|
1938 |
|
|
1939 |
|
|
1940 |
|
|
1941 |
|
|
1942 |
|
|
1943 |
|
|
1944 |
|
|
1945 |
|
|
1946 |
|
|
1947 |
|
|
1948 |
|
|
1949 |
|
|
1950 |
|
|
1951 |
|
|
1952 |
CMemSpyThreadInfoTimer::CMemSpyThreadInfoTimer( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1953 |
: CMemSpyThreadInfoHandleByContainer( aContainer, EMemSpyThreadInfoItemTypeTimer, EMemSpyDriverContainerTypeTimer, aAsyncConstruction )
|
|
1954 |
{
|
|
1955 |
}
|
|
1956 |
|
|
1957 |
|
|
1958 |
CMemSpyThreadInfoTimer* CMemSpyThreadInfoTimer::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
1959 |
{
|
|
1960 |
CMemSpyThreadInfoTimer* self = new(ELeave) CMemSpyThreadInfoTimer( aContainer, aAsyncConstruction );
|
|
1961 |
CleanupStack::PushL( self );
|
|
1962 |
if ( !aAsyncConstruction )
|
|
1963 |
{
|
|
1964 |
self->ConstructL();
|
|
1965 |
}
|
|
1966 |
return self;
|
|
1967 |
}
|
|
1968 |
|
|
1969 |
|
|
1970 |
EXPORT_C TPtrC CMemSpyThreadInfoTimer::Name() const
|
|
1971 |
{
|
|
1972 |
_LIT(KName, "\tTimers");
|
|
1973 |
return TPtrC( KName );
|
|
1974 |
}
|
|
1975 |
|
|
1976 |
|
|
1977 |
void CMemSpyThreadInfoTimer::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& aItem, TInt /*aRefCount*/, TDes& /*aFullName*/ )
|
|
1978 |
{
|
|
1979 |
// Get useful strings
|
|
1980 |
TBuf<20> state;
|
|
1981 |
GetTimerState( aItem.iTimerState, state );
|
|
1982 |
TBuf<20> type;
|
|
1983 |
GetTimerType( aItem.iTimerType, type );
|
|
1984 |
|
|
1985 |
AddItemL( type, state );
|
|
1986 |
}
|
|
1987 |
|
|
1988 |
|
|
1989 |
void CMemSpyThreadInfoTimer::GetTimerState( TMemSpyDriverTimerState aState, TDes& aBuf )
|
|
1990 |
{
|
|
1991 |
switch( aState )
|
|
1992 |
{
|
|
1993 |
default:
|
|
1994 |
case EMemSpyDriverTimerStateUnknown:
|
|
1995 |
{
|
|
1996 |
_LIT(KStateUnknown, "Unknown");
|
|
1997 |
aBuf.Copy( KStateUnknown );
|
|
1998 |
}
|
|
1999 |
break;
|
|
2000 |
case EMemSpyDriverTimerStateIdle:
|
|
2001 |
{
|
|
2002 |
_LIT(KStateIdle, "Idle");
|
|
2003 |
aBuf.Copy( KStateIdle );
|
|
2004 |
}
|
|
2005 |
break;
|
|
2006 |
case EMemSpyDriverTimerStateWaiting:
|
|
2007 |
{
|
|
2008 |
_LIT(KStateWaiting, "Waiting");
|
|
2009 |
aBuf.Copy( KStateWaiting );
|
|
2010 |
}
|
|
2011 |
break;
|
|
2012 |
case EMemSpyDriverTimerStateWaitHighRes:
|
|
2013 |
{
|
|
2014 |
_LIT(KStateWaitHighRes, "Waiting, High Res.");
|
|
2015 |
aBuf.Copy( KStateWaitHighRes );
|
|
2016 |
}
|
|
2017 |
break;
|
|
2018 |
}
|
|
2019 |
}
|
|
2020 |
|
|
2021 |
|
|
2022 |
void CMemSpyThreadInfoTimer::GetTimerType( TMemSpyDriverTimerType aType, TDes& aBuf )
|
|
2023 |
{
|
|
2024 |
switch( aType )
|
|
2025 |
{
|
|
2026 |
case EMemSpyDriverTimerTypeRelative:
|
|
2027 |
{
|
|
2028 |
_LIT( KType, "Relative" );
|
|
2029 |
aBuf.Copy( KType );
|
|
2030 |
}
|
|
2031 |
break;
|
|
2032 |
case EMemSpyDriverTimerTypeAbsolute:
|
|
2033 |
{
|
|
2034 |
_LIT( KType, "Absolute" );
|
|
2035 |
aBuf.Copy( KType );
|
|
2036 |
}
|
|
2037 |
break;
|
|
2038 |
case EMemSpyDriverTimerTypeHighRes:
|
|
2039 |
{
|
|
2040 |
_LIT( KType, "High Res." );
|
|
2041 |
aBuf.Copy( KType );
|
|
2042 |
}
|
|
2043 |
break;
|
|
2044 |
case EMemSpyDriverTimerTypeInactivity:
|
|
2045 |
{
|
|
2046 |
_LIT( KType, "Inactivity" );
|
|
2047 |
aBuf.Copy( KType );
|
|
2048 |
}
|
|
2049 |
break;
|
|
2050 |
default:
|
|
2051 |
{
|
|
2052 |
_LIT( KType, "Unknown" );
|
|
2053 |
aBuf.Copy( KType );
|
|
2054 |
}
|
|
2055 |
break;
|
|
2056 |
}
|
|
2057 |
}
|
|
2058 |
|
|
2059 |
|
|
2060 |
|
|
2061 |
|
|
2062 |
|
|
2063 |
|
|
2064 |
|
|
2065 |
|
|
2066 |
|
|
2067 |
|
|
2068 |
|
|
2069 |
|
|
2070 |
|
|
2071 |
|
|
2072 |
|
|
2073 |
|
|
2074 |
|
|
2075 |
|
|
2076 |
|
|
2077 |
CMemSpyThreadInfoLDD::CMemSpyThreadInfoLDD( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2078 |
: CMemSpyThreadInfoHandleByContainer( aContainer, EMemSpyThreadInfoItemTypeLDD, EMemSpyDriverContainerTypeLogicalDevice, aAsyncConstruction )
|
|
2079 |
{
|
|
2080 |
}
|
|
2081 |
|
|
2082 |
|
|
2083 |
CMemSpyThreadInfoLDD* CMemSpyThreadInfoLDD::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2084 |
{
|
|
2085 |
CMemSpyThreadInfoLDD* self = new(ELeave) CMemSpyThreadInfoLDD( aContainer, aAsyncConstruction );
|
|
2086 |
CleanupStack::PushL( self );
|
|
2087 |
if ( !aAsyncConstruction )
|
|
2088 |
{
|
|
2089 |
self->ConstructL();
|
|
2090 |
}
|
|
2091 |
return self;
|
|
2092 |
}
|
|
2093 |
|
|
2094 |
|
|
2095 |
EXPORT_C TPtrC CMemSpyThreadInfoLDD::Name() const
|
|
2096 |
{
|
|
2097 |
_LIT(KName, "\tLogical Device Drivers");
|
|
2098 |
return TPtrC( KName );
|
|
2099 |
}
|
|
2100 |
|
|
2101 |
|
|
2102 |
void CMemSpyThreadInfoLDD::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& aItem, TInt /*aRefCount*/, TDes& aFullName )
|
|
2103 |
{
|
|
2104 |
_LIT( KFormatSpec, "Open channels: %d" );
|
|
2105 |
TBuf<50> buf;
|
|
2106 |
buf.AppendFormat( KFormatSpec, aItem.iOpenChannels );
|
|
2107 |
|
|
2108 |
AddItemL( aFullName, buf );
|
|
2109 |
}
|
|
2110 |
|
|
2111 |
|
|
2112 |
|
|
2113 |
|
|
2114 |
|
|
2115 |
|
|
2116 |
|
|
2117 |
|
|
2118 |
|
|
2119 |
|
|
2120 |
|
|
2121 |
|
|
2122 |
|
|
2123 |
|
|
2124 |
|
|
2125 |
|
|
2126 |
|
|
2127 |
|
|
2128 |
|
|
2129 |
|
|
2130 |
|
|
2131 |
|
|
2132 |
|
|
2133 |
|
|
2134 |
|
|
2135 |
CMemSpyThreadInfoPDD::CMemSpyThreadInfoPDD( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2136 |
: CMemSpyThreadInfoHandleByContainer( aContainer, EMemSpyThreadInfoItemTypePDD, EMemSpyDriverContainerTypePhysicalDevice, aAsyncConstruction )
|
|
2137 |
{
|
|
2138 |
}
|
|
2139 |
|
|
2140 |
|
|
2141 |
CMemSpyThreadInfoPDD* CMemSpyThreadInfoPDD::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2142 |
{
|
|
2143 |
CMemSpyThreadInfoPDD* self = new(ELeave) CMemSpyThreadInfoPDD( aContainer, aAsyncConstruction );
|
|
2144 |
CleanupStack::PushL( self );
|
|
2145 |
if ( !aAsyncConstruction )
|
|
2146 |
{
|
|
2147 |
self->ConstructL();
|
|
2148 |
}
|
|
2149 |
return self;
|
|
2150 |
}
|
|
2151 |
|
|
2152 |
|
|
2153 |
EXPORT_C TPtrC CMemSpyThreadInfoPDD::Name() const
|
|
2154 |
{
|
|
2155 |
_LIT(KName, "\tPhysical Device Drivers");
|
|
2156 |
return TPtrC( KName );
|
|
2157 |
}
|
|
2158 |
|
|
2159 |
|
|
2160 |
void CMemSpyThreadInfoPDD::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& /*aItem*/, TInt /*aRefCount*/, TDes& aFullName )
|
|
2161 |
{
|
|
2162 |
AddItemL( aFullName, KNullDesC );
|
|
2163 |
}
|
|
2164 |
|
|
2165 |
|
|
2166 |
|
|
2167 |
|
|
2168 |
|
|
2169 |
|
|
2170 |
|
|
2171 |
|
|
2172 |
|
|
2173 |
|
|
2174 |
|
|
2175 |
|
|
2176 |
|
|
2177 |
|
|
2178 |
|
|
2179 |
|
|
2180 |
|
|
2181 |
|
|
2182 |
|
|
2183 |
|
|
2184 |
|
|
2185 |
|
|
2186 |
CMemSpyThreadInfoLogicalChannel::CMemSpyThreadInfoLogicalChannel( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2187 |
: CMemSpyThreadInfoHandleByContainer( aContainer, EMemSpyThreadInfoItemTypeLogicalChannel, EMemSpyDriverContainerTypeLogicalChannel, aAsyncConstruction )
|
|
2188 |
{
|
|
2189 |
}
|
|
2190 |
|
|
2191 |
|
|
2192 |
CMemSpyThreadInfoLogicalChannel* CMemSpyThreadInfoLogicalChannel::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2193 |
{
|
|
2194 |
CMemSpyThreadInfoLogicalChannel* self = new(ELeave) CMemSpyThreadInfoLogicalChannel( aContainer, aAsyncConstruction );
|
|
2195 |
CleanupStack::PushL( self );
|
|
2196 |
if ( !aAsyncConstruction )
|
|
2197 |
{
|
|
2198 |
self->ConstructL();
|
|
2199 |
}
|
|
2200 |
return self;
|
|
2201 |
}
|
|
2202 |
|
|
2203 |
|
|
2204 |
EXPORT_C TPtrC CMemSpyThreadInfoLogicalChannel::Name() const
|
|
2205 |
{
|
|
2206 |
_LIT(KName, "\tLogical DD Channels");
|
|
2207 |
return TPtrC( KName );
|
|
2208 |
}
|
|
2209 |
|
|
2210 |
|
|
2211 |
void CMemSpyThreadInfoLogicalChannel::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& /*aItem*/, TInt /*aRefCount*/, TDes& aFullName )
|
|
2212 |
{
|
|
2213 |
AddItemL( aFullName, KNullDesC );
|
|
2214 |
}
|
|
2215 |
|
|
2216 |
|
|
2217 |
|
|
2218 |
|
|
2219 |
|
|
2220 |
|
|
2221 |
|
|
2222 |
|
|
2223 |
|
|
2224 |
|
|
2225 |
|
|
2226 |
|
|
2227 |
|
|
2228 |
|
|
2229 |
|
|
2230 |
|
|
2231 |
|
|
2232 |
|
|
2233 |
|
|
2234 |
|
|
2235 |
|
|
2236 |
CMemSpyThreadInfoChangeNotifier::CMemSpyThreadInfoChangeNotifier( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2237 |
: CMemSpyThreadInfoHandleByContainer( aContainer, EMemSpyThreadInfoItemTypeChangeNotifier, EMemSpyDriverContainerTypeChangeNotifier, aAsyncConstruction )
|
|
2238 |
{
|
|
2239 |
}
|
|
2240 |
|
|
2241 |
|
|
2242 |
CMemSpyThreadInfoChangeNotifier* CMemSpyThreadInfoChangeNotifier::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2243 |
{
|
|
2244 |
CMemSpyThreadInfoChangeNotifier* self = new(ELeave) CMemSpyThreadInfoChangeNotifier( aContainer, aAsyncConstruction );
|
|
2245 |
CleanupStack::PushL( self );
|
|
2246 |
if ( !aAsyncConstruction )
|
|
2247 |
{
|
|
2248 |
self->ConstructL();
|
|
2249 |
}
|
|
2250 |
return self;
|
|
2251 |
}
|
|
2252 |
|
|
2253 |
|
|
2254 |
EXPORT_C TPtrC CMemSpyThreadInfoChangeNotifier::Name() const
|
|
2255 |
{
|
|
2256 |
_LIT(KName, "\tChange Notifiers");
|
|
2257 |
return TPtrC( KName );
|
|
2258 |
}
|
|
2259 |
|
|
2260 |
|
|
2261 |
void CMemSpyThreadInfoChangeNotifier::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& /*aItem*/, TInt /*aRefCount*/, TDes& aFullName )
|
|
2262 |
{
|
|
2263 |
AddItemL( aFullName, KNullDesC );
|
|
2264 |
}
|
|
2265 |
|
|
2266 |
|
|
2267 |
|
|
2268 |
|
|
2269 |
|
|
2270 |
|
|
2271 |
|
|
2272 |
|
|
2273 |
|
|
2274 |
|
|
2275 |
|
|
2276 |
|
|
2277 |
|
|
2278 |
|
|
2279 |
|
|
2280 |
|
|
2281 |
|
|
2282 |
|
|
2283 |
|
|
2284 |
|
|
2285 |
|
|
2286 |
CMemSpyThreadInfoUndertaker::CMemSpyThreadInfoUndertaker( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2287 |
: CMemSpyThreadInfoHandleByContainer( aContainer, EMemSpyThreadInfoItemTypeUndertaker, EMemSpyDriverContainerTypeUndertaker, aAsyncConstruction )
|
|
2288 |
{
|
|
2289 |
}
|
|
2290 |
|
|
2291 |
|
|
2292 |
CMemSpyThreadInfoUndertaker* CMemSpyThreadInfoUndertaker::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2293 |
{
|
|
2294 |
CMemSpyThreadInfoUndertaker* self = new(ELeave) CMemSpyThreadInfoUndertaker( aContainer, aAsyncConstruction );
|
|
2295 |
CleanupStack::PushL( self );
|
|
2296 |
if ( !aAsyncConstruction )
|
|
2297 |
{
|
|
2298 |
self->ConstructL();
|
|
2299 |
}
|
|
2300 |
return self;
|
|
2301 |
}
|
|
2302 |
|
|
2303 |
|
|
2304 |
EXPORT_C TPtrC CMemSpyThreadInfoUndertaker::Name() const
|
|
2305 |
{
|
|
2306 |
_LIT(KName, "\tUndertakers");
|
|
2307 |
return TPtrC( KName );
|
|
2308 |
}
|
|
2309 |
|
|
2310 |
|
|
2311 |
void CMemSpyThreadInfoUndertaker::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& /*aItem*/, TInt /*aRefCount*/, TDes& aFullName )
|
|
2312 |
{
|
|
2313 |
AddItemL( aFullName, KNullDesC );
|
|
2314 |
}
|
|
2315 |
|
|
2316 |
|
|
2317 |
|
|
2318 |
|
|
2319 |
|
|
2320 |
|
|
2321 |
|
|
2322 |
|
|
2323 |
|
|
2324 |
|
|
2325 |
|
|
2326 |
|
|
2327 |
|
|
2328 |
|
|
2329 |
|
|
2330 |
|
|
2331 |
|
|
2332 |
CMemSpyThreadInfoOwnedThreadHandles::CMemSpyThreadInfoOwnedThreadHandles( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2333 |
: CMemSpyThreadInfoHandleByContainer( aContainer, EMemSpyThreadInfoItemTypeOwnedThreadHandles, EMemSpyDriverContainerTypeThread, aAsyncConstruction )
|
|
2334 |
{
|
|
2335 |
}
|
|
2336 |
|
|
2337 |
|
|
2338 |
CMemSpyThreadInfoOwnedThreadHandles* CMemSpyThreadInfoOwnedThreadHandles::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2339 |
{
|
|
2340 |
CMemSpyThreadInfoOwnedThreadHandles* self = new(ELeave) CMemSpyThreadInfoOwnedThreadHandles( aContainer, aAsyncConstruction );
|
|
2341 |
CleanupStack::PushL( self );
|
|
2342 |
if ( !aAsyncConstruction )
|
|
2343 |
{
|
|
2344 |
self->ConstructL();
|
|
2345 |
}
|
|
2346 |
return self;
|
|
2347 |
}
|
|
2348 |
|
|
2349 |
|
|
2350 |
EXPORT_C TPtrC CMemSpyThreadInfoOwnedThreadHandles::Name() const
|
|
2351 |
{
|
|
2352 |
_LIT(KName, "\tHandles to other\nThreads");
|
|
2353 |
return TPtrC( KName );
|
|
2354 |
}
|
|
2355 |
|
|
2356 |
|
|
2357 |
void CMemSpyThreadInfoOwnedThreadHandles::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& aItem, TInt aRefCount, TDes& aFullName )
|
|
2358 |
{
|
|
2359 |
const TInt bracketPosStart = aFullName.LocateF( TChar('[') );
|
|
2360 |
const TInt doubleColonPos = aFullName.FindF( _L("::" ) );
|
|
2361 |
//
|
|
2362 |
if ( bracketPosStart >= 0 && doubleColonPos > bracketPosStart && doubleColonPos < aFullName.Length() - 2 )
|
|
2363 |
{
|
|
2364 |
// Process
|
|
2365 |
TPtrC pProcessName( aFullName.Left( bracketPosStart ) );
|
|
2366 |
HBufC* caption = HBufC::NewLC( KMaxName + 10 );
|
|
2367 |
TPtr pCaption( caption->Des() );
|
|
2368 |
pCaption.AppendFormat( _L("[%2d] %S"), aRefCount, &pProcessName );
|
|
2369 |
|
|
2370 |
// Thread id & thread name
|
|
2371 |
TPtrC pThreadName( aFullName.Mid( doubleColonPos + 2 ) );
|
|
2372 |
HBufC* value = HBufC::NewLC( KMaxName + 10 );
|
|
2373 |
TPtr pValue( value->Des() );
|
|
2374 |
pValue.AppendFormat( _L("[%3d] %S"), aItem.iId, &pThreadName );
|
|
2375 |
|
|
2376 |
// Add it & tidy up
|
|
2377 |
AddItemL( pCaption, pValue );
|
|
2378 |
CleanupStack::PopAndDestroy( 2, caption );
|
|
2379 |
}
|
|
2380 |
else
|
|
2381 |
{
|
|
2382 |
AddItemL( aFullName, KNullDesC );
|
|
2383 |
}
|
|
2384 |
}
|
|
2385 |
|
|
2386 |
|
|
2387 |
|
|
2388 |
|
|
2389 |
|
|
2390 |
|
|
2391 |
|
|
2392 |
|
|
2393 |
|
|
2394 |
CMemSpyThreadInfoOwnedProcessHandles::CMemSpyThreadInfoOwnedProcessHandles( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2395 |
: CMemSpyThreadInfoHandleByContainer( aContainer, EMemSpyThreadInfoItemTypeOwnedProcessHandles, EMemSpyDriverContainerTypeProcess, aAsyncConstruction )
|
|
2396 |
{
|
|
2397 |
}
|
|
2398 |
|
|
2399 |
|
|
2400 |
CMemSpyThreadInfoOwnedProcessHandles* CMemSpyThreadInfoOwnedProcessHandles::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2401 |
{
|
|
2402 |
CMemSpyThreadInfoOwnedProcessHandles* self = new(ELeave) CMemSpyThreadInfoOwnedProcessHandles( aContainer, aAsyncConstruction );
|
|
2403 |
CleanupStack::PushL( self );
|
|
2404 |
if ( !aAsyncConstruction )
|
|
2405 |
{
|
|
2406 |
self->ConstructL();
|
|
2407 |
}
|
|
2408 |
return self;
|
|
2409 |
}
|
|
2410 |
|
|
2411 |
|
|
2412 |
EXPORT_C TPtrC CMemSpyThreadInfoOwnedProcessHandles::Name() const
|
|
2413 |
{
|
|
2414 |
_LIT(KName, "\tHandles to other\nProcesses");
|
|
2415 |
return TPtrC( KName );
|
|
2416 |
}
|
|
2417 |
|
|
2418 |
|
|
2419 |
void CMemSpyThreadInfoOwnedProcessHandles::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& aItem, TInt aRefCount, TDes& aFullName )
|
|
2420 |
{
|
|
2421 |
const TInt bracketPosStart = aFullName.LocateF( TChar('[') );
|
|
2422 |
const TInt doubleColonPos = aFullName.FindF( _L("::" ) );
|
|
2423 |
//
|
|
2424 |
if ( bracketPosStart >= 0 && doubleColonPos > bracketPosStart && doubleColonPos < aFullName.Length() - 2 )
|
|
2425 |
{
|
|
2426 |
// Process
|
|
2427 |
TPtrC pProcessName( aFullName.Left( bracketPosStart ) );
|
|
2428 |
HBufC* caption = HBufC::NewLC( KMaxName + 10 );
|
|
2429 |
TPtr pCaption( caption->Des() );
|
|
2430 |
pCaption.AppendFormat( _L("[%2d] %S"), aRefCount, &pProcessName );
|
|
2431 |
|
|
2432 |
// Thread id & thread name
|
|
2433 |
TPtrC pThreadName( aFullName.Mid( doubleColonPos + 2 ) );
|
|
2434 |
HBufC* value = HBufC::NewLC( KMaxName + 10 );
|
|
2435 |
TPtr pValue( value->Des() );
|
|
2436 |
pValue.AppendFormat( _L("[%3d] %S"), aItem.iId, &pThreadName );
|
|
2437 |
|
|
2438 |
// Add it & tidy up
|
|
2439 |
AddItemL( pCaption, pValue );
|
|
2440 |
CleanupStack::PopAndDestroy( 2, caption );
|
|
2441 |
}
|
|
2442 |
else
|
|
2443 |
{
|
|
2444 |
AddItemL( aFullName, KNullDesC );
|
|
2445 |
}
|
|
2446 |
}
|
|
2447 |
|
|
2448 |
|
|
2449 |
|
|
2450 |
|
|
2451 |
|
|
2452 |
|
|
2453 |
|
|
2454 |
|
|
2455 |
|
|
2456 |
|
|
2457 |
|
|
2458 |
|
|
2459 |
|
|
2460 |
|
|
2461 |
|
|
2462 |
|
|
2463 |
|
|
2464 |
|
|
2465 |
|
|
2466 |
|
|
2467 |
|
|
2468 |
|
|
2469 |
|
|
2470 |
|
|
2471 |
|
|
2472 |
|
|
2473 |
|
|
2474 |
|
|
2475 |
|
|
2476 |
|
|
2477 |
|
|
2478 |
|
|
2479 |
|
|
2480 |
|
|
2481 |
|
|
2482 |
|
|
2483 |
|
|
2484 |
|
|
2485 |
|
|
2486 |
|
|
2487 |
CMemSpyThreadInfoReferencedBy::CMemSpyThreadInfoReferencedBy( CMemSpyThreadInfoContainer& aContainer, TMemSpyThreadInfoItemType aItemType, TMemSpyDriverContainerType aContainerType, TBool aAsyncConstruction )
|
|
2488 |
: CMemSpyThreadInfoHandleObjectBase( aContainer, aItemType, aContainerType, aAsyncConstruction )
|
|
2489 |
{
|
|
2490 |
}
|
|
2491 |
|
|
2492 |
|
|
2493 |
void CMemSpyThreadInfoReferencedBy::GetHandlesL( RArray<THandleWrapper>& aArray )
|
|
2494 |
{
|
|
2495 |
aArray.Reset();
|
|
2496 |
//
|
|
2497 |
TInt r = KErrNone;
|
|
2498 |
//
|
|
2499 |
CMemSpyProcess& process = Container().Thread().Process();
|
|
2500 |
CMemSpyEngine& engine = process.Engine();
|
|
2501 |
TIdentityRelation<CMemSpyThreadInfoHandleObjectBase::THandleWrapper> finder( THandleWrapper::Match );
|
|
2502 |
|
|
2503 |
// We need to either search through:
|
|
2504 |
//
|
|
2505 |
// a) all thread & process handles looking for *this thread*, or
|
|
2506 |
// b) all thread & process handles looking for *this process*
|
|
2507 |
//
|
|
2508 |
// We abuse the "container type" as a means of deciding whether it is
|
|
2509 |
// the thread or the process we are looking for.
|
|
2510 |
//
|
|
2511 |
RMemSpyDriverClient& driver = engine.Driver();
|
|
2512 |
if ( ContainerType() == EMemSpyDriverContainerTypeProcess )
|
|
2513 |
{
|
|
2514 |
const TUint id = Container().Thread().Process().Id();
|
|
2515 |
r = driver.GetReferencesToMyProcess( id );
|
|
2516 |
}
|
|
2517 |
else if ( ContainerType() == EMemSpyDriverContainerTypeThread )
|
|
2518 |
{
|
|
2519 |
const TUint id = Container().Thread().Id();
|
|
2520 |
r = driver.GetReferencesToMyThread( id );
|
|
2521 |
}
|
|
2522 |
else
|
|
2523 |
{
|
|
2524 |
ASSERT( EFalse );
|
|
2525 |
}
|
|
2526 |
User::LeaveIfError( r );
|
|
2527 |
|
|
2528 |
RMemSpyMemStreamReader stream = driver.StreamOpenL();
|
|
2529 |
CleanupClosePushL( stream );
|
|
2530 |
|
|
2531 |
// Extract thread matches
|
|
2532 |
const TInt threadCount = stream.ReadInt32L();
|
|
2533 |
for( TInt i=0; i<threadCount; i++ )
|
|
2534 |
{
|
|
2535 |
TAny* handle = (TAny*) stream.ReadUint32L();
|
|
2536 |
|
|
2537 |
// Create temporary entry that we'll use as the key in our array...
|
|
2538 |
CMemSpyThreadInfoHandleObjectBase::THandleWrapper entry( handle, EMemSpyDriverContainerTypeThread );
|
|
2539 |
|
|
2540 |
// Find existing duplicate entry (if there is one...)
|
|
2541 |
const TInt errorOrIndex = aArray.Find( entry, finder );
|
|
2542 |
|
|
2543 |
if ( errorOrIndex == KErrNotFound )
|
|
2544 |
{
|
|
2545 |
// Not a duplicate handle, so keep it
|
|
2546 |
aArray.AppendL( entry );
|
|
2547 |
}
|
|
2548 |
else if ( errorOrIndex >= 0 )
|
|
2549 |
{
|
|
2550 |
// Increment reference count for duplicates...
|
|
2551 |
CMemSpyThreadInfoHandleObjectBase::THandleWrapper& existingEntry = aArray[ errorOrIndex ];
|
|
2552 |
++existingEntry.iRefCount;
|
|
2553 |
}
|
|
2554 |
}
|
|
2555 |
|
|
2556 |
// Extract process matches
|
|
2557 |
const TInt processCount = stream.ReadInt32L();
|
|
2558 |
for( TInt i=0; i<processCount; i++ )
|
|
2559 |
{
|
|
2560 |
TAny* handle = (TAny*) stream.ReadUint32L();
|
|
2561 |
|
|
2562 |
// Create temporary entry that we'll use as the key in our array...
|
|
2563 |
CMemSpyThreadInfoHandleObjectBase::THandleWrapper entry( handle, EMemSpyDriverContainerTypeProcess );
|
|
2564 |
|
|
2565 |
// Find existing duplicate entry (if there is one...)
|
|
2566 |
const TInt errorOrIndex = aArray.Find( entry, finder );
|
|
2567 |
|
|
2568 |
if ( errorOrIndex == KErrNotFound )
|
|
2569 |
{
|
|
2570 |
// Not a duplicate handle, so keep it
|
|
2571 |
aArray.AppendL( entry );
|
|
2572 |
}
|
|
2573 |
else if ( errorOrIndex >= 0 )
|
|
2574 |
{
|
|
2575 |
// Increment reference count for duplicates...
|
|
2576 |
CMemSpyThreadInfoHandleObjectBase::THandleWrapper& existingEntry = aArray[ errorOrIndex ];
|
|
2577 |
++existingEntry.iRefCount;
|
|
2578 |
}
|
|
2579 |
}
|
|
2580 |
|
|
2581 |
// Tidy up
|
|
2582 |
CleanupStack::PopAndDestroy( &stream );
|
|
2583 |
}
|
|
2584 |
|
|
2585 |
|
|
2586 |
|
|
2587 |
|
|
2588 |
|
|
2589 |
|
|
2590 |
|
|
2591 |
|
|
2592 |
|
|
2593 |
|
|
2594 |
|
|
2595 |
|
|
2596 |
|
|
2597 |
|
|
2598 |
|
|
2599 |
|
|
2600 |
|
|
2601 |
|
|
2602 |
|
|
2603 |
|
|
2604 |
CMemSpyThreadInfoOtherThreads::CMemSpyThreadInfoOtherThreads( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2605 |
: CMemSpyThreadInfoReferencedBy( aContainer, EMemSpyThreadInfoItemTypeOtherThreads, EMemSpyDriverContainerTypeThread, aAsyncConstruction )
|
|
2606 |
{
|
|
2607 |
}
|
|
2608 |
|
|
2609 |
|
|
2610 |
CMemSpyThreadInfoOtherThreads* CMemSpyThreadInfoOtherThreads::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2611 |
{
|
|
2612 |
CMemSpyThreadInfoOtherThreads* self = new(ELeave) CMemSpyThreadInfoOtherThreads( aContainer, aAsyncConstruction );
|
|
2613 |
CleanupStack::PushL( self );
|
|
2614 |
if ( !aAsyncConstruction )
|
|
2615 |
{
|
|
2616 |
self->ConstructL();
|
|
2617 |
}
|
|
2618 |
return self;
|
|
2619 |
}
|
|
2620 |
|
|
2621 |
|
|
2622 |
EXPORT_C TPtrC CMemSpyThreadInfoOtherThreads::Name() const
|
|
2623 |
{
|
|
2624 |
_LIT(KName, "\tReferences this Thread");
|
|
2625 |
return TPtrC( KName );
|
|
2626 |
}
|
|
2627 |
|
|
2628 |
|
|
2629 |
void CMemSpyThreadInfoOtherThreads::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& /*aItem*/, TInt /*aRefCount*/, TDes& aFullName )
|
|
2630 |
{
|
|
2631 |
AddItemL( aFullName, KNullDesC );
|
|
2632 |
}
|
|
2633 |
|
|
2634 |
|
|
2635 |
|
|
2636 |
|
|
2637 |
|
|
2638 |
|
|
2639 |
|
|
2640 |
|
|
2641 |
|
|
2642 |
|
|
2643 |
|
|
2644 |
|
|
2645 |
|
|
2646 |
|
|
2647 |
|
|
2648 |
|
|
2649 |
|
|
2650 |
|
|
2651 |
|
|
2652 |
|
|
2653 |
CMemSpyThreadInfoOtherProcesses::CMemSpyThreadInfoOtherProcesses( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2654 |
: CMemSpyThreadInfoReferencedBy( aContainer, EMemSpyThreadInfoItemTypeOtherProcesses, EMemSpyDriverContainerTypeProcess, aAsyncConstruction )
|
|
2655 |
{
|
|
2656 |
}
|
|
2657 |
|
|
2658 |
|
|
2659 |
CMemSpyThreadInfoOtherProcesses* CMemSpyThreadInfoOtherProcesses::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2660 |
{
|
|
2661 |
CMemSpyThreadInfoOtherProcesses* self = new(ELeave) CMemSpyThreadInfoOtherProcesses( aContainer, aAsyncConstruction );
|
|
2662 |
CleanupStack::PushL( self );
|
|
2663 |
if ( !aAsyncConstruction )
|
|
2664 |
{
|
|
2665 |
self->ConstructL();
|
|
2666 |
}
|
|
2667 |
return self;
|
|
2668 |
}
|
|
2669 |
|
|
2670 |
|
|
2671 |
EXPORT_C TPtrC CMemSpyThreadInfoOtherProcesses::Name() const
|
|
2672 |
{
|
|
2673 |
_LIT(KName, "\tReferences this Process");
|
|
2674 |
return TPtrC( KName );
|
|
2675 |
}
|
|
2676 |
|
|
2677 |
|
|
2678 |
void CMemSpyThreadInfoOtherProcesses::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& /*aItem*/, TInt /*aRefCount*/, TDes& aFullName )
|
|
2679 |
{
|
|
2680 |
AddItemL( aFullName, KNullDesC );
|
|
2681 |
}
|
|
2682 |
|
|
2683 |
|
|
2684 |
|
|
2685 |
|
|
2686 |
|
|
2687 |
|
|
2688 |
|
|
2689 |
|
|
2690 |
|
|
2691 |
|
|
2692 |
|
|
2693 |
|
|
2694 |
|
|
2695 |
|
|
2696 |
|
|
2697 |
|
|
2698 |
|
|
2699 |
CMemSpyThreadInfoMemoryTracking::CMemSpyThreadInfoMemoryTracking( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2700 |
: CMemSpyThreadInfoItemBase( aContainer, EMemSpyThreadInfoItemTypeMemoryTracking, aAsyncConstruction ), iTotalIncludesSharedMemory( ETrue )
|
|
2701 |
{
|
|
2702 |
}
|
|
2703 |
|
|
2704 |
|
|
2705 |
CMemSpyThreadInfoMemoryTracking::~CMemSpyThreadInfoMemoryTracking()
|
|
2706 |
{
|
|
2707 |
#ifdef _DEBUG
|
|
2708 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::~CMemSpyThreadInfoMemoryTracking() - START - this: 0x%08x, iTracker: 0x%08x", this, iTracker );
|
|
2709 |
#endif
|
|
2710 |
//
|
|
2711 |
TrackingObserverRemove( *this );
|
|
2712 |
//
|
|
2713 |
delete iInfoHWM;
|
|
2714 |
delete iInfoPeak;
|
|
2715 |
delete iInfoCurrent;
|
|
2716 |
//
|
|
2717 |
#ifdef _DEBUG
|
|
2718 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::~CMemSpyThreadInfoMemoryTracking() - END - this: 0x%08x, iTracker: 0x%08x", this, iTracker );
|
|
2719 |
#endif
|
|
2720 |
}
|
|
2721 |
|
|
2722 |
|
|
2723 |
void CMemSpyThreadInfoMemoryTracking::ConstructL()
|
|
2724 |
{
|
|
2725 |
#ifdef _DEBUG
|
|
2726 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::ConstructL() - START - this: 0x%08x, iTracker: 0x%08x", this, iTracker );
|
|
2727 |
#endif
|
|
2728 |
CMemSpyEngine& engine = Container().Thread().Process().Engine();
|
|
2729 |
//
|
|
2730 |
const TProcessId pid = Container().Thread().Process().Id();
|
|
2731 |
iTracker = engine.HelperProcess().TrackerOrNull( pid );
|
|
2732 |
|
|
2733 |
#ifdef _DEBUG
|
|
2734 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::ConstructL() - requesting observer add... - this: 0x%08x, iTracker: 0x%08x", this, iTracker );
|
|
2735 |
#endif
|
|
2736 |
TrackingObserverAddL( *this );
|
|
2737 |
//
|
|
2738 |
#ifdef _DEBUG
|
|
2739 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::ConstructL() - preparing info item... - this: 0x%08x, iTracker: 0x%08x", this, iTracker );
|
|
2740 |
#endif
|
|
2741 |
if ( iTracker )
|
|
2742 |
{
|
|
2743 |
delete iInfoCurrent;
|
|
2744 |
iInfoCurrent = NULL;
|
|
2745 |
iInfoCurrent = CMemSpyThreadInfoMemoryTrackingStatisticsCurrent::NewLC( Container(), EFalse );
|
|
2746 |
CleanupStack::Pop( iInfoCurrent );
|
|
2747 |
//
|
|
2748 |
delete iInfoHWM;
|
|
2749 |
iInfoHWM = NULL;
|
|
2750 |
iInfoHWM = CMemSpyThreadInfoMemoryTrackingStatisticsHWM::NewLC( Container(), EFalse );
|
|
2751 |
CleanupStack::Pop( iInfoHWM );
|
|
2752 |
//
|
|
2753 |
delete iInfoPeak;
|
|
2754 |
iInfoPeak = NULL;
|
|
2755 |
iInfoPeak = CMemSpyThreadInfoMemoryTrackingStatisticsPeak::NewLC( Container(), EFalse );
|
|
2756 |
CleanupStack::Pop( iInfoPeak );
|
|
2757 |
}
|
|
2758 |
|
|
2759 |
#ifdef _DEBUG
|
|
2760 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::ConstructL() - prepared info items - this: 0x%08x, iTracker: 0x%08x", this, iTracker );
|
|
2761 |
#endif
|
|
2762 |
|
|
2763 |
// Prepare items
|
|
2764 |
_LIT( KItem0, "Tracking" );
|
|
2765 |
AddItemOnOffL( KItem0, ( iTracker ) ? iTracker->AmTracking() : EFalse );
|
|
2766 |
|
|
2767 |
TInt64 valCurrent( 0 );
|
|
2768 |
if ( iTracker )
|
|
2769 |
{
|
|
2770 |
if ( TotalIncludesSharedMemory() )
|
|
2771 |
{
|
|
2772 |
valCurrent = iTracker->InfoCurrent().TotalIncShared();
|
|
2773 |
}
|
|
2774 |
else
|
|
2775 |
{
|
|
2776 |
valCurrent = iTracker->InfoCurrent().TotalExcShared();
|
|
2777 |
}
|
|
2778 |
}
|
|
2779 |
_LIT( KItem1, "Total [Current]" );
|
|
2780 |
AddItemLongL( KItem1, valCurrent );
|
|
2781 |
|
|
2782 |
TInt64 valHWM( 0 );
|
|
2783 |
if ( iTracker )
|
|
2784 |
{
|
|
2785 |
if ( TotalIncludesSharedMemory() )
|
|
2786 |
{
|
|
2787 |
valHWM = iTracker->InfoHWMIncShared().TotalIncShared();
|
|
2788 |
}
|
|
2789 |
else
|
|
2790 |
{
|
|
2791 |
valHWM = iTracker->InfoHWMExcShared().TotalExcShared();
|
|
2792 |
}
|
|
2793 |
}
|
|
2794 |
_LIT( KItem2, "Total [HWM]" );
|
|
2795 |
AddItemLongL( KItem2, valHWM );
|
|
2796 |
|
|
2797 |
TInt64 valPeak( 0 );
|
|
2798 |
if ( iTracker )
|
|
2799 |
{
|
|
2800 |
if ( TotalIncludesSharedMemory() )
|
|
2801 |
{
|
|
2802 |
valPeak = iTracker->InfoPeaks().TotalIncShared();
|
|
2803 |
}
|
|
2804 |
else
|
|
2805 |
{
|
|
2806 |
valPeak = iTracker->InfoPeaks().TotalExcShared();
|
|
2807 |
}
|
|
2808 |
}
|
|
2809 |
_LIT( KItem3, "Total [Peaks]" );
|
|
2810 |
AddItemLongL( KItem3, valPeak );
|
|
2811 |
|
|
2812 |
//
|
|
2813 |
Container().NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemChanged, Type() );
|
|
2814 |
#ifdef _DEBUG
|
|
2815 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::ConstructL() - END - this: 0x%08x", this );
|
|
2816 |
#endif
|
|
2817 |
}
|
|
2818 |
|
|
2819 |
|
|
2820 |
CMemSpyThreadInfoMemoryTracking* CMemSpyThreadInfoMemoryTracking::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
2821 |
{
|
|
2822 |
CMemSpyThreadInfoMemoryTracking* self = new(ELeave) CMemSpyThreadInfoMemoryTracking( aContainer, aAsyncConstruction );
|
|
2823 |
CleanupStack::PushL( self );
|
|
2824 |
if ( !aAsyncConstruction )
|
|
2825 |
{
|
|
2826 |
self->ConstructL();
|
|
2827 |
}
|
|
2828 |
return self;
|
|
2829 |
}
|
|
2830 |
|
|
2831 |
|
|
2832 |
EXPORT_C TPtrC CMemSpyThreadInfoMemoryTracking::Name() const
|
|
2833 |
{
|
|
2834 |
_LIT(KName, "\tMemory Tracking");
|
|
2835 |
return TPtrC( KName );
|
|
2836 |
}
|
|
2837 |
|
|
2838 |
|
|
2839 |
EXPORT_C TBool CMemSpyThreadInfoMemoryTracking::TrackingActive() const
|
|
2840 |
{
|
|
2841 |
return ( iTracker != NULL ? iTracker->AmTracking() : EFalse );
|
|
2842 |
}
|
|
2843 |
|
|
2844 |
|
|
2845 |
EXPORT_C TBool CMemSpyThreadInfoMemoryTracking::TotalIncludesSharedMemory() const
|
|
2846 |
{
|
|
2847 |
return iTotalIncludesSharedMemory;
|
|
2848 |
}
|
|
2849 |
|
|
2850 |
|
|
2851 |
EXPORT_C void CMemSpyThreadInfoMemoryTracking::TrackingSetTotalIncludesSharedMemoryL( TBool aIncludesSharedMemory )
|
|
2852 |
{
|
|
2853 |
iTotalIncludesSharedMemory = aIncludesSharedMemory;
|
|
2854 |
|
|
2855 |
if ( iTracker )
|
|
2856 |
{
|
|
2857 |
iInfoCurrent->SetTotalIncludesSharedMemoryL( aIncludesSharedMemory );
|
|
2858 |
iInfoHWM->SetTotalIncludesSharedMemoryL( aIncludesSharedMemory );
|
|
2859 |
iInfoPeak->SetTotalIncludesSharedMemoryL( aIncludesSharedMemory );
|
|
2860 |
|
|
2861 |
// Update totals
|
|
2862 |
TRAP_IGNORE( UpdateCaptionsL( iTracker->InfoCurrent(), iTracker->InfoHWMIncShared(), iTracker->InfoHWMExcShared() ) );
|
|
2863 |
}
|
|
2864 |
}
|
|
2865 |
|
|
2866 |
|
|
2867 |
EXPORT_C void CMemSpyThreadInfoMemoryTracking::TrackingStartL()
|
|
2868 |
{
|
|
2869 |
if ( iTracker == NULL )
|
|
2870 |
{
|
|
2871 |
CMemSpyProcess& process = Container().Thread().Process();
|
|
2872 |
CMemSpyEngine& engine = process.Engine();
|
|
2873 |
iTracker = &engine.HelperProcess().TrackerL( process );
|
|
2874 |
|
|
2875 |
// Make sure we are also listening to the tracker!
|
|
2876 |
TrackingObserverAddL( *this );
|
|
2877 |
//
|
|
2878 |
CMemSpyThreadInfoMemoryTrackingStatisticsCurrent* infoCurrent = CMemSpyThreadInfoMemoryTrackingStatisticsCurrent::NewLC( Container(), EFalse );
|
|
2879 |
CMemSpyThreadInfoMemoryTrackingStatisticsHWM* infoHWM = CMemSpyThreadInfoMemoryTrackingStatisticsHWM::NewLC( Container(), EFalse );
|
|
2880 |
CMemSpyThreadInfoMemoryTrackingStatisticsPeak* infoPeak = CMemSpyThreadInfoMemoryTrackingStatisticsPeak::NewLC( Container(), EFalse );
|
|
2881 |
//
|
|
2882 |
iInfoCurrent = infoCurrent;
|
|
2883 |
iInfoHWM = infoHWM;
|
|
2884 |
iInfoPeak = infoPeak;
|
|
2885 |
//
|
|
2886 |
CleanupStack::Pop( iInfoPeak );
|
|
2887 |
CleanupStack::Pop( infoHWM );
|
|
2888 |
CleanupStack::Pop( infoCurrent );
|
|
2889 |
//
|
|
2890 |
TrackingSetTotalIncludesSharedMemoryL( iTotalIncludesSharedMemory );
|
|
2891 |
}
|
|
2892 |
|
|
2893 |
iTracker->StartL();
|
|
2894 |
|
|
2895 |
UpdateCaptionsL();
|
|
2896 |
}
|
|
2897 |
|
|
2898 |
|
|
2899 |
EXPORT_C void CMemSpyThreadInfoMemoryTracking::TrackingStopL()
|
|
2900 |
{
|
|
2901 |
if ( iTracker != NULL )
|
|
2902 |
{
|
|
2903 |
iTracker->Stop();
|
|
2904 |
}
|
|
2905 |
|
|
2906 |
UpdateCaptionsL();
|
|
2907 |
}
|
|
2908 |
|
|
2909 |
|
|
2910 |
EXPORT_C void CMemSpyThreadInfoMemoryTracking::TrackingResetHWML()
|
|
2911 |
{
|
|
2912 |
if ( iTracker != NULL )
|
|
2913 |
{
|
|
2914 |
iTracker->ResetHWML();
|
|
2915 |
}
|
|
2916 |
}
|
|
2917 |
|
|
2918 |
|
|
2919 |
EXPORT_C void CMemSpyThreadInfoMemoryTracking::TrackingObserverAddL( MMemSpyEngineProcessMemoryTrackerObserver& aObserver )
|
|
2920 |
{
|
|
2921 |
#ifdef _DEBUG
|
|
2922 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::TrackingObserverAddL() - START - iTracker: 0x%08x, this: 0x%08x", iTracker, this );
|
|
2923 |
#endif
|
|
2924 |
|
|
2925 |
if ( iTracker != NULL )
|
|
2926 |
{
|
|
2927 |
iTracker->AddObserverL( aObserver );
|
|
2928 |
}
|
|
2929 |
|
|
2930 |
#ifdef _DEBUG
|
|
2931 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::TrackingObserverAddL() - END - iTracker: 0x%08x, this: 0x%08x", iTracker, this );
|
|
2932 |
#endif
|
|
2933 |
}
|
|
2934 |
|
|
2935 |
|
|
2936 |
EXPORT_C void CMemSpyThreadInfoMemoryTracking::TrackingObserverRemove( MMemSpyEngineProcessMemoryTrackerObserver& aObserver )
|
|
2937 |
{
|
|
2938 |
#ifdef _DEBUG
|
|
2939 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::TrackingObserverRemove() - START - iTracker: 0x%08x, this: 0x%08x", iTracker, this );
|
|
2940 |
#endif
|
|
2941 |
|
|
2942 |
if ( iTracker != NULL )
|
|
2943 |
{
|
|
2944 |
iTracker->RemoveObserver( aObserver );
|
|
2945 |
}
|
|
2946 |
|
|
2947 |
#ifdef _DEBUG
|
|
2948 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::TrackingObserverRemove() - END - iTracker: 0x%08x, this: 0x%08x", iTracker, this );
|
|
2949 |
#endif
|
|
2950 |
}
|
|
2951 |
|
|
2952 |
|
|
2953 |
EXPORT_C MDesCArray& CMemSpyThreadInfoMemoryTracking::InfoCurrent()
|
|
2954 |
{
|
|
2955 |
return *iInfoCurrent;
|
|
2956 |
}
|
|
2957 |
|
|
2958 |
|
|
2959 |
EXPORT_C MDesCArray& CMemSpyThreadInfoMemoryTracking::InfoHWM()
|
|
2960 |
{
|
|
2961 |
return *iInfoHWM;
|
|
2962 |
}
|
|
2963 |
|
|
2964 |
|
|
2965 |
EXPORT_C MDesCArray& CMemSpyThreadInfoMemoryTracking::InfoPeak()
|
|
2966 |
{
|
|
2967 |
return *iInfoPeak;
|
|
2968 |
}
|
|
2969 |
|
|
2970 |
|
|
2971 |
void CMemSpyThreadInfoMemoryTracking::HandleMemoryTrackingStartedL()
|
|
2972 |
{
|
|
2973 |
__ASSERT_ALWAYS( iTracker, MemSpyEngineUtils::Panic( EMemSpyEnginePanicTrackerNull1 ) );
|
|
2974 |
CMemSpyThreadInfoItemBase::CItem& trackingItem = Item( 0 );
|
|
2975 |
trackingItem.SetOnOffL( iTracker->AmTracking() );
|
|
2976 |
//
|
|
2977 |
Container().NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemChanged, Type() );
|
|
2978 |
}
|
|
2979 |
|
|
2980 |
|
|
2981 |
void CMemSpyThreadInfoMemoryTracking::HandleMemoryTrackingStoppedL()
|
|
2982 |
{
|
|
2983 |
__ASSERT_ALWAYS( iTracker, MemSpyEngineUtils::Panic( EMemSpyEnginePanicTrackerNull2 ) );
|
|
2984 |
CMemSpyThreadInfoItemBase::CItem& trackingItem = Item( 0 );
|
|
2985 |
trackingItem.SetOnOffL( iTracker->AmTracking() );
|
|
2986 |
//
|
|
2987 |
Container().NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemChanged, Type() );
|
|
2988 |
}
|
|
2989 |
|
|
2990 |
|
|
2991 |
void CMemSpyThreadInfoMemoryTracking::HandleMemoryChangedL( const TProcessId& /*aPid*/, const TMemSpyDriverProcessInspectionInfo& aInfoCurrent, const TMemSpyDriverProcessInspectionInfo& aHWMInfoIncShared, const TMemSpyDriverProcessInspectionInfo& aHWMInfoExcShared )
|
|
2992 |
{
|
|
2993 |
#ifdef _DEBUG
|
|
2994 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::HandleMemoryChangedL() - START - this: 0x%08x", this );
|
|
2995 |
#endif
|
|
2996 |
|
|
2997 |
__ASSERT_ALWAYS( iTracker, MemSpyEngineUtils::Panic( EMemSpyEnginePanicTrackerNull3 ) );
|
|
2998 |
UpdateCaptionsL( aInfoCurrent, aHWMInfoIncShared, aHWMInfoExcShared );
|
|
2999 |
|
|
3000 |
#ifdef _DEBUG
|
|
3001 |
RDebug::Printf( "CMemSpyThreadInfoMemoryTracking::HandleMemoryChangedL() - END - this: 0x%08x", this );
|
|
3002 |
#endif
|
|
3003 |
}
|
|
3004 |
|
|
3005 |
|
|
3006 |
void CMemSpyThreadInfoMemoryTracking::UpdateCaptionsL()
|
|
3007 |
{
|
|
3008 |
if ( iTracker )
|
|
3009 |
{
|
|
3010 |
UpdateCaptionsL( iTracker->InfoCurrent(), iTracker->InfoHWMIncShared(), iTracker->InfoHWMExcShared() );
|
|
3011 |
}
|
|
3012 |
}
|
|
3013 |
|
|
3014 |
|
|
3015 |
void CMemSpyThreadInfoMemoryTracking::UpdateCaptionsL( const TMemSpyDriverProcessInspectionInfo& aInfoCurrent, const TMemSpyDriverProcessInspectionInfo& aHWMInfoIncShared, const TMemSpyDriverProcessInspectionInfo& aHWMInfoExcShared )
|
|
3016 |
{
|
|
3017 |
if ( iTracker )
|
|
3018 |
{
|
|
3019 |
// Update caption
|
|
3020 |
Item( 0 ).SetOnOffL( TrackingActive() );
|
|
3021 |
|
|
3022 |
if ( TotalIncludesSharedMemory() )
|
|
3023 |
{
|
|
3024 |
Item( 1 ).SetLongL( aInfoCurrent.TotalIncShared() );
|
|
3025 |
Item( 2 ).SetLongL( aHWMInfoIncShared.TotalIncShared() );
|
|
3026 |
Item( 3 ).SetLongL( iTracker->InfoPeaks().TotalIncShared() );
|
|
3027 |
}
|
|
3028 |
else
|
|
3029 |
{
|
|
3030 |
Item( 1 ).SetLongL( aInfoCurrent.TotalExcShared() );
|
|
3031 |
Item( 2 ).SetLongL( aHWMInfoExcShared.TotalExcShared() );
|
|
3032 |
Item( 3 ).SetLongL( iTracker->InfoPeaks().TotalExcShared() );
|
|
3033 |
}
|
|
3034 |
|
|
3035 |
Container().NotifyObserverL( MMemSpyThreadInfoContainerObserver::EInfoItemChanged, Type() );
|
|
3036 |
}
|
|
3037 |
}
|
|
3038 |
|
|
3039 |
|
|
3040 |
|
|
3041 |
|
|
3042 |
|
|
3043 |
|
|
3044 |
|
|
3045 |
|
|
3046 |
|
|
3047 |
|
|
3048 |
|
|
3049 |
|
|
3050 |
|
|
3051 |
|
|
3052 |
|
|
3053 |
|
|
3054 |
|
|
3055 |
|
|
3056 |
|
|
3057 |
|
|
3058 |
|
|
3059 |
|
|
3060 |
|
|
3061 |
|
|
3062 |
|
|
3063 |
|
|
3064 |
|
|
3065 |
|
|
3066 |
|
|
3067 |
|
|
3068 |
|
|
3069 |
|
|
3070 |
CMemSpyThreadInfoMemoryTrackingStatisticsCurrent::CMemSpyThreadInfoMemoryTrackingStatisticsCurrent( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
3071 |
: CMemSpyThreadInfoItemBase( aContainer, EMemSpyThreadInfoItemTypeMemoryTrackingCurrent, aAsyncConstruction ), iTotalIncludesSharedMemory( ETrue )
|
|
3072 |
{
|
|
3073 |
}
|
|
3074 |
|
|
3075 |
|
|
3076 |
CMemSpyThreadInfoMemoryTrackingStatisticsCurrent::~CMemSpyThreadInfoMemoryTrackingStatisticsCurrent()
|
|
3077 |
{
|
|
3078 |
if ( iTracker )
|
|
3079 |
{
|
|
3080 |
iTracker->RemoveObserver( *this );
|
|
3081 |
}
|
|
3082 |
}
|
|
3083 |
|
|
3084 |
|
|
3085 |
void CMemSpyThreadInfoMemoryTrackingStatisticsCurrent::ConstructL()
|
62
|
3086 |
{
|
51
|
3087 |
if ( iTracker )
|
|
3088 |
{
|
|
3089 |
iTracker->RemoveObserver( *this );
|
|
3090 |
}
|
|
3091 |
iTracker = &Container().Engine().HelperProcess().TrackerL( Container().Thread().Process() );
|
|
3092 |
if ( iTracker )
|
|
3093 |
{
|
|
3094 |
iTracker->AddObserverL( *this );
|
|
3095 |
//
|
|
3096 |
_LIT( KItem1, "Stack Memory" );
|
|
3097 |
AddItemDecimalL( KItem1, iTracker->InfoCurrent().iMemoryStack );
|
|
3098 |
//
|
|
3099 |
_LIT( KItem2, "Heap Memory" );
|
|
3100 |
AddItemDecimalL( KItem2, iTracker->InfoCurrent().iMemoryHeap );
|
|
3101 |
//
|
|
3102 |
_LIT( KItem3, "Local Chunk Memory" );
|
|
3103 |
AddItemDecimalL( KItem3, iTracker->InfoCurrent().iMemoryChunkLocal );
|
|
3104 |
//
|
|
3105 |
_LIT( KItem4, "Shared Chunk Memory" );
|
|
3106 |
AddItemDecimalL( KItem4, iTracker->InfoCurrent().iMemoryChunkShared );
|
|
3107 |
//
|
|
3108 |
_LIT( KItem5, "Global Data Memory" );
|
|
3109 |
AddItemDecimalL( KItem5, iTracker->InfoCurrent().iMemoryGlobalData );
|
|
3110 |
//
|
|
3111 |
_LIT( KItem6, "Total" );
|
|
3112 |
if ( iTotalIncludesSharedMemory )
|
|
3113 |
{
|
|
3114 |
AddItemLongL( KItem6, iTracker->InfoCurrent().TotalIncShared() );
|
|
3115 |
}
|
|
3116 |
else
|
|
3117 |
{
|
|
3118 |
AddItemLongL( KItem6, iTracker->InfoCurrent().TotalExcShared() );
|
|
3119 |
}
|
|
3120 |
}
|
|
3121 |
}
|
|
3122 |
|
|
3123 |
|
|
3124 |
CMemSpyThreadInfoMemoryTrackingStatisticsCurrent* CMemSpyThreadInfoMemoryTrackingStatisticsCurrent::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
3125 |
{
|
|
3126 |
CMemSpyThreadInfoMemoryTrackingStatisticsCurrent* self = new(ELeave) CMemSpyThreadInfoMemoryTrackingStatisticsCurrent( aContainer, aAsyncConstruction );
|
|
3127 |
CleanupStack::PushL( self );
|
|
3128 |
if ( !aAsyncConstruction )
|
|
3129 |
{
|
|
3130 |
self->ConstructL();
|
|
3131 |
}
|
|
3132 |
return self;
|
|
3133 |
}
|
|
3134 |
|
|
3135 |
|
|
3136 |
TPtrC CMemSpyThreadInfoMemoryTrackingStatisticsCurrent::Name() const
|
|
3137 |
{
|
|
3138 |
_LIT(KName, "\tCurrent Statistics");
|
|
3139 |
return TPtrC( KName );
|
|
3140 |
}
|
|
3141 |
|
|
3142 |
|
|
3143 |
void CMemSpyThreadInfoMemoryTrackingStatisticsCurrent::SetTotalIncludesSharedMemoryL( TBool aIncludesSharedMemory )
|
|
3144 |
{
|
|
3145 |
iTotalIncludesSharedMemory = aIncludesSharedMemory;
|
|
3146 |
|
|
3147 |
// Update totals
|
|
3148 |
HandleMemoryChangedL( iTracker->ProcessId(), iTracker->InfoCurrent(), iTracker->InfoHWMIncShared(), iTracker->InfoHWMExcShared() );
|
|
3149 |
}
|
|
3150 |
|
|
3151 |
|
|
3152 |
void CMemSpyThreadInfoMemoryTrackingStatisticsCurrent::HandleMemoryTrackingStartedL()
|
|
3153 |
{
|
|
3154 |
}
|
|
3155 |
|
|
3156 |
|
|
3157 |
void CMemSpyThreadInfoMemoryTrackingStatisticsCurrent::HandleMemoryTrackingStoppedL()
|
|
3158 |
{
|
|
3159 |
}
|
|
3160 |
|
|
3161 |
|
|
3162 |
void CMemSpyThreadInfoMemoryTrackingStatisticsCurrent::HandleMemoryChangedL( const TProcessId& /*aPid*/, const TMemSpyDriverProcessInspectionInfo& aInfoCurrent, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoIncShared*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoExcShared*/ )
|
|
3163 |
{
|
|
3164 |
Item( 0 ).SetDecimalL( aInfoCurrent.iMemoryStack );
|
|
3165 |
Item( 1 ).SetDecimalL( aInfoCurrent.iMemoryHeap );
|
|
3166 |
Item( 2 ).SetDecimalL( aInfoCurrent.iMemoryChunkLocal );
|
|
3167 |
Item( 3 ).SetDecimalL( aInfoCurrent.iMemoryChunkShared );
|
|
3168 |
Item( 4 ).SetDecimalL( aInfoCurrent.iMemoryGlobalData );
|
|
3169 |
//
|
|
3170 |
if ( iTotalIncludesSharedMemory )
|
|
3171 |
{
|
|
3172 |
Item( 5 ).SetLongL( aInfoCurrent.TotalIncShared() );
|
|
3173 |
}
|
|
3174 |
else
|
|
3175 |
{
|
|
3176 |
Item( 5 ).SetLongL( aInfoCurrent.TotalExcShared() );
|
|
3177 |
}
|
|
3178 |
}
|
|
3179 |
|
|
3180 |
|
|
3181 |
|
|
3182 |
|
|
3183 |
|
|
3184 |
|
|
3185 |
|
|
3186 |
|
|
3187 |
|
|
3188 |
|
|
3189 |
|
|
3190 |
|
|
3191 |
|
|
3192 |
|
|
3193 |
|
|
3194 |
|
|
3195 |
|
|
3196 |
|
|
3197 |
|
|
3198 |
CMemSpyThreadInfoMemoryTrackingStatisticsPeak::CMemSpyThreadInfoMemoryTrackingStatisticsPeak( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
3199 |
: CMemSpyThreadInfoItemBase( aContainer, EMemSpyThreadInfoItemTypeMemoryTrackingPeak, aAsyncConstruction ), iTotalIncludesSharedMemory( ETrue )
|
|
3200 |
{
|
|
3201 |
}
|
|
3202 |
|
|
3203 |
|
|
3204 |
CMemSpyThreadInfoMemoryTrackingStatisticsPeak::~CMemSpyThreadInfoMemoryTrackingStatisticsPeak()
|
|
3205 |
{
|
|
3206 |
if ( iTracker )
|
|
3207 |
{
|
|
3208 |
iTracker->RemoveObserver( *this );
|
|
3209 |
}
|
|
3210 |
}
|
|
3211 |
|
|
3212 |
|
|
3213 |
void CMemSpyThreadInfoMemoryTrackingStatisticsPeak::ConstructL()
|
|
3214 |
{
|
|
3215 |
if ( iTracker )
|
|
3216 |
{
|
|
3217 |
iTracker->RemoveObserver( *this );
|
|
3218 |
}
|
|
3219 |
iTracker = &Container().Engine().HelperProcess().TrackerL( Container().Thread().Process() );
|
|
3220 |
if ( iTracker )
|
|
3221 |
{
|
|
3222 |
iTracker->AddObserverL( *this );
|
|
3223 |
//
|
|
3224 |
_LIT( KItem1, "Stack Memory" );
|
|
3225 |
AddItemDecimalL( KItem1, iTracker->InfoPeaks().iMemoryStack );
|
|
3226 |
//
|
|
3227 |
_LIT( KItem2, "Heap Memory" );
|
|
3228 |
AddItemDecimalL( KItem2, iTracker->InfoPeaks().iMemoryHeap );
|
|
3229 |
//
|
|
3230 |
_LIT( KItem3, "Local Chunk Memory" );
|
|
3231 |
AddItemDecimalL( KItem3, iTracker->InfoPeaks().iMemoryChunkLocal );
|
|
3232 |
//
|
|
3233 |
_LIT( KItem4, "Shared Chunk Memory" );
|
|
3234 |
AddItemDecimalL( KItem4, iTracker->InfoPeaks().iMemoryChunkShared );
|
|
3235 |
//
|
|
3236 |
_LIT( KItem5, "Global Data Memory" );
|
|
3237 |
AddItemDecimalL( KItem5, iTracker->InfoPeaks().iMemoryGlobalData );
|
|
3238 |
//
|
|
3239 |
_LIT( KItem6, "Total" );
|
|
3240 |
if ( iTotalIncludesSharedMemory )
|
|
3241 |
{
|
|
3242 |
AddItemLongL( KItem6, iTracker->InfoPeaks().TotalIncShared() );
|
|
3243 |
}
|
|
3244 |
else
|
|
3245 |
{
|
|
3246 |
AddItemLongL( KItem6, iTracker->InfoPeaks().TotalExcShared() );
|
|
3247 |
}
|
|
3248 |
}
|
|
3249 |
}
|
|
3250 |
|
|
3251 |
|
|
3252 |
CMemSpyThreadInfoMemoryTrackingStatisticsPeak* CMemSpyThreadInfoMemoryTrackingStatisticsPeak::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
3253 |
{
|
|
3254 |
CMemSpyThreadInfoMemoryTrackingStatisticsPeak* self = new(ELeave) CMemSpyThreadInfoMemoryTrackingStatisticsPeak( aContainer, aAsyncConstruction );
|
|
3255 |
CleanupStack::PushL( self );
|
|
3256 |
if ( !aAsyncConstruction )
|
|
3257 |
{
|
|
3258 |
self->ConstructL();
|
|
3259 |
}
|
|
3260 |
return self;
|
|
3261 |
}
|
|
3262 |
|
|
3263 |
|
|
3264 |
TPtrC CMemSpyThreadInfoMemoryTrackingStatisticsPeak::Name() const
|
|
3265 |
{
|
|
3266 |
_LIT(KName, "\tPeak Statistics");
|
|
3267 |
return TPtrC( KName );
|
|
3268 |
}
|
|
3269 |
|
|
3270 |
|
|
3271 |
void CMemSpyThreadInfoMemoryTrackingStatisticsPeak::SetTotalIncludesSharedMemoryL( TBool aIncludesSharedMemory )
|
|
3272 |
{
|
|
3273 |
iTotalIncludesSharedMemory = aIncludesSharedMemory;
|
|
3274 |
|
|
3275 |
// Update totals
|
|
3276 |
HandleMemoryChangedL( iTracker->ProcessId(), iTracker->InfoCurrent(), iTracker->InfoHWMIncShared(), iTracker->InfoHWMExcShared() );
|
|
3277 |
}
|
|
3278 |
|
|
3279 |
|
|
3280 |
void CMemSpyThreadInfoMemoryTrackingStatisticsPeak::HandleMemoryTrackingStartedL()
|
|
3281 |
{
|
|
3282 |
}
|
|
3283 |
|
|
3284 |
|
|
3285 |
void CMemSpyThreadInfoMemoryTrackingStatisticsPeak::HandleMemoryTrackingStoppedL()
|
|
3286 |
{
|
|
3287 |
}
|
|
3288 |
|
|
3289 |
|
|
3290 |
void CMemSpyThreadInfoMemoryTrackingStatisticsPeak::HandleMemoryChangedL( const TProcessId& /*aPid*/, const TMemSpyDriverProcessInspectionInfo& /*aInfoCurrent*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoIncShared*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoExcShared*/ )
|
|
3291 |
{
|
|
3292 |
Item( 0 ).SetDecimalL( iTracker->InfoPeaks().iMemoryStack );
|
|
3293 |
Item( 1 ).SetDecimalL( iTracker->InfoPeaks().iMemoryHeap );
|
|
3294 |
Item( 2 ).SetDecimalL( iTracker->InfoPeaks().iMemoryChunkLocal );
|
|
3295 |
Item( 3 ).SetDecimalL( iTracker->InfoPeaks().iMemoryChunkShared );
|
|
3296 |
Item( 4 ).SetDecimalL( iTracker->InfoPeaks().iMemoryGlobalData );
|
|
3297 |
//
|
|
3298 |
if ( iTotalIncludesSharedMemory )
|
|
3299 |
{
|
|
3300 |
Item( 5 ).SetLongL( iTracker->InfoPeaks().TotalIncShared() );
|
|
3301 |
}
|
|
3302 |
else
|
|
3303 |
{
|
|
3304 |
Item( 5 ).SetLongL( iTracker->InfoPeaks().TotalExcShared() );
|
|
3305 |
}
|
|
3306 |
}
|
|
3307 |
|
|
3308 |
|
|
3309 |
|
|
3310 |
|
|
3311 |
|
|
3312 |
|
|
3313 |
|
|
3314 |
|
|
3315 |
|
|
3316 |
|
|
3317 |
|
|
3318 |
|
|
3319 |
|
|
3320 |
|
|
3321 |
|
|
3322 |
|
|
3323 |
CMemSpyThreadInfoMemoryTrackingStatisticsHWM::CMemSpyThreadInfoMemoryTrackingStatisticsHWM( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
3324 |
: CMemSpyThreadInfoItemBase( aContainer, EMemSpyThreadInfoItemTypeMemoryTrackingHWM, aAsyncConstruction ), iTotalIncludesSharedMemory( ETrue )
|
|
3325 |
{
|
|
3326 |
}
|
|
3327 |
|
|
3328 |
|
|
3329 |
CMemSpyThreadInfoMemoryTrackingStatisticsHWM::~CMemSpyThreadInfoMemoryTrackingStatisticsHWM()
|
|
3330 |
{
|
|
3331 |
if ( iTracker )
|
|
3332 |
{
|
|
3333 |
iTracker->RemoveObserver( *this );
|
|
3334 |
}
|
|
3335 |
}
|
|
3336 |
|
|
3337 |
|
|
3338 |
void CMemSpyThreadInfoMemoryTrackingStatisticsHWM::ConstructL()
|
|
3339 |
{
|
|
3340 |
if ( iTracker )
|
|
3341 |
{
|
|
3342 |
iTracker->RemoveObserver( *this );
|
|
3343 |
}
|
|
3344 |
iTracker = &Container().Engine().HelperProcess().TrackerL( Container().Thread().Process() );
|
|
3345 |
if ( iTracker )
|
|
3346 |
{
|
|
3347 |
iTracker->AddObserverL( *this );
|
|
3348 |
//
|
|
3349 |
_LIT( KItem1, "Stack Memory" );
|
|
3350 |
_LIT( KItem2, "Heap Memory" );
|
|
3351 |
_LIT( KItem3, "Local Chunk Memory" );
|
|
3352 |
_LIT( KItem4, "Shared Chunk Memory" );
|
|
3353 |
_LIT( KItem5, "Global Data Memory" );
|
|
3354 |
_LIT( KItem6, "Total" );
|
|
3355 |
//
|
|
3356 |
if ( iTotalIncludesSharedMemory )
|
|
3357 |
{
|
|
3358 |
AddItemDecimalL( KItem1, iTracker->InfoHWMIncShared().iMemoryStack );
|
|
3359 |
AddItemDecimalL( KItem2, iTracker->InfoHWMIncShared().iMemoryHeap );
|
|
3360 |
AddItemDecimalL( KItem3, iTracker->InfoHWMIncShared().iMemoryChunkLocal );
|
|
3361 |
AddItemDecimalL( KItem4, iTracker->InfoHWMIncShared().iMemoryChunkShared );
|
|
3362 |
AddItemDecimalL( KItem5, iTracker->InfoHWMIncShared().iMemoryGlobalData );
|
|
3363 |
AddItemLongL( KItem6, iTracker->InfoHWMIncShared().TotalIncShared() );
|
|
3364 |
}
|
|
3365 |
else
|
|
3366 |
{
|
|
3367 |
AddItemDecimalL( KItem1, iTracker->InfoHWMExcShared().iMemoryStack );
|
|
3368 |
AddItemDecimalL( KItem2, iTracker->InfoHWMExcShared().iMemoryHeap );
|
|
3369 |
AddItemDecimalL( KItem3, iTracker->InfoHWMExcShared().iMemoryChunkLocal );
|
|
3370 |
AddItemDecimalL( KItem4, iTracker->InfoHWMExcShared().iMemoryChunkShared );
|
|
3371 |
AddItemDecimalL( KItem5, iTracker->InfoHWMExcShared().iMemoryGlobalData );
|
|
3372 |
AddItemLongL( KItem6, iTracker->InfoHWMExcShared().TotalExcShared() );
|
|
3373 |
}
|
|
3374 |
}
|
|
3375 |
}
|
|
3376 |
|
|
3377 |
|
|
3378 |
CMemSpyThreadInfoMemoryTrackingStatisticsHWM* CMemSpyThreadInfoMemoryTrackingStatisticsHWM::NewLC( CMemSpyThreadInfoContainer& aContainer, TBool aAsyncConstruction )
|
|
3379 |
{
|
|
3380 |
CMemSpyThreadInfoMemoryTrackingStatisticsHWM* self = new(ELeave) CMemSpyThreadInfoMemoryTrackingStatisticsHWM( aContainer, aAsyncConstruction );
|
|
3381 |
CleanupStack::PushL( self );
|
|
3382 |
if ( !aAsyncConstruction )
|
|
3383 |
{
|
|
3384 |
self->ConstructL();
|
|
3385 |
}
|
|
3386 |
return self;
|
|
3387 |
}
|
|
3388 |
|
|
3389 |
|
|
3390 |
void CMemSpyThreadInfoMemoryTrackingStatisticsHWM::SetTotalIncludesSharedMemoryL( TBool aIncludesSharedMemory )
|
|
3391 |
{
|
|
3392 |
iTotalIncludesSharedMemory = aIncludesSharedMemory;
|
|
3393 |
|
|
3394 |
// Update totals
|
|
3395 |
HandleMemoryChangedL( iTracker->ProcessId(), iTracker->InfoCurrent(), iTracker->InfoHWMIncShared(), iTracker->InfoHWMExcShared() );
|
|
3396 |
}
|
|
3397 |
|
|
3398 |
|
|
3399 |
TPtrC CMemSpyThreadInfoMemoryTrackingStatisticsHWM::Name() const
|
|
3400 |
{
|
|
3401 |
_LIT(KName, "\tHigh-Water-Mark Statistics");
|
|
3402 |
return TPtrC( KName );
|
|
3403 |
}
|
|
3404 |
|
|
3405 |
|
|
3406 |
void CMemSpyThreadInfoMemoryTrackingStatisticsHWM::HandleMemoryTrackingStartedL()
|
|
3407 |
{
|
|
3408 |
}
|
|
3409 |
|
|
3410 |
|
|
3411 |
void CMemSpyThreadInfoMemoryTrackingStatisticsHWM::HandleMemoryTrackingStoppedL()
|
|
3412 |
{
|
|
3413 |
}
|
|
3414 |
|
|
3415 |
|
|
3416 |
void CMemSpyThreadInfoMemoryTrackingStatisticsHWM::HandleMemoryChangedL( const TProcessId& /*aPid*/, const TMemSpyDriverProcessInspectionInfo& /*aInfoCurrent*/, const TMemSpyDriverProcessInspectionInfo& aHWMInfoIncShared, const TMemSpyDriverProcessInspectionInfo& aHWMInfoExcShared )
|
|
3417 |
{
|
|
3418 |
if ( iTotalIncludesSharedMemory )
|
|
3419 |
{
|
|
3420 |
Item( 0 ).SetDecimalL( aHWMInfoIncShared.iMemoryStack );
|
|
3421 |
Item( 1 ).SetDecimalL( aHWMInfoIncShared.iMemoryHeap );
|
|
3422 |
Item( 2 ).SetDecimalL( aHWMInfoIncShared.iMemoryChunkLocal );
|
|
3423 |
Item( 3 ).SetDecimalL( aHWMInfoIncShared.iMemoryChunkShared );
|
|
3424 |
Item( 4 ).SetDecimalL( aHWMInfoIncShared.iMemoryGlobalData );
|
|
3425 |
Item( 5 ).SetLongL( aHWMInfoIncShared.TotalIncShared() );
|
|
3426 |
}
|
|
3427 |
else
|
|
3428 |
{
|
|
3429 |
Item( 0 ).SetDecimalL( aHWMInfoExcShared.iMemoryStack );
|
|
3430 |
Item( 1 ).SetDecimalL( aHWMInfoExcShared.iMemoryHeap );
|
|
3431 |
Item( 2 ).SetDecimalL( aHWMInfoExcShared.iMemoryChunkLocal );
|
|
3432 |
Item( 3 ).SetDecimalL( aHWMInfoExcShared.iMemoryChunkShared );
|
|
3433 |
Item( 4 ).SetDecimalL( aHWMInfoExcShared.iMemoryGlobalData );
|
|
3434 |
Item( 5 ).SetLongL( aHWMInfoExcShared.TotalExcShared() );
|
|
3435 |
}
|
|
3436 |
}
|