perfsrv/memspy/memspy_plat/memspy_api/include/MemSpyEngineClientInterface.h
changeset 48 516af714ebb4
child 52 c2f44e33b468
equal deleted inserted replaced
45:185201be11b0 48:516af714ebb4
       
     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 
       
    19 #ifndef MEMSPYENGINECLIENTINTERFACE_H
       
    20 #define MEMSPYENGINECLIENTINTERFACE_H
       
    21 
       
    22 
       
    23 // System includes
       
    24 #include <e32base.h>
       
    25 #include <u32std.h>
       
    26 
       
    27 // Constants
       
    28 const TInt KMemSpyClientServerVersion           = 2;
       
    29 const TInt KMemSpyListInfoForAllThreads         = -1;
       
    30 
       
    31 /**
       
    32  * Special constant to be used to indicate kernel thread id
       
    33  * when performing kernel-specific thread agnostic operations.
       
    34  *
       
    35  * Note that the kernel thread is not supported for all thread-specific
       
    36  * operation types. 
       
    37  *
       
    38  * Use this value to indicate that the kernel thread is the target
       
    39  * thread when calling the thread-specific overload of PerformOperation().
       
    40  */
       
    41 const TUint32 KMemSpyClientServerThreadIdKernel = KMaxTUint32;
       
    42 
       
    43 // Internal constants
       
    44 const TInt KMemSpyOpFlagsTypeMask               = 0x0000FFFF;
       
    45 const TInt KMemSpyOpFlagsInclusionMask          = 0xFFFF0000;
       
    46 const TInt KMemSpyOpFlagsIncludesThreadId       = 0x00010000;
       
    47 const TInt KMemSpyOpFlagsIncludesThreadName     = 0x00020000;
       
    48 const TInt KMemSpyOpFlagsAsyncOperation         = 0x00040000;
       
    49 // Literal constants
       
    50 _LIT( KMemSpyServerName, "MemSpyServer" );
       
    51 _LIT( KMemSpyProcessName0, "MemSpyServer.exe" );
       
    52 _LIT( KMemSpyProcessName1, "MemSpyUI.exe" );
       
    53 //_LIT( KMemSpyProcessName2, "MemSpyConsole.exe" );
       
    54 
       
    55 //
       
    56 // Supported MemSpy operation types
       
    57 //
       
    58 // Operations which can only be applied to a specific thread are
       
    59 // prefixed by [TS] - i.e. it is permitted to use the thread-specific 
       
    60 // overload of PerformOperation() for this operation type.
       
    61 //
       
    62 // Operations that can be applied only to the entire device are
       
    63 // prefixed by [ED] - i.e. it is permitted to use the 
       
    64 // thread-agnostic overload of PerformOperation() for this operation type.
       
    65 //
       
    66 // Operations that support kernel-thread-specific requests
       
    67 // are prefixed by [KS] - i.e. it is permitted to use the 
       
    68 // thread-specific overload of PerformOperation() and the thread
       
    69 // identification parameter should correspond to KMemSpyClientServerThreadIdKernel.
       
    70 // NB: The overload of PerformOperation() which supports a descriptor cannot
       
    71 // be used.
       
    72 //
       
    73 // Operations that are not relevant to a thread are prefixed
       
    74 // by [NT] - i.e. use the thread-agnostic overload of
       
    75 // PerformOperation()
       
    76 //
       
    77 // All other op codes are deemed internal and are not to be
       
    78 // used except via provided APIs.
       
    79 //
       
    80 enum TMemSpyClientServerOp
       
    81     {
       
    82     /**
       
    83      * [INTERNAL REQUEST]
       
    84      */
       
    85     EMemSpyClientServerOpMarkerFirst = 0,
       
    86 
       
    87     /**
       
    88      * [TS][ED]
       
    89      * Show basic summary information about a thread/process
       
    90      */
       
    91     EMemSpyClientServerOpSummaryInfo = EMemSpyClientServerOpMarkerFirst,
       
    92 
       
    93     /**
       
    94      * [TS][ED]
       
    95      * Show detailed summary information about a thread/process
       
    96      */
       
    97     EMemSpyClientServerOpSummaryInfoDetailed,
       
    98 
       
    99     /**
       
   100      * [TS][ED][KS]
       
   101      * Show heap information & statistics for a user-side thread
       
   102      */
       
   103     EMemSpyClientServerOpHeapInfo,
       
   104 
       
   105     /**
       
   106      * [TS][ED]
       
   107      * Prvide heap cell listings for a thread
       
   108      */
       
   109     EMemSpyClientServerOpHeapCellListing,
       
   110 
       
   111     /**
       
   112      * [TS][ED][KS]
       
   113      * Dump a thread's heap
       
   114      */
       
   115     EMemSpyClientServerOpHeapData,
       
   116 
       
   117     /**
       
   118      * [TS][ED]
       
   119      * Show summary information about a thread's stack
       
   120      */
       
   121     EMemSpyClientServerOpStackInfo,
       
   122 
       
   123     /**
       
   124      * [TS][ED]
       
   125      * Dump a thread's user-side stack
       
   126      */
       
   127     EMemSpyClientServerOpStackDataUser,
       
   128 
       
   129     /**
       
   130      * [TS][ED]
       
   131      * Dump a thread's kernel-side stack
       
   132      */
       
   133     EMemSpyClientServerOpStackDataKernel,
       
   134 
       
   135     /**
       
   136      * [TS][ED]
       
   137      * List all open files in the OS or then the open files
       
   138      * for a given thread.
       
   139      */
       
   140     EMemSpyClientServerOpOpenFiles,
       
   141     
       
   142     /**
       
   143      * [INTERNAL REQUEST]
       
   144      */
       
   145     EMemSpyClientServerOpMarkerThreadAgnosticFirst,
       
   146 
       
   147     /**
       
   148      * [ED]
       
   149      * Provide compact heap information for the entire device, which
       
   150      * can be compared with other similar listings using Heap Analyser.
       
   151      */
       
   152     EMemSpyClientServerOpHeapInfoCompact = EMemSpyClientServerOpMarkerThreadAgnosticFirst,
       
   153 
       
   154     /**
       
   155      * [ED]
       
   156      * Show compact stack information for the device
       
   157      */
       
   158     EMemSpyClientServerOpStackInfoCompact,
       
   159 
       
   160     /**
       
   161      * [NT]
       
   162      * Start the system wide memory tracker (SWMT) running, so that when
       
   163      * the timer expires, the system characteristics will be sampled
       
   164      * and any changes notified. NB: Starting the SWMT running for the first time
       
   165      * will cause an initial preparatory cycle to be established. Future updates
       
   166      * will then follow when the timer tick period expires
       
   167      */
       
   168     EMemSpyClientServerOpSystemWideMemoryTrackingTimerStart,
       
   169 
       
   170     /** 
       
   171      * [NT]
       
   172      * Stop the system wide memory tracker. No futher automatic timer-based
       
   173      * SWMT cycles will be performed unless "Force update" is utilised or the timer
       
   174      * is started again.
       
   175      */
       
   176     EMemSpyClientServerOpSystemWideMemoryTrackingTimerStop,
       
   177 
       
   178     /** 
       
   179      * [NT]
       
   180      * Reset the SWMT so that all existing cycles are discarded (which can free
       
   181      * quite a lot of memory). All operations are cancelled, the SWMT will be idle.
       
   182      * 
       
   183      * If performing manual "force updates" to the SWMT, then the SWMT should be reset
       
   184      * before starting a new test run. For timer-based SWMT sampling, this operation
       
   185      * is performed internally by MemSpy and therefore is redundant in that situation.
       
   186      */
       
   187     EMemSpyClientServerOpSystemWideMemoryTrackingReset,
       
   188 
       
   189     /**
       
   190      * [NT]
       
   191      * Force the system wide memory tracker (internal to memspy) to
       
   192      * perform a refresh
       
   193      */
       
   194     EMemSpyClientServerOpSystemWideMemoryTrackingForceUpdate,
       
   195 
       
   196     /**
       
   197      * [INTERNAL REQUEST]
       
   198      */
       
   199     EMemSpyClientServerOpSystemWideMemoryTrackingTimerPeriodSet,
       
   200 
       
   201     /**
       
   202      * [INTERNAL REQUEST]
       
   203      */
       
   204     EMemSpyClientServerOpSwitchOutputSinkFile,
       
   205 
       
   206     /**
       
   207      * [INTERNAL REQUEST]
       
   208      */
       
   209     EMemSpyClientServerOpSwitchOutputSinkTrace,
       
   210 
       
   211     /**
       
   212      * [INTERNAL REQUEST]
       
   213      */
       
   214     EMemSpyClientServerOpEnumerateKernelContainer,
       
   215 
       
   216     /**
       
   217      * [INTERNAL REQUEST]
       
   218      */
       
   219     EMemSpyClientServerOpEnumerateKernelContainerAll,
       
   220 
       
   221     /**
       
   222      * [INTERNAL REQUEST]
       
   223      */
       
   224     EMemSpyClientServerOpBitmapsSave,
       
   225 
       
   226     /**
       
   227      * [INTERNAL REQUEST]
       
   228      */
       
   229     EMemSpyClientServerOpDisableAknIconCache,
       
   230 
       
   231     /**
       
   232      * [INTERNAL REQUEST]
       
   233      */
       
   234     EMemSpyClientServerOpSendToBackground,
       
   235 
       
   236     /**
       
   237      * [INTERNAL REQUEST]
       
   238      */
       
   239     EMemSpyClientServerOpBringToForeground,
       
   240 
       
   241     /**
       
   242      * [INTERNAL REQUEST]
       
   243      */
       
   244     EMemSpyClientServerOpExit,
       
   245 
       
   246     /**
       
   247      * [INTERNAL REQUEST]
       
   248      */
       
   249     EMemSpyClientServerOpSystemWideMemoryTrackingCategoriesSet,
       
   250 
       
   251     /**
       
   252      * [INTERNAL REQUEST]
       
   253      */
       
   254     EMemSpyClientServerOpSystemWideMemoryTrackingThreadNameFilterSet,
       
   255 
       
   256     /**
       
   257      * [INTERNAL REQUEST]
       
   258      */
       
   259     EMemSpyClientServerOpSystemWideMemoryTrackingHeapDumpSet,
       
   260         
       
   261     /**
       
   262      * [INTERNAL REQUEST]
       
   263      */
       
   264     EMemSpyClientServerOpSystemWideMemoryTrackingModeSet,        
       
   265     
       
   266     /**
       
   267 	 * [INTERNAL REQUEST]
       
   268 	 */
       
   269 	EMemSpyClientServerOpMarkerUiFirst,
       
   270 	
       
   271 	EMemSpyClientServerOpGetProcessCount = EMemSpyClientServerOpMarkerUiFirst,
       
   272 	
       
   273 	EMemSpyClientServerOpGetProcesses,
       
   274 	
       
   275 	EMemSpyClienServerOpGetProcessIdByName,
       
   276 	
       
   277 	EMemSpyClientServerOpGetThreadCount,
       
   278 	
       
   279 	EMemSpyClientServerOpGetThreads,
       
   280 	
       
   281 	EMemSpyClientServerOpSetThreadPriority,
       
   282 	
       
   283 	EMemSpyClientServerOpProcessSystemPermanentOrCritical,
       
   284 	
       
   285 	EMemSpyClientServerOpEndProcess,
       
   286 	
       
   287 	EMemSpyClientServerOpSwitchToProcess,
       
   288 	
       
   289 	//Threads operations
       
   290 	EMemSpyClientServerOpThreadSystemPermanentOrCritical,
       
   291 	
       
   292 	EMemSpyClientServerOpEndThread,
       
   293 	
       
   294 	EMemSpyClientServerOpSwitchToThread,
       
   295 	
       
   296 	EMemSpyClientServerOpGetInfoItemType,
       
   297 	
       
   298 	EMemSpyClientServerOpGetProcessIdByThreadId,
       
   299 	
       
   300 	EMemSpyClientServerOpGetThreadInfoItemsCount,
       
   301 	
       
   302 	EMemSpyClientServerOpGetThreadInfoItems,
       
   303 	
       
   304 	EMemSpyClientServerOpOutputInfoHandles,
       
   305 	
       
   306 	EMemSpyClientServerOpOutputAOList,
       
   307 		
       
   308 	
       
   309 	//Kernel Objects operations
       
   310 	EMemSpyClientServerOpGetKernelObjectCount,
       
   311 	
       
   312 	EMemSpyClientServerOpGetKernelObjects,
       
   313 	
       
   314 	EMemSpyClientServerOpGetKernelObjectItemCount,
       
   315 	
       
   316 	EMemSpyClientServerOpGetKernelObjectItems,
       
   317 	
       
   318 	EMemSpyClientServerOpGetHeap,
       
   319 	
       
   320 	EMemSpyClientServerOpGetMemoryTrackingCycleCount,
       
   321 	
       
   322 	EMemSpyClientServerOpGetMemoryTrackingCycles,
       
   323 	
       
   324 	EMemSpyClientServerOpGetMemoryTrackingMdcaCount,
       
   325 	/**
       
   326 	 * [INTERNAL REQUEST]
       
   327 	 * Register for notifications of device wide operation progress.
       
   328 	 */
       
   329 	EMemSpyClientServerOpNotifyDeviceWideOperationProgress,
       
   330 	
       
   331 	/**
       
   332 	 * [INTERNAL REQUEST]
       
   333 	 * Cancel current device wide operation
       
   334 	 */
       
   335 	EMemSpyClientServerOpCancelDeviceWideOperation,	
       
   336 	
       
   337 	EMemSpyClientServerOpOutputAllContainerContents,
       
   338 	    
       
   339 	EMemSpyClientServerOpDumpKernelHeap,
       
   340 	
       
   341 	EMemSpyClientServerOpSetSwmtAutoStartProcessList,
       
   342 		
       
   343 	EMemSpyClientServerOpGetOutputSink,
       
   344 	
       
   345 	/**
       
   346 	 * [INTERNAL REQUEST]
       
   347 	 * Check if system wide memory tracking timer is running.
       
   348 	 */
       
   349 	EMemSpyClientServerOpIsSwmtRunning,
       
   350 	
       
   351 	EMemSpyClientServerOpSystemWideMemoryTrackingTimerPeriodGet,
       
   352 
       
   353 	EMemSpyClientServerOpSystemWideMemoryTrackingThreadNameFilterGet,
       
   354     
       
   355     EMemSpyClientServerOpSystemWideMemoryTrackingCategoriesGet,
       
   356     
       
   357     EMemSpyClientServerOpSystemWideMemoryTrackingHeapDumpGet,
       
   358 
       
   359     EMemSpyClientServerOpSystemWideMemoryTrackingModeGet,   
       
   360 	
       
   361     //Servers methods
       
   362 	EMemSpyClientServerOpGetServerCount,
       
   363 	
       
   364 	EMemSpyClientServerOpGetServers,
       
   365 	
       
   366 	EMemSpyClientServerOpGetSortedServers,
       
   367 	
       
   368 	EMemSpyClientServerOpServerListOutputGeneric,
       
   369 	
       
   370 	EMemSpyClientServerOpGetEComCategoryCount,
       
   371 	    
       
   372 	EMemSpyClientServerOpGetEComCategories,
       
   373 	
       
   374 	EMemSpyClientServerOpGetEComInterfaceCount,
       
   375 	        
       
   376 	EMemSpyClientServerOpGetEComInterfaces,
       
   377 	
       
   378 	EMemSpyClientServerOpGetEComImplementationCount,
       
   379 	            
       
   380 	EMemSpyClientServerOpGetEComImplementations,
       
   381 	
       
   382 	EMemSpyClientServerOpMarkerUiLast,		
       
   383 	
       
   384 	/**
       
   385 	 * [INTERNAL REQUEST]
       
   386 	 */
       
   387     EMemSpyClientServerOpMarkerLast,
       
   388     };
       
   389 
       
   390 
       
   391 enum TMemSpyEndType
       
   392 	{
       
   393 	ETerminate,
       
   394 	EKill,
       
   395 	EPanic
       
   396 	};
       
   397 
       
   398 
       
   399 
       
   400 
       
   401 
       
   402 NONSHARABLE_CLASS( RMemSpyEngineClientInterface ) : public RSessionBase
       
   403     {
       
   404 public:
       
   405     inline RMemSpyEngineClientInterface();
       
   406     inline TInt Connect();
       
   407     inline void Close();
       
   408 
       
   409 public: // API
       
   410 
       
   411     /**
       
   412      * Thread-agnostic request function. Performs the operation in the context of
       
   413      * the entire device.
       
   414      *
       
   415      * I.e. can only be used for [NT] or [ED] requests.
       
   416      */
       
   417     inline TInt PerformOperation( TMemSpyClientServerOp aOperation );
       
   418 
       
   419     /**
       
   420      * Thread-specific request functions. Perform the requested operation in the context
       
   421      * of the specified thread id, or (possibly partial) thread name.
       
   422      *
       
   423      * To perform the operation in the context of the current thread, invoke the
       
   424      * function as follows:
       
   425      *
       
   426      *      PerformOperation( <...>, RThread().Id() );
       
   427      *
       
   428      * I.e. can only be used for [TS] requests.
       
   429      */
       
   430     inline TInt PerformOperation( TMemSpyClientServerOp aOperation, TThreadId aId );
       
   431     inline TInt PerformOperation( TMemSpyClientServerOp aOperation, const TDesC& aThreadName );
       
   432 
       
   433     /**
       
   434      * General functions to switch MemSpy's output mode.
       
   435      */
       
   436     inline TInt SwitchOutputModeFile();
       
   437     inline TInt SwitchOutputModeTrace();
       
   438 
       
   439     /**
       
   440      * Configure the system wide memory tracker timer interval (for automatic timer-based polling).
       
   441      * Change will take effect next time SWMT is started.
       
   442      */
       
   443     inline TInt SystemWideMemoryTrackerTimerIntervalSet( TInt aInterval );
       
   444 
       
   445     /**
       
   446      * Configure the system wide memory tracker categories.
       
   447      * Change will take effect next time SWMT is started.
       
   448      */
       
   449     inline TInt SystemWideMemoryTrackerCategoriesSet( TInt aCategories );
       
   450 
       
   451     /**
       
   452      * Configure the system wide memory tracker for filtering user heaps by thread name.
       
   453      * Change will take effect next time SWMT is started.
       
   454      */
       
   455     inline TInt SystemWideMemoryTrackerThreadFilterSet( const TDesC& aFilter );
       
   456     
       
   457     /**
       
   458      * Configure the system wide memory tracker for enabling/disabling Heap dumps during SWMT.
       
   459      * Change will take effect next time SWMT is started.
       
   460      */
       
   461     inline TInt SystemWideMemoryTrackerHeapDumpSet( TBool aDumpEnabled );
       
   462     
       
   463     /**
       
   464      * List the contents of a specific kernel container. See TObjectType for types.
       
   465      */
       
   466     inline TInt EnumerateKernelContainer( TObjectType aType );
       
   467 
       
   468     /**
       
   469      * List the contents of all kernel containers
       
   470      */
       
   471     inline TInt EnumerateKernelContainerAll();
       
   472 
       
   473     /**
       
   474      * Save bitmaps to memory card
       
   475      */
       
   476     inline TInt SaveAllBitmaps();
       
   477 
       
   478     /**
       
   479      * Disable AknIcon caching
       
   480      */
       
   481     inline TInt DisableAknIconCache();
       
   482 
       
   483     /**
       
   484      * Send MemSpy to the background/bring to foreground
       
   485      */
       
   486     inline TInt SendToBackground();
       
   487     inline TInt BringToForeground();
       
   488 
       
   489     /**
       
   490      * Exit MemSpy
       
   491      */
       
   492     inline TInt Exit();
       
   493     };
       
   494 
       
   495 
       
   496 
       
   497 
       
   498 
       
   499 
       
   500 
       
   501 
       
   502 
       
   503 
       
   504 
       
   505 
       
   506 
       
   507 
       
   508 inline RMemSpyEngineClientInterface::RMemSpyEngineClientInterface()
       
   509     {
       
   510     }
       
   511 
       
   512 
       
   513 inline TInt RMemSpyEngineClientInterface::Connect()
       
   514     {
       
   515     TVersion version( KMemSpyClientServerVersion, 0, 0 );
       
   516     return CreateSession( KMemSpyServerName, version );
       
   517     }
       
   518 
       
   519 
       
   520 inline void RMemSpyEngineClientInterface::Close()
       
   521     {
       
   522     RSessionBase::Close();
       
   523     }
       
   524 
       
   525 
       
   526 inline TInt RMemSpyEngineClientInterface::PerformOperation( TMemSpyClientServerOp aOperation )
       
   527     {
       
   528     TInt error = KErrNotReady;
       
   529     if  ( Handle() != KNullHandle )
       
   530         {
       
   531         const TInt opCode = aOperation;
       
   532         const TIpcArgs args( KMemSpyListInfoForAllThreads );
       
   533         //
       
   534         error = SendReceive( opCode, args );
       
   535         }
       
   536     return error;
       
   537     }
       
   538 
       
   539 
       
   540 inline TInt RMemSpyEngineClientInterface::PerformOperation( TMemSpyClientServerOp aOperation, TThreadId aId )
       
   541     {
       
   542     TInt error = KErrNotReady;
       
   543     if  ( Handle() != KNullHandle )
       
   544         {
       
   545         const TInt opCode = aOperation | KMemSpyOpFlagsIncludesThreadId;
       
   546         const TIpcArgs args( aId );
       
   547         //
       
   548         error = SendReceive( opCode, args );
       
   549         }
       
   550     return error;
       
   551     }
       
   552 
       
   553 
       
   554 inline TInt RMemSpyEngineClientInterface::PerformOperation( TMemSpyClientServerOp aOperation, const TDesC& aThreadName )
       
   555     {
       
   556     TInt error = KErrNotReady;
       
   557     if  ( Handle() != KNullHandle )
       
   558         {
       
   559         const TInt opCode = aOperation | KMemSpyOpFlagsIncludesThreadName;
       
   560         const TIpcArgs args( &aThreadName );
       
   561         //
       
   562         error = SendReceive( opCode, args );
       
   563         }
       
   564     return error;
       
   565     }
       
   566 
       
   567 
       
   568 
       
   569 
       
   570 
       
   571 
       
   572 inline TInt RMemSpyEngineClientInterface::SwitchOutputModeFile()
       
   573     {
       
   574     TInt error = KErrNotReady;
       
   575     if  ( Handle() != KNullHandle )
       
   576         {
       
   577         const TInt opCode = EMemSpyClientServerOpSwitchOutputSinkFile;
       
   578         error = SendReceive( opCode );
       
   579         }
       
   580     return error;
       
   581     }
       
   582 
       
   583 
       
   584 inline TInt RMemSpyEngineClientInterface::SwitchOutputModeTrace()
       
   585     {
       
   586     TInt error = KErrNotReady;
       
   587     if  ( Handle() != KNullHandle )
       
   588         {
       
   589         const TInt opCode = EMemSpyClientServerOpSwitchOutputSinkTrace;
       
   590         error = SendReceive( opCode );
       
   591         }
       
   592     return error;
       
   593     }
       
   594 
       
   595 
       
   596 
       
   597 
       
   598 
       
   599 
       
   600 
       
   601 
       
   602 inline TInt RMemSpyEngineClientInterface::SystemWideMemoryTrackerTimerIntervalSet( TInt aInterval )
       
   603     {
       
   604     TInt error = KErrNotReady;
       
   605     if  ( Handle() != KNullHandle )
       
   606         {
       
   607         const TInt opCode = EMemSpyClientServerOpSystemWideMemoryTrackingTimerPeriodSet;
       
   608         const TIpcArgs args( aInterval );
       
   609         //
       
   610         error = SendReceive( opCode, args );
       
   611         }
       
   612     return error;
       
   613     }
       
   614 
       
   615 
       
   616 inline TInt RMemSpyEngineClientInterface::SystemWideMemoryTrackerCategoriesSet( TInt aCategories )
       
   617     {
       
   618     TInt error = KErrNotReady;
       
   619     if  ( Handle() != KNullHandle )
       
   620         {
       
   621         const TInt opCode = EMemSpyClientServerOpSystemWideMemoryTrackingCategoriesSet;
       
   622         const TIpcArgs args( aCategories );
       
   623         //
       
   624         error = SendReceive( opCode, args );
       
   625         }
       
   626     return error;
       
   627     }
       
   628 
       
   629 
       
   630 inline TInt RMemSpyEngineClientInterface::SystemWideMemoryTrackerThreadFilterSet( const TDesC& aFilter )
       
   631     {
       
   632     TInt error = KErrNotReady;
       
   633     if  ( Handle() != KNullHandle )
       
   634         {
       
   635         const TInt opCode = EMemSpyClientServerOpSystemWideMemoryTrackingThreadNameFilterSet;
       
   636         TIpcArgs args( &aFilter );
       
   637         error = SendReceive( opCode, args );
       
   638         }
       
   639     return error;
       
   640     }
       
   641 
       
   642 
       
   643 inline TInt RMemSpyEngineClientInterface::SystemWideMemoryTrackerHeapDumpSet( TBool aDumpEnabled  )
       
   644     {
       
   645     TInt error = KErrNotReady;
       
   646     if  ( Handle() != KNullHandle )
       
   647         {
       
   648         const TInt opCode = EMemSpyClientServerOpSystemWideMemoryTrackingHeapDumpSet;
       
   649         const TIpcArgs args( aDumpEnabled );
       
   650         error = SendReceive( opCode, args );
       
   651         }
       
   652     return error;
       
   653     }
       
   654 
       
   655 
       
   656 inline TInt RMemSpyEngineClientInterface::EnumerateKernelContainer( TObjectType aType )
       
   657     {
       
   658     TInt error = KErrNotReady;
       
   659     if  ( Handle() != KNullHandle )
       
   660         {
       
   661         const TInt opCode = EMemSpyClientServerOpEnumerateKernelContainer;
       
   662         const TIpcArgs args( aType );
       
   663         //
       
   664         error = SendReceive( opCode, args );
       
   665         }
       
   666     return error;
       
   667     }
       
   668 
       
   669 
       
   670 inline TInt RMemSpyEngineClientInterface::EnumerateKernelContainerAll()
       
   671     {
       
   672     TInt error = KErrNotReady;
       
   673     if  ( Handle() != KNullHandle )
       
   674         {
       
   675         const TInt opCode = EMemSpyClientServerOpEnumerateKernelContainerAll;
       
   676         error = SendReceive( opCode );
       
   677         }
       
   678     return error;
       
   679     }
       
   680 
       
   681 
       
   682 inline TInt RMemSpyEngineClientInterface::SaveAllBitmaps()
       
   683     {
       
   684     TInt error = KErrNotReady;
       
   685     if  ( Handle() != KNullHandle )
       
   686         {
       
   687         const TInt opCode = EMemSpyClientServerOpBitmapsSave;
       
   688         error = SendReceive( opCode );
       
   689         }
       
   690     return error;
       
   691     }
       
   692 
       
   693 
       
   694 inline TInt RMemSpyEngineClientInterface::DisableAknIconCache()
       
   695     {
       
   696     TInt error = KErrNotReady;
       
   697     if  ( Handle() != KNullHandle )
       
   698         {
       
   699         const TInt opCode = EMemSpyClientServerOpDisableAknIconCache;
       
   700         error = SendReceive( opCode );
       
   701         }
       
   702     return error;
       
   703     }
       
   704 
       
   705 
       
   706 inline TInt RMemSpyEngineClientInterface::SendToBackground()
       
   707     {
       
   708     TInt error = KErrNotReady;
       
   709     if  ( Handle() != KNullHandle )
       
   710         {
       
   711         const TInt opCode = EMemSpyClientServerOpSendToBackground;
       
   712         error = SendReceive( opCode );
       
   713         }
       
   714     return error;
       
   715     }
       
   716 
       
   717 
       
   718 inline TInt RMemSpyEngineClientInterface::BringToForeground()
       
   719     {
       
   720     TInt error = KErrNotReady;
       
   721     if  ( Handle() != KNullHandle )
       
   722         {
       
   723         const TInt opCode = EMemSpyClientServerOpBringToForeground;
       
   724         error = SendReceive( opCode );
       
   725         }
       
   726     return error;
       
   727     }
       
   728 
       
   729 
       
   730 inline TInt RMemSpyEngineClientInterface::Exit()
       
   731     {
       
   732     TInt error = KErrNotReady;
       
   733     if  ( Handle() != KNullHandle )
       
   734         {
       
   735         const TInt opCode = EMemSpyClientServerOpExit;
       
   736         error = SendReceive( opCode );
       
   737         }
       
   738     return error;
       
   739     }
       
   740 
       
   741 
       
   742 #endif