memspy/Engine/Source/SysMemTracker/MemSpyEngineHelperSysMemTrackerCycleChange.cpp
changeset 0 a03f92240627
equal deleted inserted replaced
-1:000000000000 0:a03f92240627
       
     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/memspyenginehelpersysmemtrackercyclechange.h>
       
    19 
       
    20 // System includes
       
    21 #include <e32debug.h>
       
    22 
       
    23 // User includes
       
    24 #include <memspy/engine/memspyengine.h>
       
    25 #include <memspy/engine/memspyengineutils.h>
       
    26 #include <memspy/engine/memspyengineobjectthread.h>
       
    27 #include <memspy/engine/memspyengineobjectprocess.h>
       
    28 #include <memspy/engine/memspyengineobjectcontainer.h>
       
    29 #include <memspy/engine/memspyenginehelperheap.h>
       
    30 #include <memspy/engine/memspyenginehelperchunk.h>
       
    31 #include <memspy/engine/memspyenginemidwife.h>
       
    32 #include <memspy/engine/memspyengineundertaker.h>
       
    33 #include <memspy/engine/memspyengineoutputsink.h>
       
    34 #include <memspy/engine/memspyengineoutputlist.h>
       
    35 #include <memspy/engine/memspyenginehelpersysmemtrackercycle.h>
       
    36 
       
    37 
       
    38 
       
    39 CMemSpyEngineHelperSysMemTrackerCycleChange::CMemSpyEngineHelperSysMemTrackerCycleChange( TUint8 aAttribs )
       
    40 :   iAttributes( aAttribs )
       
    41     {
       
    42     }
       
    43 
       
    44 
       
    45 CMemSpyEngineHelperSysMemTrackerCycleChange::~CMemSpyEngineHelperSysMemTrackerCycleChange()
       
    46     {
       
    47     }
       
    48 
       
    49 
       
    50 void CMemSpyEngineHelperSysMemTrackerCycleChange::BaseConstructL()
       
    51     {
       
    52     }
       
    53 
       
    54 
       
    55 void CMemSpyEngineHelperSysMemTrackerCycleChange::FormatType( TMemSpySWMTTypeName& aBuffer ) const
       
    56     {
       
    57     _LIT( KTypeUnknown,                 "{????}" );
       
    58     _LIT( KTypeHeap,                    "{HEAP}" );
       
    59     _LIT( KTypeChunk,                   "{CHNK}" );
       
    60     _LIT( KTypeCode,                    "{CODE}" );
       
    61     _LIT( KTypeStack,                   "{STAK}" );
       
    62     _LIT( KTypeGlobalData,              "{GLOD}" );
       
    63     _LIT( KTypeRamDrive,                "{RAMD}" );
       
    64     _LIT( KTypeOpenFile,                "{FILE}" );
       
    65     _LIT( KTypeDiskSpace,               "{DISK}" );
       
    66     _LIT( KTypeBitmap,                  "{BITM}" );
       
    67     _LIT( KTypeHandleGeneric,           "{HGEN}" );
       
    68     _LIT( KTypeHandlePAndS,             "{HPAS}" );
       
    69     _LIT( KTypeFbserv,                  "{FABS}" );
       
    70     _LIT( KTypeFileServerCache,         "{F32C}" );
       
    71     _LIT( KTypeSystemMemory,            "{SYSM}" );
       
    72     _LIT( KTypeWindowGroup,             "{WNDG}" );
       
    73     //
       
    74     switch( Type() )
       
    75         {
       
    76         case EMemSpyEngineSysMemTrackerTypeHeapUser:
       
    77         case EMemSpyEngineSysMemTrackerTypeHeapKernel:
       
    78             aBuffer.Append( KTypeHeap );
       
    79             break;
       
    80         case EMemSpyEngineSysMemTrackerTypeChunk:
       
    81             aBuffer.Append( KTypeChunk );
       
    82             break;
       
    83         case EMemSpyEngineSysMemTrackerTypeCode:
       
    84             aBuffer.Append( KTypeCode );
       
    85             break;
       
    86         case EMemSpyEngineSysMemTrackerTypeHandleGeneric:
       
    87             aBuffer.Append( KTypeHandleGeneric );
       
    88             break;
       
    89         case EMemSpyEngineSysMemTrackerTypeHandlePAndS:
       
    90             aBuffer.Append( KTypeHandlePAndS );
       
    91             break;
       
    92         case EMemSpyEngineSysMemTrackerTypeStack:
       
    93             aBuffer.Append( KTypeStack );
       
    94             break;
       
    95         case EMemSpyEngineSysMemTrackerTypeGlobalData:
       
    96             aBuffer.Append( KTypeGlobalData );
       
    97             break;
       
    98         case EMemSpyEngineSysMemTrackerTypeRamDrive:
       
    99             aBuffer.Append( KTypeRamDrive );
       
   100             break;
       
   101         case EMemSpyEngineSysMemTrackerTypeOpenFile:
       
   102             aBuffer.Append( KTypeOpenFile );
       
   103             break;
       
   104         case EMemSpyEngineSysMemTrackerTypeDiskSpace:
       
   105             aBuffer.Append( KTypeDiskSpace );
       
   106             break;
       
   107         case EMemSpyEngineSysMemTrackerTypeBitmap:
       
   108             aBuffer.Append( KTypeBitmap );
       
   109             break;
       
   110         case EMemSpyEngineSysMemTrackerTypeFbserv:
       
   111             aBuffer.Append( KTypeFbserv );
       
   112             break;
       
   113         case EMemSpyEngineSysMemTrackerTypeFileServerCache:
       
   114             aBuffer.Append( KTypeFileServerCache );
       
   115             break;
       
   116         case EMemSpyEngineSysMemTrackerTypeSystemMemory:
       
   117             aBuffer.Append( KTypeSystemMemory );
       
   118             break;
       
   119         case EMemSpyEngineSysMemTrackerTypeWindowServer:
       
   120             aBuffer.Append( KTypeWindowGroup );
       
   121             break;            
       
   122         default:
       
   123             aBuffer.Append( KTypeUnknown );
       
   124             break;
       
   125         }
       
   126     }
       
   127 
       
   128 
       
   129 void CMemSpyEngineHelperSysMemTrackerCycleChange::FormatAttributes( TDes& aBuffer ) const
       
   130     {
       
   131     _LIT( KAttribNew,   "[N]" );
       
   132     _LIT( KAttribDead,  "[D]" );
       
   133     _LIT( KAttribAlive, "[A]" );
       
   134     _LIT( KAttribPlus,  "+" );
       
   135     //
       
   136     aBuffer.Zero();
       
   137     // 
       
   138     if  ( iAttributes & EMemSpyEngineSysMemTrackerEntryAttributeIsNew )
       
   139         {
       
   140         aBuffer.Append( KAttribNew );
       
   141         }
       
   142     //
       
   143     const TBool isDead = !( iAttributes & EMemSpyEngineSysMemTrackerEntryAttributeIsAlive );
       
   144     if  ( isDead )
       
   145         {
       
   146         if  ( aBuffer.Length() )
       
   147             {
       
   148             aBuffer.Append( KAttribPlus );
       
   149             }
       
   150 
       
   151         aBuffer.Append( KAttribDead );
       
   152         }
       
   153     else
       
   154         {
       
   155         if  ( aBuffer.Length() )
       
   156             {
       
   157             aBuffer.Append( KAttribPlus );
       
   158             }
       
   159 
       
   160         aBuffer.Append( KAttribAlive );
       
   161         }
       
   162     }
       
   163 
       
   164 
       
   165 
       
   166 
       
   167 
       
   168 
       
   169 
       
   170 
       
   171