author | William Roberts <williamr@symbian.org> |
Mon, 21 Jun 2010 21:52:32 +0100 | |
branch | GCC_SURGE |
changeset 172 | 8f7f130ac31a |
parent 90 | 947f0dc9f7a8 |
child 257 | 3e88ff8f41d5 |
child 289 | 55a0a1279a7e |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// Trace API |
|
15 |
// |
|
16 |
||
17 |
#ifndef OPENSYSTEMTRACEV2_H |
|
18 |
#define OPENSYSTEMTRACEV2_H |
|
19 |
||
20 |
#include <opensystemtrace_types.h> |
|
21 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
22 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
23 |
This macro defines the version of the Open System Trace instrumentation API. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
24 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
25 |
#define OST_INSTRUMENTATION_API_VERSION 2.1.0 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
26 |
|
0 | 27 |
|
28 |
/** |
|
29 |
Methods for tracing from user side. |
|
30 |
||
31 |
These methods are used to output trace packets. |
|
32 |
Each trace packet consists of attributes and the user defined payload. |
|
33 |
||
34 |
In order to output trace packets, tracing needs to be |
|
35 |
included and enabled at compile time in the executable, |
|
36 |
as well as be filtered at run-time. |
|
37 |
||
38 |
Note: |
|
39 |
OSTv2 does not enforce any security. It is the developer's responsibility |
|
40 |
to ensure that trace packets do not contain any sensitive information that |
|
41 |
may undermine platform security. |
|
42 |
||
43 |
@file |
|
44 |
@publishedPartner |
|
45 |
@prototype |
|
46 |
*/ |
|
47 |
||
48 |
/** |
|
49 |
Class used to encapsulate the context of a trace point. |
|
50 |
For more information about the attributes please @see opensystemtrace_types.h. |
|
51 |
||
52 |
The attributes in @see TTraceContext are used to identify and filter the trace packet. |
|
53 |
@see opensystemtrace.mmh |
|
54 |
@see RUlogger for information on how to filter at run-time |
|
55 |
||
56 |
@deprecated |
|
57 |
*/ |
|
58 |
NONSHARABLE_CLASS(TTraceContext) |
|
59 |
{ |
|
60 |
public: |
|
61 |
inline TTraceContext(const TGroupId aGroupId); |
|
62 |
inline TTraceContext(const TGroupId aGroupId, const THasThreadIdentification aHasThreadIdentification, const THasProgramCounter aHasProgramCounter); |
|
63 |
||
64 |
inline TTraceContext(const TComponentId aComponentId, const TGroupId aGroupId); |
|
65 |
inline TTraceContext(const TComponentId aComponentId, const TGroupId aGroupId, const THasThreadIdentification aHasThreadIdentification, const THasProgramCounter aHasProgramCounter); |
|
66 |
||
67 |
IMPORT_C TComponentId ComponentId() const; |
|
68 |
IMPORT_C TClassification Classification() const; |
|
69 |
IMPORT_C TGroupId GroupId() const; |
|
70 |
IMPORT_C THasThreadIdentification HasThreadIdentification() const; |
|
71 |
IMPORT_C THasProgramCounter HasProgramCounter() const; |
|
72 |
IMPORT_C static TComponentId DefaultComponentId(); |
|
73 |
private: |
|
74 |
inline TTraceContext(){}; |
|
75 |
private: |
|
76 |
TComponentId iComponentId; ///<@see TComponentId |
|
77 |
TGroupId iGroupId; ///<@see TGroupId |
|
78 |
THasThreadIdentification iHasThreadIdentification; ///<@see THasThreadIdentification |
|
79 |
THasProgramCounter iHasProgramCounter; ///<@see THasProgramCounter |
|
80 |
TUint32 iReserved1; //Reserved for future use |
|
81 |
TUint32 iReserved2; //Reserved for future use |
|
82 |
}; |
|
83 |
||
84 |
IMPORT_C TBool OstPrint(const TTraceContext& aContext, const TDesC8& aDes); |
|
85 |
IMPORT_C TBool OstPrintf(const TTraceContext& aContext, const char* aFmt, ...); |
|
86 |
IMPORT_C TBool OstPrintf(const TTraceContext& aContext, TRefByValue<const TDesC8> aFmt,...); |
|
87 |
#ifndef __KERNEL_MODE__ |
|
88 |
IMPORT_C TBool OstPrint(const TTraceContext& aContext, const TDesC16& aDes); |
|
89 |
IMPORT_C TBool OstPrintf(const TTraceContext& aContext, TRefByValue<const TDesC16> aFmt,...); |
|
90 |
#endif //__KERNEL_MODE__ |
|
91 |
||
92 |
IMPORT_C TBool OstTrace(const TTraceContext& aContext, const TTraceId aTraceId); |
|
93 |
IMPORT_C TBool OstTrace(const TTraceContext& aContext, const TTraceId aTraceId, const TUint8 aData); |
|
94 |
IMPORT_C TBool OstTrace(const TTraceContext& aContext, const TTraceId aTraceId, const TUint16 aData); |
|
95 |
IMPORT_C TBool OstTrace(const TTraceContext& aContext, const TTraceId aTraceId, const TUint32 aData); |
|
96 |
IMPORT_C TBool OstTrace(const TTraceContext& aContext, const TTraceId aTraceId, const TUint32 aData1, const TUint32 aData2); |
|
97 |
IMPORT_C TBool OstTrace(const TTraceContext& aContext, const TTraceId aTraceId, const TDesC8& aData); |
|
98 |
#ifndef __KERNEL_MODE__ |
|
99 |
IMPORT_C TBool OstTrace(const TTraceContext& aContext, const TTraceId aTraceId, const TDesC16& aData); |
|
100 |
#endif |
|
101 |
template<typename T> |
|
102 |
static inline TBool OstTrace(const TTraceContext& aContext, const TTraceId aTraceId, const T& aData); |
|
103 |
IMPORT_C TBool OstTrace(const TTraceContext& aContext, const TTraceId aTraceId, const TAny* aData, const TInt aDataSize); |
|
104 |
||
105 |
IMPORT_C TBool IsTraceActive(const TTraceContext& aContext); |
|
106 |
||
107 |
||
108 |
/** |
|
109 |
The following trace APIs require a TraceCompiler to be present in the build system. |
|
110 |
This TraceCompiler is used to generate additional information for each trace point |
|
111 |
in order for traces to be generated at runtime. |
|
112 |
*/ |
|
113 |
||
114 |
#include <opensystemtrace.inl> |
|
115 |
||
116 |
// Macros |
|
117 |
||
118 |
/** |
|
119 |
Preprocessor category for all traces off. |
|
120 |
This should not be used from traces |
|
121 |
*/ |
|
122 |
#define OST_TRACE_CATEGORY_NONE 0x00000000 |
|
123 |
||
124 |
/** |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
125 |
Preprocessor category for traces that should be compiled |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
126 |
into all builds including UREL. As a result these traces |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
127 |
will end up in production images used by consumers. |
0 | 128 |
*/ |
129 |
#define OST_TRACE_CATEGORY_PRODUCTION 0x00000001 |
|
130 |
||
131 |
/** |
|
132 |
Preprocessor category for RnD traces |
|
133 |
*/ |
|
134 |
#define OST_TRACE_CATEGORY_RND 0x00000002 |
|
135 |
||
136 |
/** |
|
137 |
Preprocessor category for performance measurement traces |
|
138 |
*/ |
|
139 |
#define OST_TRACE_CATEGORY_PERFORMANCE_MEASUREMENT 0x00000004 |
|
140 |
||
141 |
/** |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
142 |
Preprocessor category for traces that by default should only |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
143 |
be compiled into UDEB builds. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
144 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
145 |
#define OST_TRACE_CATEGORY_DEBUG 0x00000008 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
146 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
147 |
/** |
0 | 148 |
Preprocessor level for all traces on. |
149 |
This should not be used from traces |
|
150 |
*/ |
|
151 |
#define OST_TRACE_CATEGORY_ALL 0xFFFFFFFF |
|
152 |
||
153 |
||
154 |
/** |
|
155 |
A flag, which specifies if the compiler has been run for the component |
|
156 |
*/ |
|
157 |
#if defined( OST_TRACE_COMPILER_IN_USE ) |
|
158 |
||
159 |
||
160 |
/** |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
161 |
The default preprocessor categories are defined here. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
162 |
A component may override this by defining |
0 | 163 |
OST_TRACE_CATEGORY before including this file |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
164 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
165 |
The RND category is defined for UREL and UDEB to |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
166 |
preserve source compatibility. |
0 | 167 |
*/ |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
168 |
#ifndef OST_TRACE_CATEGORY |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
169 |
#ifdef _DEBUG |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
170 |
#define OST_TRACE_CATEGORY (OST_TRACE_CATEGORY_RND | \ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
171 |
OST_TRACE_CATEGORY_PRODUCTION | \ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
172 |
OST_TRACE_CATEGORY_DEBUG) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
173 |
#else // _DEBUG |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
174 |
#define OST_TRACE_CATEGORY (OST_TRACE_CATEGORY_RND | \ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
175 |
OST_TRACE_CATEGORY_PRODUCTION) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
176 |
#endif // _DEBUG |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
177 |
#endif // OST_TRACE_CATEGORY |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
178 |
|
0 | 179 |
|
180 |
/** |
|
181 |
Trace with no parameters |
|
182 |
||
183 |
@param aCategory Preprocessor category for the trace |
|
184 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
185 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
186 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
187 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
188 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
189 |
The text itself is not sent in the trace packet |
|
190 |
*/ |
|
191 |
#define OstTraceDef0( aCategory, aGroupName, aTraceName, aTraceText ) \ |
|
192 |
do {if ( aCategory & OST_TRACE_CATEGORY ) \ |
|
193 |
BTraceFilteredContext8( EXTRACT_GROUP_ID(aTraceName), \ |
|
194 |
EOstTrace, \ |
|
195 |
KOstTraceComponentID, \ |
|
196 |
aTraceName );} while (0) |
|
197 |
||
198 |
||
199 |
/** |
|
200 |
Trace with one 32-bit parameter |
|
201 |
||
202 |
@param aCategory Preprocessor category for the trace |
|
203 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
204 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
205 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
206 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
207 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
208 |
The text itself is not sent in the trace packet |
|
209 |
@param aParam The 32-bit value to be traced |
|
210 |
*/ |
|
211 |
#define OstTraceDef1( aCategory, aGroupName, aTraceName, aTraceText, aParam ) \ |
|
212 |
do {if ( aCategory & OST_TRACE_CATEGORY ) \ |
|
213 |
BTraceFilteredContext12( EXTRACT_GROUP_ID(aTraceName), \ |
|
214 |
EOstTrace, \ |
|
215 |
KOstTraceComponentID, \ |
|
216 |
aTraceName, \ |
|
217 |
aParam );} while (0) |
|
218 |
||
219 |
||
220 |
/** |
|
221 |
Trace with more than 32 bits of data |
|
222 |
||
223 |
@param aCategory Preprocessor category for the trace |
|
224 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
225 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
226 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
227 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
228 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
229 |
The text itself is not sent in the trace packet |
|
230 |
@param aPtr Pointer to the data to be traced |
|
231 |
@param aLength Length of the data to be traced |
|
232 |
*/ |
|
233 |
#define OstTraceDefData( aCategory, aGroupName, aTraceName, aTraceText, aPtr, aLength ) \ |
|
234 |
do {if ( aCategory & OST_TRACE_CATEGORY ) \ |
|
235 |
OstSendNBytes( EXTRACT_GROUP_ID(aTraceName), \ |
|
236 |
EOstTrace, \ |
|
237 |
KOstTraceComponentID, \ |
|
238 |
aTraceName, \ |
|
239 |
aPtr, \ |
|
240 |
aLength );} while (0) |
|
241 |
||
242 |
||
243 |
/** |
|
244 |
Trace with one parameter that is not 32-bit integer. This calls OstTraceGen1, |
|
245 |
which is generated by the trace compiler. The generated function will pack the |
|
246 |
parameter into a stack-allocated buffer and call OstTraceData with the buffer. |
|
247 |
||
248 |
@param aCategory Preprocessor category for the trace |
|
249 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
250 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
251 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
252 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
253 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
254 |
The text itself is not sent in the trace packet |
|
255 |
@param aParam The parameter to be traced |
|
256 |
*/ |
|
257 |
#define OstTraceDefExt1( aCategory, aGroupName, aTraceName, aTraceText, aParam ) \ |
|
258 |
do {if ( aCategory & OST_TRACE_CATEGORY ) \ |
|
259 |
OstTraceGen1( aTraceName, aParam );} while (0) |
|
260 |
||
261 |
||
262 |
/** |
|
263 |
Trace with two parameters. This calls OstTraceGen2, which is generated by trace compiler. |
|
264 |
The generated function will pack the parameters into a stack-allocated buffer and |
|
265 |
call OstTraceData with the buffer. |
|
266 |
||
267 |
@param aCategory Preprocessor category for the trace |
|
268 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
269 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
270 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
271 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
272 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
273 |
The text itself is not sent in the trace packet |
|
274 |
@param aParam1 The first parameter to be traced |
|
275 |
@param aParam2 The second parameter to be traced |
|
276 |
*/ |
|
277 |
#define OstTraceDefExt2( aCategory, aGroupName, aTraceName, aTraceText, aParam1, aParam2 ) \ |
|
278 |
do {if ( aCategory & OST_TRACE_CATEGORY ) \ |
|
279 |
OstTraceGen2( aTraceName, aParam1, aParam2 );} while (0) |
|
280 |
||
281 |
||
282 |
/** |
|
283 |
Trace with three parameters. This calls OstTraceGen3, which is generated by trace compiler. |
|
284 |
The generated function will pack the parameters into a stack-allocated buffer and |
|
285 |
call OstTraceData with the buffer. |
|
286 |
||
287 |
@param aCategory Preprocessor category for the trace |
|
288 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
289 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
290 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
291 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
292 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
293 |
The text itself is not sent in the trace packet |
|
294 |
@param aParam1 The first parameter to be traced |
|
295 |
@param aParam2 The second parameter to be traced |
|
296 |
@param aParam3 The third parameter to be traced |
|
297 |
*/ |
|
298 |
#define OstTraceDefExt3( aCategory, aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 ) \ |
|
299 |
do {if ( aCategory & OST_TRACE_CATEGORY ) \ |
|
300 |
OstTraceGen3( aTraceName, aParam1, aParam2, aParam3 );} while (0) |
|
301 |
||
302 |
||
303 |
/** |
|
304 |
Trace with four parameters. This calls OstTraceGen4, which is generated by trace compiler. |
|
305 |
The generated function will pack the parameters into a stack-allocated buffer and |
|
306 |
call OstTraceData with the buffer. |
|
307 |
||
308 |
@param aCategory Preprocessor category for the trace |
|
309 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
310 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
311 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
312 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
313 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
314 |
The text itself is not sent in the trace packet |
|
315 |
@param aParam1 The first parameter to be traced |
|
316 |
@param aParam2 The second parameter to be traced |
|
317 |
@param aParam3 The third parameter to be traced |
|
318 |
@param aParam4 The fourth parameter to be traced |
|
319 |
*/ |
|
320 |
#define OstTraceDefExt4( aCategory, aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 ) \ |
|
321 |
do {if ( aCategory & OST_TRACE_CATEGORY ) \ |
|
322 |
OstTraceGen4( aTraceName, aParam1, aParam2, aParam3, aParam4 );} while (0) |
|
323 |
||
324 |
||
325 |
/** |
|
326 |
Trace with five parameters. This calls OstTraceGen5, which is generated by trace compiler. |
|
327 |
The generated function will pack the parameters into a stack-allocated buffer and |
|
328 |
call OstTraceData with the buffer. |
|
329 |
||
330 |
@param aCategory Preprocessor category for the trace |
|
331 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
332 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
333 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
334 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
335 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
336 |
The text itself is not sent in the trace packet |
|
337 |
@param aParam1 The first parameter to be traced |
|
338 |
@param aParam2 The second parameter to be traced |
|
339 |
@param aParam3 The third parameter to be traced |
|
340 |
@param aParam4 The fourth parameter to be traced |
|
341 |
@param aParam5 The fifth parameter to be traced |
|
342 |
*/ |
|
343 |
#define OstTraceDefExt5( aCategory, aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 ) \ |
|
344 |
do {if ( aCategory & OST_TRACE_CATEGORY ) \ |
|
345 |
OstTraceGen5( aTraceName, aParam1, aParam2, aParam3, aParam4, aParam5 );} while (0) |
|
346 |
||
347 |
||
348 |
/** |
|
349 |
*************** Trace macros which use RnD as default preprocessor category *************** |
|
350 |
*/ |
|
351 |
||
352 |
/** |
|
353 |
RnD trace with no parameters |
|
354 |
||
355 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
356 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
357 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
358 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
359 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
360 |
The text itself is not sent in the trace packet |
|
361 |
*/ |
|
362 |
#define OstTrace0( aGroupName, aTraceName, aTraceText ) \ |
|
363 |
OstTraceDef0( OST_TRACE_CATEGORY_RND, aGroupName, aTraceName, aTraceText ) |
|
364 |
||
365 |
||
366 |
/** |
|
367 |
RnD trace with one 32-bit parameter |
|
368 |
||
369 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
370 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
371 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
372 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
373 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
374 |
The text itself is not sent in the trace packet |
|
375 |
@param aParam The 32-bit value to be traced |
|
376 |
*/ |
|
377 |
#define OstTrace1( aGroupName, aTraceName, aTraceText, aParam ) \ |
|
378 |
OstTraceDef1( OST_TRACE_CATEGORY_RND, aGroupName, aTraceName, aTraceText, aParam ) |
|
379 |
||
380 |
||
381 |
/** |
|
382 |
RnD trace with more than 32 bits of data |
|
383 |
||
384 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
385 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
386 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
387 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
388 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
389 |
The text itself is not sent in the trace packet |
|
390 |
@param aPtr Pointer to the data to be traced |
|
391 |
@param aLength Length of the data to be traced |
|
392 |
*/ |
|
393 |
#define OstTraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength ) \ |
|
394 |
OstTraceDefData( OST_TRACE_CATEGORY_RND, aGroupName, aTraceName, aTraceText, aPtr, aLength ) |
|
395 |
||
396 |
||
397 |
/** |
|
398 |
RnD trace with one parameter that is not 32-bit integer. This calls OstTraceGen1, |
|
399 |
which is generated by the trace compiler. The generated function will pack the |
|
400 |
parameter into a stack-allocated buffer and call OstTraceData with the buffer. |
|
401 |
||
402 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
403 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
404 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
405 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
406 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
407 |
The text itself is not sent in the trace packet |
|
408 |
@param aParam The parameter to be traced |
|
409 |
*/ |
|
410 |
#define OstTraceExt1( aGroupName, aTraceName, aTraceText, aParam ) \ |
|
411 |
OstTraceDefExt1( OST_TRACE_CATEGORY_RND, aGroupName, aTraceName, aTraceText, aParam ) |
|
412 |
||
413 |
||
414 |
/** |
|
415 |
RnD trace with two parameters. This calls OstTraceGen2, which is generated by trace compiler. |
|
416 |
The generated function will pack the parameters into a stack-allocated buffer and |
|
417 |
call OstTraceData with the buffer. |
|
418 |
||
419 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
420 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
421 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
422 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
423 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
424 |
The text itself is not sent in the trace packet |
|
425 |
@param aParam1 The first parameter to be traced |
|
426 |
@param aParam2 The second parameter to be traced |
|
427 |
*/ |
|
428 |
#define OstTraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 ) \ |
|
429 |
OstTraceDefExt2( OST_TRACE_CATEGORY_RND, aGroupName, aTraceName, aTraceText, aParam1, aParam2 ) |
|
430 |
||
431 |
||
432 |
/** |
|
433 |
RnD trace with three parameters. This calls OstTraceGen3, which is generated by trace compiler. |
|
434 |
The generated function will pack the parameters into a stack-allocated buffer and |
|
435 |
call OstTraceData with the buffer. |
|
436 |
||
437 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
438 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
439 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
440 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
441 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
442 |
The text itself is not sent in the trace packet |
|
443 |
@param aParam1 The first parameter to be traced |
|
444 |
@param aParam2 The second parameter to be traced |
|
445 |
@param aParam3 The third parameter to be traced |
|
446 |
*/ |
|
447 |
#define OstTraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 ) \ |
|
448 |
OstTraceDefExt3( OST_TRACE_CATEGORY_RND, aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 ) |
|
449 |
||
450 |
||
451 |
/** |
|
452 |
RnD trace with four parameters. This calls OstTraceGen4, which is generated by trace compiler. |
|
453 |
The generated function will pack the parameters into a stack-allocated buffer and |
|
454 |
call OstTraceData with the buffer. |
|
455 |
||
456 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
457 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
458 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
459 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
460 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
461 |
The text itself is not sent in the trace packet |
|
462 |
@param aParam1 The first parameter to be traced |
|
463 |
@param aParam2 The second parameter to be traced |
|
464 |
@param aParam3 The third parameter to be traced |
|
465 |
@param aParam4 The fourth parameter to be traced |
|
466 |
*/ |
|
467 |
#define OstTraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 ) \ |
|
468 |
OstTraceDefExt4( OST_TRACE_CATEGORY_RND, aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 ) |
|
469 |
||
470 |
||
471 |
/** |
|
472 |
RnD trace with five parameters. This calls OstTraceGen5, which is generated by trace compiler. |
|
473 |
The generated function will pack the parameters into a stack-allocated buffer and |
|
474 |
call OstTraceData with the buffer. |
|
475 |
||
476 |
@param aGroupName Name of the trace group. Trace Compiler associates the group name with a 16-bit integer. |
|
477 |
Then, it combines the group name with a unique trace id (16-bit integer) to produce the trace name |
|
478 |
(aTraceName 32-bit integer). Only the trace name is sent in the trace packet. |
|
479 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
480 |
@param aTraceText The trace text, which is parsed by the trace compiler. |
|
481 |
The text itself is not sent in the trace packet |
|
482 |
@param aParam1 The first parameter to be traced |
|
483 |
@param aParam2 The second parameter to be traced |
|
484 |
@param aParam3 The third parameter to be traced |
|
485 |
@param aParam4 The fourth parameter to be traced |
|
486 |
@param aParam5 The fifth parameter to be traced |
|
487 |
*/ |
|
488 |
#define OstTraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 ) \ |
|
489 |
OstTraceDefExt5( OST_TRACE_CATEGORY_RND, aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 ) |
|
490 |
||
491 |
||
492 |
/** |
|
493 |
Function entry trace without extra parameters. |
|
494 |
The trace is mapped to TRACE_FLOW or TRACE_API group by the trace compiler |
|
495 |
||
496 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
497 |
*/ |
|
498 |
#define OstTraceFunctionEntry0( aTraceName ) \ |
|
499 |
do {if ( OST_TRACE_CATEGORY_RND & OST_TRACE_CATEGORY ) \ |
|
500 |
BTraceFilteredContext8( EXTRACT_GROUP_ID(aTraceName), \ |
|
501 |
EOstTrace, \ |
|
502 |
KOstTraceComponentID, \ |
|
503 |
aTraceName );} while (0) |
|
504 |
||
505 |
||
506 |
/** |
|
507 |
Function entry trace with a parameter representing the instance identifier. |
|
508 |
The trace is mapped to TRACE_FLOW or TRACE_API group by the trace compiler |
|
509 |
||
510 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
511 |
@param aInstance The instance identifier, for example "this" pointer |
|
512 |
*/ |
|
513 |
#define OstTraceFunctionEntry1( aTraceName, aInstance ) \ |
|
514 |
do {if ( OST_TRACE_CATEGORY_RND & OST_TRACE_CATEGORY ) \ |
|
515 |
BTraceFilteredContext12( EXTRACT_GROUP_ID(aTraceName), \ |
|
516 |
EOstTrace, \ |
|
517 |
KOstTraceComponentID, \ |
|
518 |
aTraceName, \ |
|
519 |
(TUint32) aInstance );} while (0) |
|
520 |
||
521 |
||
522 |
/** |
|
523 |
Function entry trace, which traces function parameters. |
|
524 |
The trace is mapped to TRACE_FLOW or TRACE_API group by the trace compiler |
|
525 |
||
526 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
527 |
@param aInstance Name of the instance identifier |
|
528 |
*/ |
|
529 |
#define OstTraceFunctionEntryExt( aTraceName, aInstance ) \ |
|
530 |
do {if ( OST_TRACE_CATEGORY_RND & OST_TRACE_CATEGORY ) \ |
|
531 |
OstTraceGenExt( aTraceName, ( TUint )aInstance );} while (0) |
|
532 |
||
533 |
||
534 |
/** |
|
535 |
Function exit trace without extra parameters. |
|
536 |
The trace is mapped to TRACE_FLOW or TRACE_API group by the trace compiler |
|
537 |
||
538 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
539 |
*/ |
|
540 |
#define OstTraceFunctionExit0( aTraceName ) \ |
|
541 |
do {if ( OST_TRACE_CATEGORY_RND & OST_TRACE_CATEGORY ) \ |
|
542 |
BTraceFilteredContext8( EXTRACT_GROUP_ID(aTraceName), \ |
|
543 |
EOstTrace, \ |
|
544 |
KOstTraceComponentID, \ |
|
545 |
aTraceName );} while (0) |
|
546 |
||
547 |
||
548 |
/** |
|
549 |
Function exit trace with a parameter representing the instance identifier. |
|
550 |
The trace is mapped to TRACE_FLOW or TRACE_API group by the trace compiler |
|
551 |
||
552 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
553 |
@param aInstance The instance identifier, for example "this" pointer |
|
554 |
*/ |
|
555 |
#define OstTraceFunctionExit1( aTraceName, aInstance ) \ |
|
556 |
do {if ( OST_TRACE_CATEGORY_RND & OST_TRACE_CATEGORY ) \ |
|
557 |
BTraceFilteredContext12( EXTRACT_GROUP_ID(aTraceName), \ |
|
558 |
EOstTrace, \ |
|
559 |
KOstTraceComponentID, \ |
|
560 |
aTraceName, \ |
|
561 |
(TUint32) aInstance );} while (0) |
|
562 |
||
563 |
||
564 |
/** |
|
565 |
Function exit trace with a parameters representing the instance identifier and return value. |
|
566 |
The trace is mapped to TRACE_FLOW or TRACE_API group by the trace compiler |
|
567 |
||
568 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
569 |
@param aInstance The instance identifier, for example "this" pointer |
|
570 |
@param aRetval The function return value |
|
571 |
*/ |
|
572 |
#define OstTraceFunctionExitExt( aTraceName, aInstance, aRetval ) \ |
|
573 |
do {if ( OST_TRACE_CATEGORY_RND & OST_TRACE_CATEGORY ) \ |
|
574 |
OstTraceGen2( aTraceName, ( TUint )aInstance, aRetval );} while (0) |
|
575 |
||
576 |
||
577 |
/** |
|
578 |
Performance measurement event start trace without extra parameters. |
|
579 |
The trace is mapped to TRACE_PERFORMANCE group by the trace compiler |
|
580 |
||
581 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
582 |
@param aEventName The name of the event. A corresponding OstTraceEventStop call must be made later in code |
|
583 |
*/ |
|
584 |
#define OstTraceEventStart0( aTraceName, aEventName ) \ |
|
585 |
OstTraceDef1( OST_TRACE_CATEGORY_RND, "TRACE_PERFORMANCE", aTraceName, null, (TInt32)1 ) |
|
586 |
||
587 |
||
588 |
/** |
|
589 |
Performance measurement event start trace with single 32-bit parameter. |
|
590 |
The trace is mapped to TRACE_PERFORMANCE group by the trace compiler |
|
591 |
||
592 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
593 |
@param aEventName The name of the event. A corresponding OstTraceEventStop call must be made later in code |
|
594 |
@param aParam The parameter to be associated to the event |
|
595 |
*/ |
|
596 |
#define OstTraceEventStart1( aTraceName, aEventName, aParam ) \ |
|
597 |
OstTraceDef1( OST_TRACE_CATEGORY_RND, "TRACE_PERFORMANCE", aTraceName, null, aParam ) |
|
598 |
||
599 |
||
600 |
/** |
|
601 |
Performance measurement event end trace. |
|
602 |
The trace is mapped to TRACE_PERFORMANCE group by the trace compiler |
|
603 |
||
604 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
605 |
@param aEventName The name of the event. Must match a name passed to OstTraceEventStart |
|
606 |
@param aStartTraceName Event start trace name. Must match a Trace Name of OstTraceEventStart trace |
|
607 |
*/ |
|
608 |
#define OstTraceEventStop( aTraceName, aEventName, aStartTraceName ) \ |
|
609 |
OstTraceDefExt2( OST_TRACE_CATEGORY_RND, "TRACE_PERFORMANCE", aTraceName, null, (TInt32)0, (TUint32)(aStartTraceName & 0xFFFF) ) |
|
610 |
||
611 |
||
612 |
/** |
|
613 |
State transition event. |
|
614 |
The trace is mapped to TRACE_STATE group by the trace compiler |
|
615 |
||
616 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
617 |
@param aStateName The name of the state, literal string (for example "name") |
|
618 |
@param aNewState The new value for the state, literal string (for example "value") |
|
619 |
*/ |
|
620 |
#define OstTraceState0( aTraceName, aStateName, aNewState ) \ |
|
621 |
OstTraceDefExt2( OST_TRACE_CATEGORY_RND, "TRACE_STATE", aTraceName, null, _L8(aStateName), _L8(aNewState) ) |
|
622 |
||
623 |
||
624 |
/** |
|
625 |
State transition event with instance identifier. |
|
626 |
The trace is mapped to TRACE_STATE group by the trace compiler |
|
627 |
||
628 |
@param aTraceName Name of the trace. The name is mapped to a 32-bit identifier and thus must be unique |
|
629 |
@param aStateName The name of the state, literal string (for example "name") |
|
630 |
@param aNewState The new value for the state, literal string (for example "value") |
|
631 |
@param aInstance The instance identifier, for example "this" pointer |
|
632 |
*/ |
|
633 |
#define OstTraceState1( aTraceName, aStateName, aNewState, aInstance ) \ |
|
634 |
OstTraceDefExt3( OST_TRACE_CATEGORY_RND, "TRACE_STATE", aTraceName, null, _L8(aStateName), _L8(aNewState), (TUint32) aInstance ) |
|
635 |
||
636 |
#else // OST_TRACE_COMPILER_IN_USE |
|
637 |
||
638 |
/** |
|
639 |
API is defined empty if the trace compiler has not been run |
|
640 |
*/ |
|
641 |
||
642 |
#define OstTraceDef0( aCategory, aGroupName, aTraceName, aTraceText ) |
|
643 |
#define OstTraceDef1( aCategory, aGroupName, aTraceName, aTraceText, aParam ) |
|
644 |
#define OstTraceDefData( aCategory, aGroupName, aTraceName, aTraceText, aPtr, aLength ) |
|
645 |
#define OstTraceDefExt1( aCategory, aGroupName, aTraceName, aTraceText, aParam ) |
|
646 |
#define OstTraceDefExt2( aCategory, aGroupName, aTraceName, aTraceText, aParam1, aParam2 ) |
|
647 |
#define OstTraceDefExt3( aCategory, aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 ) |
|
648 |
#define OstTraceDefExt4( aCategory, aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 ) |
|
649 |
#define OstTraceDefExt5( aCategory, aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 ) |
|
650 |
||
651 |
#define OstTrace0( aGroupName, aTraceName, aTraceText ) |
|
652 |
#define OstTrace1( aGroupName, aTraceName, aTraceText, aParam ) |
|
653 |
#define OstTraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength ) |
|
654 |
#define OstTraceExt1( aGroupName, aTraceName, aTraceText, aParam ) |
|
655 |
#define OstTraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 ) |
|
656 |
#define OstTraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 ) |
|
657 |
#define OstTraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 ) |
|
658 |
#define OstTraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 ) |
|
659 |
||
660 |
#define OstTraceFunctionEntry0( aTraceName ) |
|
661 |
#define OstTraceFunctionEntry1( aTraceName, aInstance ) |
|
662 |
#define OstTraceFunctionEntryExt(aTraceName, aInstance) |
|
663 |
#define OstTraceFunctionExit0( aTraceName ) |
|
664 |
#define OstTraceFunctionExit1( aTraceName, aInstance ) |
|
665 |
#define OstTraceEventStart0( aTraceName, aEventName ) |
|
666 |
#define OstTraceEventStart1( aTraceName, aEventName, aParam ) |
|
667 |
#define OstTraceFunctionExitExt(aTraceName, aInstance, aRetval) |
|
668 |
#define OstTraceEventStop( aTraceName, aEventName, aStartTraceName ) |
|
669 |
#define OstTraceState0( aTraceName, aStateName, aNewState ) |
|
670 |
#define OstTraceState1( aTraceName, aStateName, aNewState, aInstance ) |
|
671 |
||
672 |
#endif // OST_TRACE_COMPILER_IN_USE |
|
673 |
||
674 |
||
675 |
// Data types |
|
676 |
||
677 |
/** |
|
678 |
BTrace sub-category IDs for OpenSystemTrace category |
|
679 |
*/ |
|
680 |
enum TSubcategoryOpenSystemTrace |
|
681 |
{ |
|
682 |
/** |
|
683 |
* Normal trace |
|
684 |
*/ |
|
685 |
EOstTrace = 0, |
|
686 |
||
687 |
/** |
|
688 |
* Queries if trace is active without sending it |
|
689 |
*/ |
|
690 |
EOstTraceActivationQuery = 1 |
|
691 |
}; |
|
692 |
||
693 |
// Forward declarations |
|
694 |
||
695 |
/** |
|
696 |
Template class for array parameter types |
|
697 |
For example, to wrap an integer array to a trace: |
|
698 |
TInt arr[5]; |
|
699 |
OstTraceExt( GRP, TRC, "Array: %{int32[]}", TOstArray< TInt >( arr, 5 ) ); |
|
700 |
*/ |
|
701 |
template< class T > |
|
702 |
class TOstArray |
|
703 |
{ |
|
704 |
public: |
|
705 |
/** |
|
706 |
* Constructor |
|
707 |
* |
|
708 |
* @param aArray the array data |
|
709 |
* @param aLength the number of elements in the array |
|
710 |
*/ |
|
711 |
TOstArray( const T* aArray, TInt aLength ) : iArray( aArray ), iLength( aLength ) {} |
|
712 |
||
713 |
/** |
|
714 |
* Gets the array data pointer. |
|
715 |
* Used from the functions generated by trace compiler |
|
716 |
* |
|
717 |
* @return The array data pointer. |
|
718 |
*/ |
|
719 |
const T* Ptr() const { return iArray; } |
|
720 |
||
721 |
/** |
|
722 |
* Gets the number of elements in the array. |
|
723 |
* Used from the functions generated by trace compiler |
|
724 |
* |
|
725 |
* @return The number of elements in the array. |
|
726 |
*/ |
|
727 |
TInt Length() const { return iLength; } |
|
728 |
||
729 |
/** |
|
730 |
* Gets the number of bytes occupied by the array. |
|
731 |
* Used from the functions generated by trace compiler |
|
732 |
* |
|
733 |
* @return The number of bytes occupied by the array. |
|
734 |
*/ |
|
735 |
TInt Size() const { return sizeof( T ) * iLength; } |
|
736 |
||
737 |
private: |
|
738 |
/** |
|
739 |
* Array data |
|
740 |
*/ |
|
741 |
const T* iArray; |
|
742 |
||
743 |
/** |
|
744 |
* Array length, as number of elements |
|
745 |
*/ |
|
746 |
TInt iLength; |
|
747 |
}; |
|
748 |
||
749 |
||
750 |
// Class declaration |
|
751 |
||
752 |
#endif //OPENSYSTEMTRACEV2_H |