sl@0: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __ANALYSE__ sl@0: #define __ANALYSE__ sl@0: sl@0: #ifndef __MSVCDOTNET__ sl@0: #pragma warning(push, 3) // cannot compile MSVC's STL at warning level 4 sl@0: #pragma warning(disable: 4786 4710 4530) sl@0: #endif //__MSVCDOTNET__ sl@0: sl@0: int const MajorVersion=2; sl@0: int const MinorVersion=0; sl@0: int const Build=0; sl@0: sl@0: #include sl@0: sl@0: #ifdef __MSVCDOTNET__ sl@0: #include sl@0: using namespace std; sl@0: #else //!__MSVCDOTNET__ sl@0: #include sl@0: class ostream; sl@0: class istream; sl@0: #endif //__MSVCDOTNET__ sl@0: sl@0: class Sampler; sl@0: class CodeSpace; sl@0: class SymbolFile; sl@0: class NonXIP; sl@0: sl@0: class Analyse sl@0: { sl@0: public: sl@0: enum TAction {EProfile, ETrace, EActivity}; sl@0: enum TFormat {EPercent, ESamples, EExcel}; sl@0: enum TPartition {EDefault, EDll, EFunction, EBuckets, ESize}; sl@0: enum sl@0: { sl@0: ENull = 0x0001, sl@0: EAddress = 0x0002, sl@0: EZeros = 0x0004, sl@0: ENoOther = 0x0008, sl@0: ETotalOnly = 0x0010, sl@0: ERange = 0x0020 sl@0: }; sl@0: enum TCfgFileErrors {EOk, ENoCfgFile, EErrorCfgFile}; sl@0: public: sl@0: static int ProcessCommandLine(int argc,char ** argv); sl@0: static int ProcessCfgFile(const char* aCfgFileName); sl@0: static void ExplainUsage(); sl@0: static void ExplainConfigUsage(); sl@0: static void Run(); sl@0: // sl@0: static inline bool Option(int type) sl@0: {return (sOptions & type) != 0;} sl@0: static inline TAction Action() sl@0: {return sAction;} sl@0: static inline TFormat Format() sl@0: {return sFormat;} sl@0: static inline TPartition Partition() sl@0: {return sPartition;} sl@0: // sl@0: static void Abort(); sl@0: static void Abort(char const* message); sl@0: static void Corrupt(char const* message); sl@0: static ostream& Error(); sl@0: static ostream& Warning(); sl@0: // sl@0: static bool Match(const char* aString, const char* aMatch); sl@0: private: sl@0: static void Information(); sl@0: static CodeSpace* CreateCodeSpace(SymbolFile* aSymbols, NonXIP *aNonXIP); sl@0: static Sampler* CreateSampler(SymbolFile* aSymbols, NonXIP *aNonXIP); sl@0: private: sl@0: static TAction sAction; sl@0: static TFormat sFormat; sl@0: static TPartition sPartition; sl@0: static int sOptions; sl@0: static std::vector sTraces; sl@0: static const char* sRomFile; sl@0: static const char* sDll; sl@0: static const char* sFunction; sl@0: static unsigned sBase; sl@0: static unsigned sLim; sl@0: static unsigned sBuckets; sl@0: static unsigned sBucketSize; sl@0: static double sCutOff; sl@0: static unsigned sBeginSample; sl@0: static unsigned sEndSample; sl@0: sl@0: static std::string iRomFile; sl@0: static std::string iDll; sl@0: static std::string iFunction; sl@0: static std::string iThread; sl@0: static std::vector iTraces; sl@0: public: sl@0: static const char* sThread; sl@0: }; sl@0: sl@0: #endif