perfsrv/memspy/Driver/Kernel/Include/SubChannels/MemSpyDriverLogChanHeapBase.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 MEMSPYDRIVERLOGICALCHANHEAPBASE_H
       
    19 #define MEMSPYDRIVERLOGICALCHANHEAPBASE_H
       
    20 
       
    21 // System includes
       
    22 #include <kern_priv.h>
       
    23 #include <memspy/driver/memspydriverobjectsshared.h>
       
    24 #include <memspy/driver/memspydriverenumerationsshared.h>
       
    25 
       
    26 // User includes
       
    27 #include "MemSpyDriverOpCodes.h"
       
    28 #include "MemSpyDriverLogChanBase.h"
       
    29 #include "MemSpyDriverObjectsInternal.h"
       
    30 #include "MemSpyDriverHeapWalker.h"
       
    31 #include "MemSpyDriverEnumerationsInternal.h"
       
    32 
       
    33 // Classes referenced
       
    34 class TMemSpyHeapInfo;
       
    35 class DMemSpyDriverDevice;
       
    36 class RMemSpyDriverRHeapUser;
       
    37 class RMemSpyMemStreamWriter;
       
    38 class RMemSpyDriverRHeapKernelInPlace;
       
    39 class RMemSpyDriverRHeapKernelFromCopy;
       
    40 
       
    41 
       
    42 class DMemSpyDriverLogChanHeapBase : public DMemSpyDriverLogChanBase, public MMemSpyHeapWalkerObserver
       
    43 	{
       
    44 public:
       
    45     enum TDrmMatchType
       
    46         {
       
    47         EMatchTypeNone = 0,
       
    48         EMatchTypeName,
       
    49         EMatchTypeUid
       
    50         };
       
    51 public:
       
    52 	~DMemSpyDriverLogChanHeapBase();
       
    53 
       
    54 protected:
       
    55 	DMemSpyDriverLogChanHeapBase( DMemSpyDriverDevice& aDevice, DThread& aThread );
       
    56     TInt Construct();
       
    57 
       
    58 protected: // From DMemSpyDriverLogChanBase
       
    59     TInt Request( TInt aFunction, TAny* a1, TAny* a2 );
       
    60 
       
    61 protected: // Capability checks for heap access
       
    62     TDrmMatchType IsDrmThread( DThread& aThread );
       
    63 
       
    64 protected: // From MHeapWalkerObserver
       
    65     void HandleHeapWalkInit();
       
    66     TBool HandleHeapCell( TMemSpyDriverCellType aCellType, TAny* aCellAddress, TInt aLength, TInt aNestingLevel, TInt aAllocNumber );
       
    67 
       
    68 protected: // Heap utility functions
       
    69     TInt OpenKernelHeap( RHeapK*& aHeap, DChunk*& aChunk, TDes8* aClientHeapChunkName = NULL );
       
    70     TInt OpenKernelHeap( RMemSpyDriverRHeapKernelFromCopy& aHeap, TDes8* aClientHeapChunkName = NULL );
       
    71     TInt GetHeapInfoKernel(RMemSpyDriverRHeapBase& aHeap, TMemSpyHeapInfo* aHeapInfo, TDes8* aTransferBuffer);
       
    72     void PrintHeapInfo( const TMemSpyHeapInfo& aInfo );
       
    73 
       
    74 private: // Data members
       
    75 
       
    76     // Points to stack-based object whilst walking in progress
       
    77     RMemSpyMemStreamWriter* iStackStream;
       
    78     TInt iFreeCellCount;
       
    79 	};
       
    80 
       
    81 
       
    82 #endif