342 |
263 |
343 TPckgBuf<TInt> requestedCount( itemCount ); |
264 TPckgBuf<TInt> requestedCount( itemCount ); |
344 |
265 |
345 TIpcArgs args( &requestedCount, &id, &type, &bufferPtr ); |
266 TIpcArgs args( &requestedCount, &id, &type, &bufferPtr ); |
346 TInt error = SendReceive( EMemSpyClientServerOpGetThreadInfoItems, args ); |
267 TInt error = SendReceive( EMemSpyClientServerOpGetThreadInfoItems, args ); |
|
268 |
|
269 aInfoItems.Reset(); |
347 |
270 |
348 for(TInt i=0, offset = 0; i < itemCount; i++, offset+=sizeof(TMemSpyThreadInfoItemData)) |
271 for(TInt i=0, offset = 0; i < itemCount; i++, offset+=sizeof(TMemSpyThreadInfoItemData)) |
349 { |
272 { |
350 TPckgBuf<TMemSpyThreadInfoItemData> data; |
273 TPckgBuf<TMemSpyThreadInfoItemData> data; |
351 data.Copy(bufferPtr.Ptr()+offset, sizeof(TMemSpyThreadInfoItemData)); |
274 data.Copy(bufferPtr.Ptr()+offset, sizeof(TMemSpyThreadInfoItemData)); |
352 aInfoItems.AppendL(CMemSpyApiThreadInfoItem::NewL(data())); |
275 aInfoItems.AppendL(CMemSpyApiThreadInfoItem::NewLC(data())); |
353 } |
276 } |
354 |
277 |
|
278 CleanupStack::Pop(aInfoItems.Count()); |
355 CleanupStack::PopAndDestroy(buffer); |
279 CleanupStack::PopAndDestroy(buffer); |
356 } |
280 } |
357 } |
281 } |
|
282 |
|
283 User::LeaveIfError(error); |
|
284 } |
|
285 |
|
286 EXPORT_C TInt RMemSpySession::GetThreadInfoItems( RArray<CMemSpyApiThreadInfoItem*> &aInfoItems, TThreadId aId, TMemSpyThreadInfoItemType aType ) |
|
287 { |
|
288 TRAPD(error, GetThreadInfoItemsL(aInfoItems, aId, aType)); |
|
289 return error; |
358 } |
290 } |
359 |
291 |
360 //Kernel Objects specific operations |
292 //Kernel Objects specific operations |
361 EXPORT_C TInt RMemSpySession::GetKernelObjects( RArray<CMemSpyApiKernelObject*> &aKernelObjects ) |
293 EXPORT_C void RMemSpySession::GetKernelObjectsL( RArray<CMemSpyApiKernelObject*> &aKernelObjects ) |
362 { |
294 { |
363 TPckgBuf<TInt> count; |
295 TPckgBuf<TInt> count; |
364 TInt error = SendReceive( EMemSpyClientServerOpGetKernelObjectCount, TIpcArgs(&count) ); |
296 User::LeaveIfError(SendReceive( EMemSpyClientServerOpGetKernelObjectCount, TIpcArgs(&count) )); |
365 |
297 |
366 if( error == KErrNone ) |
298 TInt requestedCount = count(); |
367 { |
299 HBufC8* buffer = HBufC8::NewLC(requestedCount * sizeof(TMemSpyKernelObjectData)); |
368 TInt requestedCount = count(); |
300 TPtr8 bufferPtr(buffer->Des()); |
369 HBufC8* buffer = HBufC8::NewLC(requestedCount * sizeof(TMemSpyKernelObjectData)); |
301 |
370 TPtr8 bufferPtr(buffer->Des()); |
302 TIpcArgs args( &count, &bufferPtr ); |
371 |
303 User::LeaveIfError(SendReceive( EMemSpyClientServerOpGetKernelObjects, args )); |
372 TPckgBuf<TInt> count(requestedCount); |
304 |
373 TIpcArgs args( &count, &bufferPtr ); |
305 aKernelObjects.Reset(); |
374 TInt error = SendReceive( EMemSpyClientServerOpGetKernelObjects, args ); |
306 |
375 |
307 for(TInt i=0, offset = 0; i<requestedCount; i++, offset+=sizeof(TMemSpyKernelObjectData)) |
376 for(TInt i=0, offset = 0; i<requestedCount; i++, offset+=sizeof(TMemSpyKernelObjectData)) |
308 { |
377 { |
309 TPckgBuf<TMemSpyKernelObjectData> data; |
378 TPckgBuf<TMemSpyKernelObjectData> data; |
310 data.Copy(bufferPtr.Ptr()+offset, sizeof(TMemSpyKernelObjectData)); |
379 data.Copy(bufferPtr.Ptr()+offset, sizeof(TMemSpyKernelObjectData)); |
311 aKernelObjects.AppendL(CMemSpyApiKernelObject::NewLC(data())); |
380 aKernelObjects.AppendL(CMemSpyApiKernelObject::NewL(data())); |
312 } |
381 } |
313 |
382 |
314 CleanupStack::Pop(aKernelObjects.Count()); |
383 CleanupStack::PopAndDestroy(buffer); |
315 CleanupStack::PopAndDestroy(buffer); |
384 } |
316 } |
385 return KErrNone; |
317 |
386 } |
318 EXPORT_C TInt RMemSpySession::GetKernelObjects( RArray<CMemSpyApiKernelObject*> &aKernelObjects ) |
387 |
319 { |
388 EXPORT_C TInt RMemSpySession::GetKernelObjectItems( RArray<CMemSpyApiKernelObjectItem*> &aKernelObjectItems, TMemSpyDriverContainerType aForContainer ) |
320 TRAPD(error, GetKernelObjectsL(aKernelObjects)); |
|
321 return error; |
|
322 } |
|
323 |
|
324 EXPORT_C void RMemSpySession::GetKernelObjectItemsL( RArray<CMemSpyApiKernelObjectItem*> &aKernelObjectItems, TMemSpyDriverContainerType aForContainer ) |
389 { |
325 { |
390 TPckgBuf<TInt> count; |
326 TPckgBuf<TInt> count; |
391 TPckgBuf<TMemSpyDriverContainerType> type(aForContainer); |
327 TPckgBuf<TMemSpyDriverContainerType> type(aForContainer); |
392 TInt error = SendReceive( EMemSpyClientServerOpGetKernelObjectItemCount, TIpcArgs(&count, &type) ); |
328 User::LeaveIfError(SendReceive( EMemSpyClientServerOpGetKernelObjectItemCount, TIpcArgs(&count, &type) )); |
393 |
329 |
394 if (error == KErrNone) |
330 TInt requestedCount = count(); |
395 { |
331 HBufC8* buffer = HBufC8::NewLC(requestedCount * sizeof(TMemSpyDriverHandleInfoGeneric)); |
396 TInt requestedCount = count(); |
332 TPtr8 bufferPtr(buffer->Des()); |
397 HBufC8* buffer = HBufC8::NewLC(requestedCount * sizeof(TMemSpyDriverHandleInfoGeneric)); |
333 |
398 TPtr8 bufferPtr(buffer->Des()); |
334 TIpcArgs args( &count, &type, &bufferPtr ); |
399 |
335 User::LeaveIfError(SendReceive( EMemSpyClientServerOpGetKernelObjectItems, args )); |
400 TPckgBuf<TInt> count(requestedCount); |
336 |
401 TIpcArgs args( &count, &type, &bufferPtr ); |
337 aKernelObjectItems.Reset(); |
402 TInt error = SendReceive( EMemSpyClientServerOpGetKernelObjectItems, args ); |
338 |
403 |
339 for(TInt i=0, offset = 0; i<requestedCount; i++, offset+=sizeof(TMemSpyDriverHandleInfoGeneric)) |
404 for(TInt i=0, offset = 0; i<requestedCount; i++, offset+=sizeof(TMemSpyDriverHandleInfoGeneric)) |
340 { |
405 { |
341 TPckgBuf<TMemSpyDriverHandleInfoGeneric> data; |
406 TPckgBuf<TMemSpyDriverHandleInfoGeneric> data; |
342 data.Copy(bufferPtr.Ptr()+offset, sizeof(TMemSpyDriverHandleInfoGeneric)); |
407 data.Copy(bufferPtr.Ptr()+offset, sizeof(TMemSpyDriverHandleInfoGeneric)); |
343 aKernelObjectItems.AppendL( CMemSpyApiKernelObjectItem::NewLC( data() ) ); |
408 aKernelObjectItems.AppendL( CMemSpyApiKernelObjectItem::NewL( data() ) ); |
344 } |
409 } |
345 CleanupStack::Pop(aKernelObjectItems.Count()); |
410 |
346 CleanupStack::PopAndDestroy(buffer); |
411 CleanupStack::PopAndDestroy(buffer); |
347 } |
412 } |
348 |
413 return KErrNone; |
349 EXPORT_C TInt RMemSpySession::GetKernelObjectItems( RArray<CMemSpyApiKernelObjectItem*> &aKernelObjectItems, TMemSpyDriverContainerType aForContainer ) |
|
350 { |
|
351 TRAPD(error, GetKernelObjectItemsL(aKernelObjectItems, aForContainer)); |
|
352 return error; |
|
353 } |
|
354 |
|
355 EXPORT_C void RMemSpySession::GetMemoryTrackingCyclesL(RArray<CMemSpyApiMemoryTrackingCycle*>& aCycles) |
|
356 { |
|
357 TPckgBuf<TInt> count; |
|
358 User::LeaveIfError(SendReceive( EMemSpyClientServerOpGetMemoryTrackingCycleCount, TIpcArgs(&count) )); |
|
359 |
|
360 TInt requestedCount = count(); |
|
361 HBufC8* buffer = HBufC8::NewLC(requestedCount * sizeof(TMemSpyMemoryTrackingCycleData)); |
|
362 TPtr8 bufferPtr(buffer->Des()); |
|
363 |
|
364 TIpcArgs args( &count, &bufferPtr ); |
|
365 User::LeaveIfError(SendReceive( EMemSpyClientServerOpGetMemoryTrackingCycles, args )); |
|
366 |
|
367 aCycles.Reset(); |
|
368 |
|
369 for(TInt i=0, offset = 0; i<requestedCount; i++, offset+=sizeof(TMemSpyMemoryTrackingCycleData)) |
|
370 { |
|
371 TPckgBuf<TMemSpyMemoryTrackingCycleData> data; |
|
372 data.Copy(bufferPtr.Ptr()+offset, sizeof(TMemSpyMemoryTrackingCycleData)); |
|
373 aCycles.AppendL(CMemSpyApiMemoryTrackingCycle::NewLC(data())); |
|
374 } |
|
375 |
|
376 CleanupStack::Pop(aCycles.Count()); |
|
377 CleanupStack::PopAndDestroy(buffer); |
414 } |
378 } |
415 |
379 |
416 EXPORT_C void RMemSpySession::OutputAllContainerContents() |
380 EXPORT_C void RMemSpySession::OutputAllContainerContents() |
417 { |
381 { |
418 SendReceive( EMemSpyClientServerOpOutputAllContainerContents ); |
382 SendReceive( EMemSpyClientServerOpOutputAllContainerContents ); |
419 } |
383 } |
420 |
384 |
421 |
385 |
422 //Heap specific operations |
386 //Heap specific operations |
423 EXPORT_C CMemSpyApiHeap* RMemSpySession::GetHeap() |
387 |
|
388 EXPORT_C CMemSpyApiHeap* RMemSpySession::GetHeapL() |
424 { |
389 { |
425 CMemSpyApiHeap* aHeap; |
390 CMemSpyApiHeap* aHeap; |
426 TInt error = KErrNone; |
|
427 |
391 |
428 HBufC8* buffer = HBufC8::NewLC( sizeof(TMemSpyHeapData) ); |
392 HBufC8* buffer = HBufC8::NewLC( sizeof(TMemSpyHeapData) ); |
429 TPtr8 bufferPtr(buffer->Des()); |
393 TPtr8 bufferPtr(buffer->Des()); |
430 TIpcArgs args( &bufferPtr ); |
394 TIpcArgs args( &bufferPtr ); |
431 |
395 |
432 error = SendReceive( EMemSpyClientServerOpGetHeap, args ); |
396 User::LeaveIfError(SendReceive( EMemSpyClientServerOpGetHeap, args )); |
433 |
397 |
434 if( error == KErrNone ) |
398 TPckgBuf<TMemSpyHeapData> data; |
435 { |
399 data.Copy(bufferPtr.Ptr(), sizeof(TMemSpyHeapData)); |
436 TPckgBuf<TMemSpyHeapData> data; |
400 aHeap = CMemSpyApiHeap::NewL( data() ); |
437 data.Copy(bufferPtr.Ptr(), sizeof(TMemSpyHeapData)); |
401 |
438 aHeap = CMemSpyApiHeap::NewL( data() ); |
|
439 } |
|
440 CleanupStack::PopAndDestroy(buffer); |
402 CleanupStack::PopAndDestroy(buffer); |
441 |
403 |
442 return aHeap; |
404 return aHeap; |
443 } |
405 } |
444 |
406 |
|
407 EXPORT_C CMemSpyApiHeap* RMemSpySession::GetHeap() |
|
408 { |
|
409 CMemSpyApiHeap *result = NULL; |
|
410 TRAPD(error, result = GetHeapL()); |
|
411 return error == KErrNone ? result : NULL; |
|
412 } |
|
413 |
445 EXPORT_C void RMemSpySession::DumpKernelHeap() |
414 EXPORT_C void RMemSpySession::DumpKernelHeap() |
446 { |
415 { |
447 SendReceive( EMemSpyClientServerOpDumpKernelHeap ); |
416 SendReceive( EMemSpyClientServerOpDumpKernelHeap ); |
448 } |
417 } |
449 |
418 |
450 EXPORT_C void RMemSpySession::OutputKernelHeapDataL(TMemSpyOutputType aOutputType) |
419 EXPORT_C void RMemSpySession::OutputKernelHeapDataL() |
451 { |
420 { |
452 SetOutputTypeL(aOutputType); |
|
453 |
|
454 User::LeaveIfError(SendReceive(EMemSpyClientServerOpHeapData | KMemSpyOpFlagsIncludesThreadId, |
421 User::LeaveIfError(SendReceive(EMemSpyClientServerOpHeapData | KMemSpyOpFlagsIncludesThreadId, |
455 TIpcArgs(KMemSpyClientServerThreadIdKernel))); |
422 TIpcArgs(KMemSpyClientServerThreadIdKernel))); |
456 |
423 |
457 } |
424 } |
458 EXPORT_C void RMemSpySession::OutputThreadHeapDataL(TMemSpyOutputType aOutputType, TThreadId aThreadId) |
425 |
459 { |
426 EXPORT_C void RMemSpySession::OutputKernelHeapData(TRequestStatus& aStatus) |
460 SetOutputTypeL(aOutputType); |
427 { |
461 |
428 SendReceive(EMemSpyClientServerOpHeapData, |
|
429 TIpcArgs(KMemSpyClientServerThreadIdKernel), |
|
430 aStatus); |
|
431 } |
|
432 |
|
433 EXPORT_C void RMemSpySession::OutputThreadHeapDataL( TThreadId aThreadId) |
|
434 { |
462 User::LeaveIfError(SendReceive(EMemSpyClientServerOpHeapData | KMemSpyOpFlagsIncludesThreadId, |
435 User::LeaveIfError(SendReceive(EMemSpyClientServerOpHeapData | KMemSpyOpFlagsIncludesThreadId, |
463 TIpcArgs(aThreadId))); |
436 TIpcArgs(aThreadId))); |
464 } |
437 } |
465 EXPORT_C void RMemSpySession::OutputThreadCellListL(TMemSpyOutputType aOutputType, TThreadId aThreadId) |
438 |
466 { |
439 EXPORT_C void RMemSpySession::OutputThreadHeapDataL(const TDesC& aThreadName) |
467 SetOutputTypeL(aOutputType); |
440 { |
468 |
441 const TIpcArgs args( &aThreadName ); |
|
442 |
|
443 User::LeaveIfError( SendReceive( EMemSpyClientServerOpHeapData | KMemSpyOpFlagsIncludesThreadName, args )); |
|
444 } |
|
445 |
|
446 EXPORT_C void RMemSpySession::OutputThreadCellListL(TThreadId aThreadId) |
|
447 { |
469 User::LeaveIfError(SendReceive(EMemSpyClientServerOpHeapCellListing | KMemSpyOpFlagsIncludesThreadId, |
448 User::LeaveIfError(SendReceive(EMemSpyClientServerOpHeapCellListing | KMemSpyOpFlagsIncludesThreadId, |
470 TIpcArgs(aThreadId))); |
449 TIpcArgs(aThreadId))); |
471 } |
450 } |
472 |
451 |
473 EXPORT_C void RMemSpySession::OutputKernelObjectsL(TMemSpyOutputType aOutputType) |
452 EXPORT_C void RMemSpySession::OutputHeapInfoUserL(TThreadId aThreadId) |
474 { |
453 { |
475 SetOutputTypeL(aOutputType); |
454 User::LeaveIfError(SendReceive( EMemSpyClientServerOpHeapInfo | KMemSpyOpFlagsIncludesThreadId, |
476 |
455 TIpcArgs(aThreadId))); |
|
456 } |
|
457 |
|
458 EXPORT_C void RMemSpySession::SwitchOutputSinkL( TMemSpySinkType aType ) |
|
459 { |
|
460 TInt op; |
|
461 if( aType == ESinkTypeFile ) |
|
462 op = EMemSpyClientServerOpSwitchOutputSinkFile; |
|
463 else |
|
464 op = EMemSpyClientServerOpSwitchOutputSinkTrace; |
|
465 |
|
466 User::LeaveIfError(SendReceive( op )); |
|
467 } |
|
468 |
|
469 EXPORT_C void RMemSpySession::SwitchOutputToTraceL() |
|
470 { |
|
471 User::LeaveIfError(SendReceive(EMemSpyClientServerOpSwitchOutputSinkTrace)); |
|
472 } |
|
473 |
|
474 EXPORT_C void RMemSpySession::SwitchOutputToFileL(const TDesC& aRootFolder) |
|
475 { |
|
476 TIpcArgs args; |
|
477 if (aRootFolder.Length()) |
|
478 { |
|
479 args.Set(0, &aRootFolder); |
|
480 } |
|
481 |
|
482 User::LeaveIfError(SendReceive(EMemSpyClientServerOpSwitchOutputSinkFile, args)); |
|
483 } |
|
484 |
|
485 EXPORT_C void RMemSpySession::OutputStackInfoL(TThreadId aThreadId) |
|
486 { |
|
487 User::LeaveIfError(SendReceive( EMemSpyClientServerOpStackInfo | KMemSpyOpFlagsIncludesThreadId, |
|
488 TIpcArgs(aThreadId))); |
|
489 } |
|
490 |
|
491 EXPORT_C void RMemSpySession::OutputStackDataL(TThreadId aThreadId, TMemSpyDriverDomainType aType ) |
|
492 { |
|
493 TInt op; |
|
494 if( aType == EMemSpyDriverDomainUser ) |
|
495 op = EMemSpyClientServerOpStackDataUser; |
|
496 else |
|
497 op = EMemSpyClientServerOpStackDataKernel; |
|
498 |
|
499 User::LeaveIfError(SendReceive( op | KMemSpyOpFlagsIncludesThreadId, |
|
500 TIpcArgs(aThreadId, aType))); |
|
501 |
|
502 } |
|
503 |
|
504 EXPORT_C void RMemSpySession::OutputThreadInfoHandlesL(TThreadId aThreadId) |
|
505 { |
|
506 TPckgBuf<TThreadId> id(aThreadId); |
|
507 User::LeaveIfError(SendReceive(EMemSpyClientServerOpOutputInfoHandles, TIpcArgs( &id ))); |
|
508 } |
|
509 |
|
510 EXPORT_C void RMemSpySession::OutputAOListL(TThreadId aId, TMemSpyThreadInfoItemType aType) |
|
511 { |
|
512 TPckgBuf<TThreadId> id(aId); |
|
513 TPckgBuf<TMemSpyThreadInfoItemType> type(aType); |
|
514 |
|
515 User::LeaveIfError(SendReceive(EMemSpyClientServerOpOutputAOList, TIpcArgs( &id, &type ))); |
|
516 } |
|
517 |
|
518 EXPORT_C void RMemSpySession::OutputKernelObjectsL() |
|
519 { |
477 User::LeaveIfError(SendReceive(EMemSpyClientServerOpEnumerateKernelContainerAll)); |
520 User::LeaveIfError(SendReceive(EMemSpyClientServerOpEnumerateKernelContainerAll)); |
478 } |
521 } |
479 |
522 |
480 EXPORT_C void RMemSpySession::OutputCompactStackInfoL(TMemSpyOutputType aOutputType) |
523 EXPORT_C void RMemSpySession::OutputCompactStackInfoL() |
481 { |
524 { |
482 SetOutputTypeL(aOutputType); |
|
483 |
|
484 User::LeaveIfError(SendReceive(EMemSpyClientServerOpStackInfoCompact)); |
525 User::LeaveIfError(SendReceive(EMemSpyClientServerOpStackInfoCompact)); |
485 } |
526 } |
486 |
527 |
487 EXPORT_C void RMemSpySession::OutputCompactHeapInfoL(TMemSpyOutputType aOutputType) |
528 EXPORT_C void RMemSpySession::OutputCompactHeapInfoL() |
488 { |
529 { |
489 SetOutputTypeL(aOutputType); |
|
490 |
|
491 User::LeaveIfError(SendReceive(EMemSpyClientServerOpHeapInfoCompact)); |
530 User::LeaveIfError(SendReceive(EMemSpyClientServerOpHeapInfoCompact)); |
492 } |
531 } |
493 |
532 // Asynchronous operations |
494 void RMemSpySession::SetOutputTypeL(TMemSpyOutputType aOutputType) |
533 EXPORT_C void RMemSpySession::OutputPhoneInfo(TRequestStatus& aStatus) |
495 { |
534 { |
496 TInt operation = aOutputType == EOutputTypeFile ? |
535 SendReceive(EMemSpyClientServerOpSummaryInfo | KMemSpyOpFlagsAsyncOperation, TIpcArgs(), aStatus); |
497 EMemSpyClientServerOpSwitchOutputSinkFile : |
536 } |
498 EMemSpyClientServerOpSwitchOutputSinkTrace; |
537 |
499 |
538 EXPORT_C void RMemSpySession::OutputDetailedPhoneInfo(TRequestStatus& aStatus) |
500 User::LeaveIfError(SendReceive(operation)); |
539 { |
501 } |
540 SendReceive(EMemSpyClientServerOpSummaryInfoDetailed | KMemSpyOpFlagsAsyncOperation, TIpcArgs(), aStatus); |
|
541 } |
|
542 |
|
543 EXPORT_C void RMemSpySession::OutputHeapInfo(TRequestStatus& aStatus) |
|
544 { |
|
545 SendReceive(EMemSpyClientServerOpHeapInfo | KMemSpyOpFlagsAsyncOperation, TIpcArgs(), aStatus); |
|
546 } |
|
547 |
|
548 EXPORT_C void RMemSpySession::OutputCompactHeapInfo(TRequestStatus& aStatus) |
|
549 { |
|
550 SendReceive(EMemSpyClientServerOpHeapInfoCompact | KMemSpyOpFlagsAsyncOperation, TIpcArgs(), aStatus); |
|
551 } |
|
552 |
|
553 EXPORT_C void RMemSpySession::OutputHeapCellListing(TRequestStatus& aStatus) |
|
554 { |
|
555 SendReceive(EMemSpyClientServerOpHeapCellListing | KMemSpyOpFlagsAsyncOperation, TIpcArgs(), aStatus); |
|
556 } |
|
557 |
|
558 EXPORT_C void RMemSpySession::OutputHeapData(TRequestStatus& aStatus) |
|
559 { |
|
560 SendReceive(EMemSpyClientServerOpHeapData | KMemSpyOpFlagsAsyncOperation, TIpcArgs(), aStatus); |
|
561 } |
|
562 |
|
563 // synchronous version of the operation - for CLI |
|
564 EXPORT_C void RMemSpySession::OutputHeapData() |
|
565 { |
|
566 SendReceive(EMemSpyClientServerOpHeapData); |
|
567 } |
|
568 |
|
569 EXPORT_C void RMemSpySession::OutputStackInfo(TRequestStatus& aStatus) |
|
570 { |
|
571 SendReceive(EMemSpyClientServerOpStackInfo | KMemSpyOpFlagsAsyncOperation, TIpcArgs(), aStatus); |
|
572 } |
|
573 |
|
574 EXPORT_C void RMemSpySession::OutputCompactStackInfo(TRequestStatus& aStatus) |
|
575 { |
|
576 SendReceive(EMemSpyClientServerOpStackInfoCompact | KMemSpyOpFlagsAsyncOperation, TIpcArgs(), aStatus); |
|
577 } |
|
578 |
|
579 EXPORT_C void RMemSpySession::OutputUserStackData(TRequestStatus& aStatus) |
|
580 { |
|
581 SendReceive(EMemSpyClientServerOpStackDataUser | KMemSpyOpFlagsAsyncOperation, TIpcArgs(), aStatus); |
|
582 } |
|
583 |
|
584 EXPORT_C void RMemSpySession::OutputKernelStackData(TRequestStatus& aStatus) |
|
585 { |
|
586 SendReceive(EMemSpyClientServerOpStackDataKernel | KMemSpyOpFlagsAsyncOperation, TIpcArgs(), aStatus); |
|
587 } |
|
588 |
|
589 // Synchronous operations |
|
590 EXPORT_C void RMemSpySession::OutputPhoneInfo() |
|
591 { |
|
592 SendReceive( EMemSpyClientServerOpSummaryInfo , TIpcArgs() ); |
|
593 } |
|
594 |
|
595 EXPORT_C void RMemSpySession::SetSwmtConfig( TMemSpyEngineHelperSysMemTrackerConfig aConfig ) |
|
596 { |
|
597 TPckgBuf<TMemSpyEngineHelperSysMemTrackerConfig> config(aConfig); |
|
598 TIpcArgs args( &config ); |
|
599 |
|
600 SendReceive( EMemSpyClientServerOpSetSwmtConfig, args) ; |
|
601 } |
|
602 |
|
603 EXPORT_C void RMemSpySession::SetSwmtAutoStartProcessList( CArrayFixFlat<TUid>* aList ) |
|
604 { |
|
605 TInt count = aList->Count(); |
|
606 TIpcArgs args( &aList, &count ); |
|
607 |
|
608 SendReceive( EMemSpyClientServerOpSetSwmtAutoStartProcessList, args ); |
|
609 } |
|
610 |
|
611 EXPORT_C void RMemSpySession::SwmtResetTracking() |
|
612 { |
|
613 SendReceive( EMemSpyClientServerOpSystemWideMemoryTrackingReset ); |
|
614 } |
|
615 |
|
616 EXPORT_C void RMemSpySession::GetOutputSink( TMemSpySinkType aType ) |
|
617 { |
|
618 TPckgBuf<TMemSpySinkType> type( aType ); |
|
619 TIpcArgs args( &type ); |
|
620 |
|
621 SendReceive( EMemSpyClientServerOpGetOutputSink, args ); |
|
622 } |
|
623 |
|
624 EXPORT_C void RMemSpySession::NotifyDeviceWideOperationProgress(TMemSpyDeviceWideOperationProgress &aProgress, TRequestStatus &aStatus) |
|
625 { |
|
626 SendReceive(EMemSpyClientServerOpNotifyDeviceWideOperationProgress | KMemSpyOpFlagsAsyncOperation, |
|
627 TIpcArgs(&aProgress.iProgress, &aProgress.iDescription), |
|
628 aStatus); |
|
629 } |
|
630 |
|
631 EXPORT_C void RMemSpySession::CancelDeviceWideOperationL() |
|
632 { |
|
633 User::LeaveIfError(SendReceive(EMemSpyClientServerOpCancelDeviceWideOperation)); |
|
634 } |
|
635 |
|
636 // SWMT operations |
|
637 EXPORT_C void RMemSpySession::SetSwmtCategoriesL(TInt aCategories) |
|
638 { |
|
639 User::LeaveIfError(SendReceive(EMemSpyClientServerOpSystemWideMemoryTrackingCategoriesSet, |
|
640 TIpcArgs(aCategories))); |
|
641 } |
|
642 |
|
643 EXPORT_C void RMemSpySession::SetSwmtHeapDumpsEnabledL(TBool aEnabled) |
|
644 { |
|
645 User::LeaveIfError(SendReceive(EMemSpyClientServerOpSystemWideMemoryTrackingHeapDumpSet, |
|
646 TIpcArgs(aEnabled))); |
|
647 } |
|
648 |
|
649 EXPORT_C TBool RMemSpySession::IsSwmtRunningL() |
|
650 { |
|
651 TPckgBuf<TBool> ret; |
|
652 User::LeaveIfError(SendReceive(EMemSpyClientServerOpIsSwmtRunning, TIpcArgs(&ret))); |
|
653 |
|
654 return ret(); |
|
655 } |
|
656 |
|
657 EXPORT_C void RMemSpySession::StartSwmtTimerL(TInt aPeriod) |
|
658 { |
|
659 SetSwmtTimerIntervalL(aPeriod); |
|
660 User::LeaveIfError(SendReceive(EMemSpyClientServerOpSystemWideMemoryTrackingTimerStart)); |
|
661 } |
|
662 |
|
663 EXPORT_C void RMemSpySession::StartSwmtTimerL() |
|
664 { |
|
665 User::LeaveIfError(SendReceive(EMemSpyClientServerOpSystemWideMemoryTrackingTimerStart)); |
|
666 } |
|
667 |
|
668 EXPORT_C void RMemSpySession::SetSwmtTimerIntervalL(TInt aPeriod) |
|
669 { |
|
670 User::LeaveIfError(SendReceive(EMemSpyClientServerOpSystemWideMemoryTrackingTimerPeriodSet, |
|
671 TIpcArgs(aPeriod))); |
|
672 } |
|
673 |
|
674 EXPORT_C void RMemSpySession::StopSwmtTimerL() |
|
675 { |
|
676 User::LeaveIfError(SendReceive(EMemSpyClientServerOpSystemWideMemoryTrackingTimerStop)); |
|
677 } |
|
678 |
|
679 |
|
680 EXPORT_C void RMemSpySession::ForceSwmtUpdateL() |
|
681 { |
|
682 User::LeaveIfError(SendReceive(EMemSpyClientServerOpSystemWideMemoryTrackingForceUpdate)); |
|
683 } |
|
684 |
|
685 EXPORT_C void RMemSpySession::ForceSwmtUpdate(TRequestStatus& aStatus) |
|
686 { |
|
687 SendReceive(EMemSpyClientServerOpSystemWideMemoryTrackingForceUpdate, |
|
688 TIpcArgs(), |
|
689 aStatus); |
|
690 } |
|
691 |
|
692 EXPORT_C void RMemSpySession::SetSwmtFilter( const TDesC& aFilter ) |
|
693 { |
|
694 TIpcArgs args( &aFilter ); |
|
695 User::LeaveIfError( SendReceive( EMemSpyClientServerOpSystemWideMemoryTrackingThreadNameFilterSet, args ) ); |
|
696 } |
|
697 |
|
698 EXPORT_C TInt TMemSpyDeviceWideOperationProgress::Progress() const |
|
699 { |
|
700 return iProgress(); |
|
701 } |
|
702 |
|
703 EXPORT_C const TDesC& TMemSpyDeviceWideOperationProgress::Description() const |
|
704 { |
|
705 return iDescription; |
|
706 } |