diff -r ccab7f1f8266 -r a71a3e32a2ae memspy/MemSpyClient/inc/memspysession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/inc/memspysession.h Thu May 13 23:59:27 2010 +0300 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef MEMSPYSESSION_H +#define MEMSPYSESSION_H + + +// System includes +#include +#include + +//user includes +#include //for Processes +#include + +#include //for Threads +#include +#include +#include +#include + +#include //for KernelObjects +#include + +#include //for KernelObjectItems + +#include //for Heap +#include + +#include + +// Constants +const TInt KMemSpyVersion = 2; + +enum TSortType + { + ESortProcById, + ESortProcByName, + ESortProcByThreadCount, + ESortProcByCodeSegs, + ESortProcByHeapUsage, + ESortProcByStackUsage + }; + +enum TMemSpyOutputType + { + EOutputTypeDebug = 0, + EOutputTypeFile + }; + + +NONSHARABLE_CLASS( RMemSpySession ) : public RSessionBase + { +public: + IMPORT_C RMemSpySession(); + IMPORT_C TInt Connect(); + +public: //API + IMPORT_C void OutputKernelHeapDataL(TMemSpyOutputType aOutputType); //EMemSpyClientServerOpHeapData + IMPORT_C void OutputThreadHeapDataL(TMemSpyOutputType aOutputType, TThreadId aThreadId); //EMemSpyClientServerOpHeapData + IMPORT_C void OutputThreadCellListL(TMemSpyOutputType aOutputType, TThreadId aThreadId);//EMemSpyClientServerOpHeapCellListing + IMPORT_C void OutputKernelObjectsL(TMemSpyOutputType aOutputType);// EMemSpyClientServerOpEnumerateKernelContainerAll + IMPORT_C void OutputCompactStackInfoL(TMemSpyOutputType aOutputType);// EMemSpyClientServerOpStackInfoCompact + IMPORT_C void OutputCompactHeapInfoL(TMemSpyOutputType aOutputType);// EMemSpyClientServerOpHeapInfoCompact + + IMPORT_C void GetProcessesL(RArray &aProcesses, TSortType aSortType = ESortProcById); + + IMPORT_C TProcessId GetProcessIdByNameL(const TDesC& aProcessName); + + IMPORT_C void GetThreadsL(TProcessId aProcessId, RArray &aThreads, TSortType aSortType = ESortProcById); + + IMPORT_C TInt ProcessSystemPermanentOrCritical( TProcessId aId, TBool aValue ); //aValue -> return value + + IMPORT_C void SetThreadPriorityL(TThreadId aId, TInt aPriority); + IMPORT_C TInt EndProcess( TProcessId aId, TMemSpyEndType aType ); + + IMPORT_C TInt SwitchToProcess( TProcessId aId, TBool aBrought ); + + + //Threads operations + /** + * + */ + IMPORT_C void GetThreadsL(TProcessId aProcessId, RArray &aThreads, TSortType aSortType = ESortProcById); + + IMPORT_C TInt ThreadSystemPermanentOrCritical( TThreadId aId, TBool aValue ); + + IMPORT_C TInt EndThread( TThreadId aId, TMemSpyEndType aType ); + + IMPORT_C TInt SwitchToThread( TThreadId aId, TBool aBrought ); + + IMPORT_C TInt GetInfoItemType( TInt aIndex, TThreadId aId, TMemSpyThreadInfoItemType &aType ); + + IMPORT_C void GetThreadInfoItems( RArray &aInfoItems, TThreadId aId, TMemSpyThreadInfoItemType aType ); + + //KernelObjects operations + /** + * + */ + IMPORT_C TInt GetKernelObjects( RArray &aKernelObjects ); + + IMPORT_C TInt GetKernelObjectItems( RArray &aKernelObjectItems, TMemSpyDriverContainerType aForContainer ); + + IMPORT_C void OutputAllContainerContents(); + + /** + * + */ + IMPORT_C CMemSpyApiHeap* GetHeap(); + + IMPORT_C void DumpKernelHeap(); + +private: + TInt StartServer(); + + void SetOutputTypeL(TMemSpyOutputType aOutputType); + }; + +#endif // MEMSPYSESSION_H