|
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: Common declarations/definitions for Analyze Tool. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __ANALYZETOOLTRACECONSTANTS_H__ |
|
19 #define __ANALYZETOOLTRACECONSTANTS_H__ |
|
20 |
|
21 #include <analyzetool/atcommon.h> |
|
22 |
|
23 // Trace version information. |
|
24 const TUint KATTraceVersion = 0x3; |
|
25 |
|
26 // The default logging mode |
|
27 const TATLogOption KDefaultLoggingMode = EATLogToTraceFast; |
|
28 |
|
29 // When needed, update the data file's version number directly inside |
|
30 // the _LIT8 macro. Note, if you change this string, also remember to update |
|
31 // the constant "KVersionStringLength" below. |
|
32 |
|
33 _LIT8( KDataFileVersion, "ATOOL_BINARY_FILE_VERSION 1\n" ); |
|
34 _LIT( KOpenSquareBracket, "[" ); |
|
35 _LIT( KCloseSquareBracket, "]" ); |
|
36 _LIT( KUnderLine, "_" ); |
|
37 _LIT( KLeftBracket, "(" ); |
|
38 _LIT( KRightBracket, ")" ); |
|
39 |
|
40 _LIT8( KSpace, " " ); |
|
41 _LIT8( KUdeb, "UDEB" ); |
|
42 _LIT8( KUrel, "UREL" ); |
|
43 |
|
44 // Constants for logging through debug channel |
|
45 |
|
46 // remember to change length of KTagLength when length of constants changes |
|
47 |
|
48 _LIT8( KATIdentifier, "<AT> " ); |
|
49 _LIT8( KProcessStart, "PCS " ); |
|
50 _LIT8( KProcessEnd, "PCE " ); |
|
51 _LIT8( KVersionsInfo, "DEVINFO "); |
|
52 _LIT8( KThreadStart, "TDS " ); |
|
53 _LIT8( KThreadEnd, "TDE " ); |
|
54 _LIT8( KDllLoad, "DLL " ); |
|
55 _LIT8( KDllUnload, "DLU " ); |
|
56 _LIT8( KTestStart, "TSS " ); |
|
57 _LIT8( KTestEnd, "TSE " ); |
|
58 _LIT8( KHandleLeak, "HDL " ); |
|
59 _LIT8( KLoggingCancelled, "LGC " ); |
|
60 _LIT8( KErrorOccured, "ERR " ); |
|
61 _LIT8( KMemoryAllocHeader, "ALH " ); |
|
62 _LIT8( KMemoryAllocFragment, "ALF " ); |
|
63 _LIT8( KMemoryFreedHeader, "FRH " ); |
|
64 _LIT8( KMemoryFreedFragment, "FRF " ); |
|
65 _LIT8( KMemoryReallocHeader, "RAH " ); |
|
66 _LIT8( KMemoryReallocFragment, "RAF " ); |
|
67 |
|
68 //to be implemented on carbide side (was logged from storage server/ carbide extension) |
|
69 //_LIT( KSubtestStart, "TEST_START " ); |
|
70 //_LIT( KSubtestEnd, "TEST_END " ); |
|
71 |
|
72 // File name format |
|
73 _LIT( KFormat, "%S%S%02d%S%S");// pad char="0", field width=2 |
|
74 |
|
75 // A string for setting time January 1st, 1970 AD nominal Gregorian |
|
76 _LIT( KJanuaryFirst1970, "19700000:000000.000000" ); |
|
77 |
|
78 |
|
79 // todo |
|
80 // Module name when it cannot be defined |
|
81 // was used in "handle leak" message - always unknown |
|
82 //_LIT8( KUnknownModule, "Unknown" ); |
|
83 |
|
84 // Constant time variable used to calculate timestamps for pc side. |
|
85 const TInt64 KMicroSecondsAt1970 = 62168256000000000; |
|
86 |
|
87 // The length of the string KDataFileVersion |
|
88 const TInt KVersionStringLength = 27; |
|
89 |
|
90 // The maximum length of one word (32 bits) represented in the hexadecimal text format |
|
91 // without "0x" prefix |
|
92 const TInt KHexa32Length = 8; |
|
93 |
|
94 // The maximum length of one word (32 bits) represented in the decimal text format |
|
95 const TInt KDec32Length = 10; |
|
96 |
|
97 // The maximum length of a TInt64 represented in the hexadecimal text format without |
|
98 // "0x" prefix |
|
99 const TInt KHexa64Length = 16; |
|
100 |
|
101 // The length of one space character in text |
|
102 const TInt KSpaceLength = 1; |
|
103 |
|
104 // The length of the AT message identifier with one space character ("<AT> ") |
|
105 const TInt KATIdentifierLength = 5; |
|
106 |
|
107 // The length of the tag with one space character (e.g. "FRH ") |
|
108 const TInt KTagLength = 4; |
|
109 |
|
110 // The length of atool version string (x.x.x) |
|
111 const TInt KAtoolVersionLength = 6; |
|
112 |
|
113 // The length of api version string (x.x.x) |
|
114 const TInt KApiVersionLength = 5; |
|
115 |
|
116 // The length of sw version version string |
|
117 const TInt KSwVersionLength = 64; |
|
118 |
|
119 // The length of the combination atId+processId+msgTag (<AT> NNN PCS ) |
|
120 const TInt KTraceHeaderLength = KATIdentifierLength + KHexa32Length + KSpaceLength + KTagLength; |
|
121 |
|
122 // Max length of alloc, free, realloc last item (callstack adress) |
|
123 const TInt KLastItemLength = KHexa32Length + KSpaceLength; |
|
124 |
|
125 // The maximum length of the process start (PCS) buffer |
|
126 // <<AT>> <Process ID> PCS <Process name> <Time stamp> <Udeb> <Version> |
|
127 const TInt KProcessStartBufLength = KTraceHeaderLength + |
|
128 KMaxProcessName + KSpaceLength + |
|
129 KHexa32Length + KSpaceLength + |
|
130 KHexa64Length + KSpaceLength + |
|
131 KHexa32Length; |
|
132 |
|
133 // The maximum length of the versions info (VER) buffer |
|
134 // <<AT>> <Process ID> VER <AT version> <API version> <S60 version> <ROM ID> |
|
135 const TInt KVersionsInfoBufLength = KTraceHeaderLength + |
|
136 KAtoolVersionLength + KSpaceLength + |
|
137 KApiVersionLength + KSpaceLength + |
|
138 KSwVersionLength + KSpaceLength + |
|
139 KHexa32Length; |
|
140 |
|
141 // The maximum length of the process end PCE buffer |
|
142 // <<AT>> <Process ID> PCE |
|
143 const TInt KProcessEndBufLength = KTraceHeaderLength; |
|
144 |
|
145 // The maximum length of the load dll (DLL) buffer |
|
146 // <<AT>> <Process ID> DLL <DLL name> <Memory start address> <Memory end address> |
|
147 const TInt KDllLoadBufLength = KTraceHeaderLength + |
|
148 KMaxLibraryName + KSpaceLength + |
|
149 KHexa32Length + KSpaceLength + |
|
150 KHexa32Length; |
|
151 |
|
152 // The maximum length of the unload dll (DLU) buffer |
|
153 // <<AT>> <Process ID> DLU <DLL name> <Memory start address> <Memory end address> |
|
154 const TInt KDllUnloadBufLength = KTraceHeaderLength + |
|
155 KMaxLibraryName + KSpaceLength + |
|
156 KHexa32Length + KSpaceLength + |
|
157 KHexa32Length; |
|
158 |
|
159 // The maximum length of the error (ERR) buffer |
|
160 // <<AT>> <Process ID> ERR <Thread ID> <Error code> <Error message> |
|
161 const TInt KErrOccuredBufLength = KTraceHeaderLength + |
|
162 KHexa64Length + KSpaceLength + |
|
163 KHexa32Length + KSpaceLength + |
|
164 200; //err message length |
|
165 |
|
166 // The maximum length of the alloc "ALH /ALF" buffer. |
|
167 const TInt KMemAllocBufLength = 255; |
|
168 |
|
169 // The maximum length of the free "FRH/FRF" buffer. |
|
170 const TInt KMemFreedBufLength = 255; |
|
171 |
|
172 // The maximum length of the realloc "REH/REF" buffer. |
|
173 const TInt KMemReallocBufLength = 255; |
|
174 |
|
175 // The maximum length of the handle leak "HDL" buffer |
|
176 // <<AT>> <Process ID> HDL <Handle count> |
|
177 const TInt KHandleLeakBufLength = KTraceHeaderLength + |
|
178 KHexa32Length; |
|
179 |
|
180 // The maximum length of the test satart "TSS" buffer |
|
181 // <<AT>> <Process ID> TSS <Sub test name> <Handle count> |
|
182 const TInt KTestStartBufLength = KTraceHeaderLength + |
|
183 KATMaxSubtestIdLength + KSpaceLength + |
|
184 KHexa64Length; |
|
185 |
|
186 // The maximum length of the test end (TSE) buffer |
|
187 // <<AT>> <Process ID> TSE <Sub test name> <Handle count> |
|
188 const TInt KTestEndBufLength = KTraceHeaderLength + |
|
189 KATMaxSubtestIdLength + KSpaceLength + |
|
190 KHexa64Length; |
|
191 |
|
192 // The maximum length of the thread start (TDS) buffer. |
|
193 // <<AT>> <Process ID> TDS <Thread ID> |
|
194 const TInt KThreadStartBufLength = KTraceHeaderLength + |
|
195 KHexa64Length; |
|
196 |
|
197 |
|
198 // The maximum length of the thread end (TDE) buffer. |
|
199 // <<AT>> <Process ID> TDE <Thread ID> |
|
200 const TInt KThreadEndBufLength = KTraceHeaderLength + |
|
201 KHexa64Length; |
|
202 |
|
203 // The maximun length of the file name extension buffer. |
|
204 const TInt KExtensionLength = 50; |
|
205 |
|
206 // The maximun length of the process UID3 buffer. |
|
207 const TInt KProcessUidLength = 20; |
|
208 |
|
209 #endif // __ANALYZETOOLTRACECONSTANTS_H__ |