sl@0
|
1 |
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __ANALYSE__
|
sl@0
|
17 |
#define __ANALYSE__
|
sl@0
|
18 |
|
sl@0
|
19 |
#ifndef __MSVCDOTNET__
|
sl@0
|
20 |
#pragma warning(push, 3) // cannot compile MSVC's STL at warning level 4
|
sl@0
|
21 |
#pragma warning(disable: 4786 4710 4530)
|
sl@0
|
22 |
#endif //__MSVCDOTNET__
|
sl@0
|
23 |
|
sl@0
|
24 |
int const MajorVersion=2;
|
sl@0
|
25 |
int const MinorVersion=0;
|
sl@0
|
26 |
int const Build=0;
|
sl@0
|
27 |
|
sl@0
|
28 |
#include <vector>
|
sl@0
|
29 |
|
sl@0
|
30 |
#ifdef __MSVCDOTNET__
|
sl@0
|
31 |
#include <iostream>
|
sl@0
|
32 |
using namespace std;
|
sl@0
|
33 |
#else //!__MSVCDOTNET__
|
sl@0
|
34 |
#include <iostream.h>
|
sl@0
|
35 |
class ostream;
|
sl@0
|
36 |
class istream;
|
sl@0
|
37 |
#endif //__MSVCDOTNET__
|
sl@0
|
38 |
|
sl@0
|
39 |
class Sampler;
|
sl@0
|
40 |
class CodeSpace;
|
sl@0
|
41 |
class SymbolFile;
|
sl@0
|
42 |
class NonXIP;
|
sl@0
|
43 |
|
sl@0
|
44 |
class Analyse
|
sl@0
|
45 |
{
|
sl@0
|
46 |
public:
|
sl@0
|
47 |
enum TAction {EProfile, ETrace, EActivity};
|
sl@0
|
48 |
enum TFormat {EPercent, ESamples, EExcel};
|
sl@0
|
49 |
enum TPartition {EDefault, EDll, EFunction, EBuckets, ESize};
|
sl@0
|
50 |
enum
|
sl@0
|
51 |
{
|
sl@0
|
52 |
ENull = 0x0001,
|
sl@0
|
53 |
EAddress = 0x0002,
|
sl@0
|
54 |
EZeros = 0x0004,
|
sl@0
|
55 |
ENoOther = 0x0008,
|
sl@0
|
56 |
ETotalOnly = 0x0010,
|
sl@0
|
57 |
ERange = 0x0020
|
sl@0
|
58 |
};
|
sl@0
|
59 |
enum TCfgFileErrors {EOk, ENoCfgFile, EErrorCfgFile};
|
sl@0
|
60 |
public:
|
sl@0
|
61 |
static int ProcessCommandLine(int argc,char ** argv);
|
sl@0
|
62 |
static int ProcessCfgFile(const char* aCfgFileName);
|
sl@0
|
63 |
static void ExplainUsage();
|
sl@0
|
64 |
static void ExplainConfigUsage();
|
sl@0
|
65 |
static void Run();
|
sl@0
|
66 |
//
|
sl@0
|
67 |
static inline bool Option(int type)
|
sl@0
|
68 |
{return (sOptions & type) != 0;}
|
sl@0
|
69 |
static inline TAction Action()
|
sl@0
|
70 |
{return sAction;}
|
sl@0
|
71 |
static inline TFormat Format()
|
sl@0
|
72 |
{return sFormat;}
|
sl@0
|
73 |
static inline TPartition Partition()
|
sl@0
|
74 |
{return sPartition;}
|
sl@0
|
75 |
//
|
sl@0
|
76 |
static void Abort();
|
sl@0
|
77 |
static void Abort(char const* message);
|
sl@0
|
78 |
static void Corrupt(char const* message);
|
sl@0
|
79 |
static ostream& Error();
|
sl@0
|
80 |
static ostream& Warning();
|
sl@0
|
81 |
//
|
sl@0
|
82 |
static bool Match(const char* aString, const char* aMatch);
|
sl@0
|
83 |
private:
|
sl@0
|
84 |
static void Information();
|
sl@0
|
85 |
static CodeSpace* CreateCodeSpace(SymbolFile* aSymbols, NonXIP *aNonXIP);
|
sl@0
|
86 |
static Sampler* CreateSampler(SymbolFile* aSymbols, NonXIP *aNonXIP);
|
sl@0
|
87 |
private:
|
sl@0
|
88 |
static TAction sAction;
|
sl@0
|
89 |
static TFormat sFormat;
|
sl@0
|
90 |
static TPartition sPartition;
|
sl@0
|
91 |
static int sOptions;
|
sl@0
|
92 |
static std::vector<const char*> sTraces;
|
sl@0
|
93 |
static const char* sRomFile;
|
sl@0
|
94 |
static const char* sDll;
|
sl@0
|
95 |
static const char* sFunction;
|
sl@0
|
96 |
static unsigned sBase;
|
sl@0
|
97 |
static unsigned sLim;
|
sl@0
|
98 |
static unsigned sBuckets;
|
sl@0
|
99 |
static unsigned sBucketSize;
|
sl@0
|
100 |
static double sCutOff;
|
sl@0
|
101 |
static unsigned sBeginSample;
|
sl@0
|
102 |
static unsigned sEndSample;
|
sl@0
|
103 |
|
sl@0
|
104 |
static std::string iRomFile;
|
sl@0
|
105 |
static std::string iDll;
|
sl@0
|
106 |
static std::string iFunction;
|
sl@0
|
107 |
static std::string iThread;
|
sl@0
|
108 |
static std::vector<std::string> iTraces;
|
sl@0
|
109 |
public:
|
sl@0
|
110 |
static const char* sThread;
|
sl@0
|
111 |
};
|
sl@0
|
112 |
|
sl@0
|
113 |
#endif
|