perfsrv/memspy/memspy_plat/memspy_api/include/memspy/engine/SysMemTracker/MemSpyEngineHelperSysMemTrackerConfig.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 #ifndef MEMSPYENGINEHELPERSYSMEMTRACKERCONFIG_H
       
    19 #define MEMSPYENGINEHELPERSYSMEMTRACKERCONFIG_H
       
    20 
       
    21 // System includes
       
    22 #include <e32base.h>
       
    23 
       
    24 // Constants
       
    25 const TInt KMemSpySysMemTrackerConfigMinTimerPeriod = 30; // Seconds
       
    26 const TInt KMemSpySysMemTrackerConfigMaxTimerPeriod = 60; // Seconds
       
    27 
       
    28 
       
    29 NONSHARABLE_CLASS( TMemSpyEngineHelperSysMemTrackerConfig )
       
    30     {
       
    31 public:
       
    32     inline TMemSpyEngineHelperSysMemTrackerConfig()
       
    33         : iTimerPeriod( KMemSpySysMemTrackerConfigMinTimerPeriod * 1000000 ),
       
    34           iDumpData( EFalse ),
       
    35           iEnabledCategories( EMemSpyEngineSysMemTrackerCategoryAll ),
       
    36           iMode( MemSpyEngineSysMemTrackerModeBasic )
       
    37         {
       
    38         }
       
    39 
       
    40 public:
       
    41     inline TBool DumpData() const { return iDumpData; }
       
    42     inline const TTimeIntervalMicroSeconds32& TimerPeriod() const { return iTimerPeriod; }
       
    43     inline const TInt EnabledCategoryCount() 
       
    44         { 
       
    45         TInt count(0);
       
    46         for( TInt bit = EMemSpyEngineSysMemTrackerCategoryWindowGroups; bit > 0; bit = bit >> 1 )
       
    47             {
       
    48             if ( bit & iEnabledCategories )
       
    49                 {
       
    50                 count++;
       
    51                 }
       
    52             }
       
    53         return count;
       
    54         }
       
    55 
       
    56 public:
       
    57     enum TMemSpyEngineSysMemTrackerCategories
       
    58         {
       
    59         EMemSpyEngineSysMemTrackerCategoryNone            = 0,
       
    60         EMemSpyEngineSysMemTrackerCategoryFileServerCache = 0x0001,
       
    61         EMemSpyEngineSysMemTrackerCategoryBitmapHandles   = 0x0002,
       
    62         EMemSpyEngineSysMemTrackerCategoryUserHeap        = 0x0004,
       
    63         EMemSpyEngineSysMemTrackerCategoryKernelHeap      = 0x0008,
       
    64         EMemSpyEngineSysMemTrackerCategoryLocalChunks     = 0x0010,
       
    65         EMemSpyEngineSysMemTrackerCategoryGlobalChunks    = 0x0020,
       
    66         EMemSpyEngineSysMemTrackerCategoryRAMDrive        = 0x0040,
       
    67         EMemSpyEngineSysMemTrackerCategoryUserStacks      = 0x0080,
       
    68         EMemSpyEngineSysMemTrackerCategoryGlobalData      = 0x0100,
       
    69         EMemSpyEngineSysMemTrackerCategoryRAMLoadedCode   = 0x0200,
       
    70         EMemSpyEngineSysMemTrackerCategoryKernelHandles   = 0x0400,
       
    71         EMemSpyEngineSysMemTrackerCategoryOpenFiles       = 0x0800,
       
    72         EMemSpyEngineSysMemTrackerCategoryDiskusage       = 0x1000,
       
    73         EMemSpyEngineSysMemTrackerCategorySystemMemory    = 0x2000,
       
    74         EMemSpyEngineSysMemTrackerCategoryWindowGroups    = 0x4000,
       
    75         EMemSpyEngineSysMemTrackerCategoryAll             = 0xffff
       
    76         };
       
    77     
       
    78     enum TMemSpyEngineSysMemTrackerMode
       
    79         {
       
    80         MemSpyEngineSysMemTrackerModeBasic = 0,
       
    81         MemSpyEngineSysMemTrackerModeFull,
       
    82         MemSpyEngineSysMemTrackerModeCustom
       
    83         };
       
    84     
       
    85 public:
       
    86     TTimeIntervalMicroSeconds32 iTimerPeriod;
       
    87     TBool iDumpData;
       
    88     TInt iEnabledCategories;
       
    89     TName iThreadNameFilter;
       
    90     TMemSpyEngineSysMemTrackerMode iMode;
       
    91     };
       
    92 
       
    93 
       
    94 #endif