|
1 // Created by TraceCompiler 1.3.1 |
|
2 // DO NOT EDIT, CHANGES WILL BE LOST |
|
3 |
|
4 #ifndef __TE_INSTRUMENTATIONPOINTS_ENABLEDTRACES_H__ |
|
5 #define __TE_INSTRUMENTATIONPOINTS_ENABLEDTRACES_H__ |
|
6 |
|
7 #define KOstTraceComponentID 0x1028722e |
|
8 |
|
9 #define TEST_OstTraceDef0 0x810001 |
|
10 #define TEST_OstTraceDef1 0x810002 |
|
11 #define TEST_OstTraceDefData 0x810003 |
|
12 #define TEST_OstTraceDefExt1 0x810004 |
|
13 #define TEST_OstTraceDefExt2 0x810005 |
|
14 #define TEST_OstTraceDefExt3 0x810006 |
|
15 #define TEST_OstTraceDefExt4 0x810007 |
|
16 #define TEST_OstTraceDefExt5 0x810008 |
|
17 #define TEST_OSTTRACE0 0x810009 |
|
18 #define TEST_OSTTRACE1 0x81000a |
|
19 #define TEST_OSTTRACEDATA 0x81000b |
|
20 #define TEST_OSTTRACEEXT1 0x81000c |
|
21 #define TEST_OSTTRACEEXT2 0x81000d |
|
22 #define TEST_OSTTRACEEXT3 0x81000e |
|
23 #define TEST_OSTTRACEEXT4 0x81000f |
|
24 #define TEST_OSTTRACEEXT5 0x810010 |
|
25 #define TEST_OSTTRACEDATA96 0x810011 |
|
26 #define TEST_OSTTRACEDATA1000 0x810012 |
|
27 #define TEST_OSTTraceFunctionalityEntry0 0x8a0001 |
|
28 #define TEST_OSTTraceFunctionalityEntry1 0x8a0002 |
|
29 #define TEST_OSTTraceFunctionalityExt 0x8a0003, ( TUint )&( aApiRunConfig ), ( TUint )&( aApiRunResults ) |
|
30 #define TEST_OstTraceFunctionExit0 0x8a0004 |
|
31 #define TEST_OSTTRACEFUNCTIONEXIT1 0x8a0005 |
|
32 #define TEST_OSTTRACEFUNCTIONEXITEXT 0x8a0006 |
|
33 #define TEST_OSTTRACEEVENTSTART0 0x8b0001 |
|
34 #define TEST_OSTTRACEEVENTSTART1 0x8b0002 |
|
35 #define TEST_OSTTRACEEVENTSTOP 0x8b0003 |
|
36 #define TEST_OSTTRACESTATE0 0x870001 |
|
37 #define TEST_OSTTRACESTATE1 0x870002 |
|
38 |
|
39 |
|
40 inline TBool OstTraceGen1( TUint32 aTraceID, const TDesC8& aParam1 ) |
|
41 { |
|
42 TBool retval; |
|
43 TInt size = aParam1.Size(); |
|
44 // BTrace assumes that parameter size is atleast 4 bytes |
|
45 if (size % 4 == 0) |
|
46 { |
|
47 TUint8* ptr = ( TUint8* )aParam1.Ptr(); |
|
48 // Data is written directly and length is determined from trace message length |
|
49 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size ); |
|
50 } |
|
51 else |
|
52 { |
|
53 TUint8 data[ KOstMaxDataLength ]; |
|
54 TUint8* ptr = data; |
|
55 if (size > KOstMaxDataLength) |
|
56 { |
|
57 size = KOstMaxDataLength; |
|
58 } |
|
59 TInt sizeAligned = ( size + 3 ) & ~3; |
|
60 memcpy( ptr, aParam1.Ptr(), size ); |
|
61 ptr += size; |
|
62 // Fillers are written to get 32-bit alignment |
|
63 while ( size++ < sizeAligned ) |
|
64 { |
|
65 *ptr++ = 0; |
|
66 } |
|
67 ptr -= sizeAligned; |
|
68 size = sizeAligned; |
|
69 // Data is written directly and length is determined from trace message length |
|
70 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size ); |
|
71 } |
|
72 return retval; |
|
73 } |
|
74 |
|
75 |
|
76 inline TBool OstTraceGen2( TUint32 aTraceID, TUint aParam1, TUint aParam2 ) |
|
77 { |
|
78 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
79 if ( retval ) |
|
80 { |
|
81 TUint8 data[ 8 ]; |
|
82 TUint8* ptr = data; |
|
83 *( ( TUint* )ptr ) = aParam1; |
|
84 ptr += sizeof ( TUint ); |
|
85 *( ( TUint* )ptr ) = aParam2; |
|
86 ptr += sizeof ( TUint ); |
|
87 ptr -= 8; |
|
88 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 8 ); |
|
89 } |
|
90 return retval; |
|
91 } |
|
92 |
|
93 inline TBool OstTraceGen2( TUint32 aTraceID, TUint32 aParam1, TUint32 aParam2 ) |
|
94 { |
|
95 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
96 if ( retval ) |
|
97 { |
|
98 TUint8 data[ 8 ]; |
|
99 TUint8* ptr = data; |
|
100 *( ( TUint* )ptr ) = aParam1; |
|
101 ptr += sizeof ( TUint ); |
|
102 *( ( TUint* )ptr ) = aParam2; |
|
103 ptr += sizeof ( TUint ); |
|
104 ptr -= 8; |
|
105 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 8 ); |
|
106 } |
|
107 return retval; |
|
108 } |
|
109 |
|
110 |
|
111 inline TBool OstTraceGen3( TUint32 aTraceID, TUint aParam1, TUint aParam2, TUint aParam3 ) |
|
112 { |
|
113 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
114 if ( retval ) |
|
115 { |
|
116 TUint8 data[ 12 ]; |
|
117 TUint8* ptr = data; |
|
118 *( ( TUint* )ptr ) = aParam1; |
|
119 ptr += sizeof ( TUint ); |
|
120 *( ( TUint* )ptr ) = aParam2; |
|
121 ptr += sizeof ( TUint ); |
|
122 *( ( TUint* )ptr ) = aParam3; |
|
123 ptr += sizeof ( TUint ); |
|
124 ptr -= 12; |
|
125 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 12 ); |
|
126 } |
|
127 return retval; |
|
128 } |
|
129 |
|
130 inline TBool OstTraceGen3( TUint32 aTraceID, TUint32 aParam1, TUint32 aParam2, TUint32 aParam3 ) |
|
131 { |
|
132 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
133 if ( retval ) |
|
134 { |
|
135 TUint8 data[ 12 ]; |
|
136 TUint8* ptr = data; |
|
137 *( ( TUint* )ptr ) = aParam1; |
|
138 ptr += sizeof ( TUint ); |
|
139 *( ( TUint* )ptr ) = aParam2; |
|
140 ptr += sizeof ( TUint ); |
|
141 *( ( TUint* )ptr ) = aParam3; |
|
142 ptr += sizeof ( TUint ); |
|
143 ptr -= 12; |
|
144 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 12 ); |
|
145 } |
|
146 return retval; |
|
147 } |
|
148 |
|
149 |
|
150 inline TBool OstTraceGen4( TUint32 aTraceID, TUint aParam1, TUint aParam2, TUint aParam3, TUint aParam4 ) |
|
151 { |
|
152 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
153 if ( retval ) |
|
154 { |
|
155 TUint8 data[ 16 ]; |
|
156 TUint8* ptr = data; |
|
157 *( ( TUint* )ptr ) = aParam1; |
|
158 ptr += sizeof ( TUint ); |
|
159 *( ( TUint* )ptr ) = aParam2; |
|
160 ptr += sizeof ( TUint ); |
|
161 *( ( TUint* )ptr ) = aParam3; |
|
162 ptr += sizeof ( TUint ); |
|
163 *( ( TUint* )ptr ) = aParam4; |
|
164 ptr += sizeof ( TUint ); |
|
165 ptr -= 16; |
|
166 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 16 ); |
|
167 } |
|
168 return retval; |
|
169 } |
|
170 |
|
171 inline TBool OstTraceGen4( TUint32 aTraceID, TUint32 aParam1, TUint32 aParam2, TUint32 aParam3, TUint32 aParam4 ) |
|
172 { |
|
173 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
174 if ( retval ) |
|
175 { |
|
176 TUint8 data[ 16 ]; |
|
177 TUint8* ptr = data; |
|
178 *( ( TUint* )ptr ) = aParam1; |
|
179 ptr += sizeof ( TUint ); |
|
180 *( ( TUint* )ptr ) = aParam2; |
|
181 ptr += sizeof ( TUint ); |
|
182 *( ( TUint* )ptr ) = aParam3; |
|
183 ptr += sizeof ( TUint ); |
|
184 *( ( TUint* )ptr ) = aParam4; |
|
185 ptr += sizeof ( TUint ); |
|
186 ptr -= 16; |
|
187 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 16 ); |
|
188 } |
|
189 return retval; |
|
190 } |
|
191 |
|
192 |
|
193 inline TBool OstTraceGen5( TUint32 aTraceID, TUint aParam1, TUint aParam2, TUint aParam3, TUint aParam4, TUint aParam5 ) |
|
194 { |
|
195 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
196 if ( retval ) |
|
197 { |
|
198 TUint8 data[ 20 ]; |
|
199 TUint8* ptr = data; |
|
200 *( ( TUint* )ptr ) = aParam1; |
|
201 ptr += sizeof ( TUint ); |
|
202 *( ( TUint* )ptr ) = aParam2; |
|
203 ptr += sizeof ( TUint ); |
|
204 *( ( TUint* )ptr ) = aParam3; |
|
205 ptr += sizeof ( TUint ); |
|
206 *( ( TUint* )ptr ) = aParam4; |
|
207 ptr += sizeof ( TUint ); |
|
208 *( ( TUint* )ptr ) = aParam5; |
|
209 ptr += sizeof ( TUint ); |
|
210 ptr -= 20; |
|
211 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 20 ); |
|
212 } |
|
213 return retval; |
|
214 } |
|
215 |
|
216 inline TBool OstTraceGen5( TUint32 aTraceID, TUint32 aParam1, TUint32 aParam2, TUint32 aParam3, TUint32 aParam4, TUint32 aParam5 ) |
|
217 { |
|
218 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
219 if ( retval ) |
|
220 { |
|
221 TUint8 data[ 20 ]; |
|
222 TUint8* ptr = data; |
|
223 *( ( TUint* )ptr ) = aParam1; |
|
224 ptr += sizeof ( TUint ); |
|
225 *( ( TUint* )ptr ) = aParam2; |
|
226 ptr += sizeof ( TUint ); |
|
227 *( ( TUint* )ptr ) = aParam3; |
|
228 ptr += sizeof ( TUint ); |
|
229 *( ( TUint* )ptr ) = aParam4; |
|
230 ptr += sizeof ( TUint ); |
|
231 *( ( TUint* )ptr ) = aParam5; |
|
232 ptr += sizeof ( TUint ); |
|
233 ptr -= 20; |
|
234 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 20 ); |
|
235 } |
|
236 return retval; |
|
237 } |
|
238 |
|
239 |
|
240 inline TBool OstTraceGen1( TUint32 aTraceID, TInt8 aParam1 ) |
|
241 { |
|
242 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
243 if ( retval ) |
|
244 { |
|
245 TUint8 data[ 4 ]; |
|
246 TUint8* ptr = data; |
|
247 *( ( TInt8* )ptr ) = aParam1; |
|
248 ptr += sizeof ( TInt8 ); |
|
249 *( ( TUint8* )ptr ) = 0; |
|
250 ptr += sizeof ( TUint8 ); |
|
251 *( ( TUint8* )ptr ) = 0; |
|
252 ptr += sizeof ( TUint8 ); |
|
253 *( ( TUint8* )ptr ) = 0; |
|
254 ptr += sizeof ( TUint8 ); |
|
255 ptr -= 4; |
|
256 retval = BTraceFilteredContext12( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, *( ( TUint32* )ptr ) ); |
|
257 } |
|
258 return retval; |
|
259 } |
|
260 |
|
261 |
|
262 inline TBool OstTraceGenExt( TUint32 aTraceID, TUint aParam1, TUint aParam2, TUint aParam3 ) |
|
263 { |
|
264 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
265 if ( retval ) |
|
266 { |
|
267 TUint8 data[ 12 ]; |
|
268 TUint8* ptr = data; |
|
269 *( ( TUint* )ptr ) = aParam1; |
|
270 ptr += sizeof ( TUint ); |
|
271 *( ( TUint* )ptr ) = aParam2; |
|
272 ptr += sizeof ( TUint ); |
|
273 *( ( TUint* )ptr ) = aParam3; |
|
274 ptr += sizeof ( TUint ); |
|
275 ptr -= 12; |
|
276 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 12 ); |
|
277 } |
|
278 return retval; |
|
279 } |
|
280 |
|
281 inline TBool OstTraceGenExt( TUint32 aTraceID, TUint32 aParam1, TUint32 aParam2, TUint32 aParam3 ) |
|
282 { |
|
283 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
284 if ( retval ) |
|
285 { |
|
286 TUint8 data[ 12 ]; |
|
287 TUint8* ptr = data; |
|
288 *( ( TUint* )ptr ) = aParam1; |
|
289 ptr += sizeof ( TUint ); |
|
290 *( ( TUint* )ptr ) = aParam2; |
|
291 ptr += sizeof ( TUint ); |
|
292 *( ( TUint* )ptr ) = aParam3; |
|
293 ptr += sizeof ( TUint ); |
|
294 ptr -= 12; |
|
295 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 12 ); |
|
296 } |
|
297 return retval; |
|
298 } |
|
299 |
|
300 |
|
301 inline TBool OstTraceGen2( TUint32 aTraceID, TUint aParam1, TInt aParam2 ) |
|
302 { |
|
303 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
304 if ( retval ) |
|
305 { |
|
306 TUint8 data[ 8 ]; |
|
307 TUint8* ptr = data; |
|
308 *( ( TUint* )ptr ) = aParam1; |
|
309 ptr += sizeof ( TUint ); |
|
310 *( ( TInt* )ptr ) = aParam2; |
|
311 ptr += sizeof ( TInt ); |
|
312 ptr -= 8; |
|
313 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 8 ); |
|
314 } |
|
315 return retval; |
|
316 } |
|
317 |
|
318 inline TBool OstTraceGen2( TUint32 aTraceID, TUint32 aParam1, TInt32 aParam2 ) |
|
319 { |
|
320 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
321 if ( retval ) |
|
322 { |
|
323 TUint8 data[ 8 ]; |
|
324 TUint8* ptr = data; |
|
325 *( ( TUint* )ptr ) = aParam1; |
|
326 ptr += sizeof ( TUint ); |
|
327 *( ( TInt* )ptr ) = aParam2; |
|
328 ptr += sizeof ( TInt ); |
|
329 ptr -= 8; |
|
330 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 8 ); |
|
331 } |
|
332 return retval; |
|
333 } |
|
334 |
|
335 |
|
336 inline TBool OstTraceGen2( TUint32 aTraceID, TInt aParam1, TUint aParam2 ) |
|
337 { |
|
338 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
339 if ( retval ) |
|
340 { |
|
341 TUint8 data[ 8 ]; |
|
342 TUint8* ptr = data; |
|
343 *( ( TInt* )ptr ) = aParam1; |
|
344 ptr += sizeof ( TInt ); |
|
345 *( ( TUint* )ptr ) = aParam2; |
|
346 ptr += sizeof ( TUint ); |
|
347 ptr -= 8; |
|
348 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 8 ); |
|
349 } |
|
350 return retval; |
|
351 } |
|
352 |
|
353 inline TBool OstTraceGen2( TUint32 aTraceID, TInt32 aParam1, TUint32 aParam2 ) |
|
354 { |
|
355 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
356 if ( retval ) |
|
357 { |
|
358 TUint8 data[ 8 ]; |
|
359 TUint8* ptr = data; |
|
360 *( ( TInt* )ptr ) = aParam1; |
|
361 ptr += sizeof ( TInt ); |
|
362 *( ( TUint* )ptr ) = aParam2; |
|
363 ptr += sizeof ( TUint ); |
|
364 ptr -= 8; |
|
365 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, 8 ); |
|
366 } |
|
367 return retval; |
|
368 } |
|
369 |
|
370 |
|
371 inline TBool OstTraceGen2( TUint32 aTraceID, const TDesC8& aParam1, const TDesC8& aParam2 ) |
|
372 { |
|
373 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
374 if ( retval ) |
|
375 { |
|
376 TInt length = 0; |
|
377 // Check that parameter lenght is not too long |
|
378 TInt length1 = aParam1.Size(); |
|
379 if ((length + length1 + sizeof ( TUint32 )) > KOstMaxDataLength) |
|
380 { |
|
381 length1 = KOstMaxDataLength - (length + sizeof ( TUint32 )); |
|
382 } |
|
383 TInt lengthAligned1 = ( length1 + 3 ) & ~3; |
|
384 if (lengthAligned1 > 0) |
|
385 { |
|
386 length = length + sizeof ( TUint32 ) + lengthAligned1; |
|
387 } |
|
388 // Check that parameter lenght is not too long |
|
389 TInt length2 = aParam2.Size(); |
|
390 if ((length + length2 + sizeof ( TUint32 )) > KOstMaxDataLength) |
|
391 { |
|
392 length2 = KOstMaxDataLength - (length + sizeof ( TUint32 )); |
|
393 } |
|
394 TInt lengthAligned2 = ( length2 + 3 ) & ~3; |
|
395 if (lengthAligned2 > 0) |
|
396 { |
|
397 length = length + sizeof ( TUint32 ) + lengthAligned2; |
|
398 } |
|
399 TUint8 data[ KOstMaxDataLength ]; |
|
400 TUint8* ptr = data; |
|
401 // Set length to zero and calculate it againg |
|
402 // when adding parameters |
|
403 length = 0; |
|
404 if (length1 > 0) |
|
405 { |
|
406 // Number of elements is written before data |
|
407 // In case of Unicode string, number of elements is half of length |
|
408 *( ( TUint32* )ptr ) = length1 / (aParam1.Size() / aParam1.Length()); |
|
409 ptr += sizeof ( TUint32 ); |
|
410 memcpy( ptr, aParam1.Ptr(), length1 ); |
|
411 ptr += length1; |
|
412 // Fillers are written to get 32-bit alignment |
|
413 while ( length1++ < lengthAligned1 ) |
|
414 { |
|
415 *ptr++ = 0; |
|
416 } |
|
417 length += sizeof ( TUint32 ) + lengthAligned1; |
|
418 } |
|
419 else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength) |
|
420 { |
|
421 *( ( TUint32* )ptr ) = 0; |
|
422 ptr += sizeof ( TUint32 ); |
|
423 length += sizeof ( TUint32 ); |
|
424 } |
|
425 if (length2 > 0) |
|
426 { |
|
427 // Number of elements is written before data |
|
428 // In case of Unicode string, number of elements is half of length |
|
429 *( ( TUint32* )ptr ) = length2 / (aParam2.Size() / aParam2.Length()); |
|
430 ptr += sizeof ( TUint32 ); |
|
431 memcpy( ptr, aParam2.Ptr(), length2 ); |
|
432 ptr += length2; |
|
433 // Fillers are written to get 32-bit alignment |
|
434 while ( length2++ < lengthAligned2 ) |
|
435 { |
|
436 *ptr++ = 0; |
|
437 } |
|
438 length += sizeof ( TUint32 ) + lengthAligned2; |
|
439 } |
|
440 else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength) |
|
441 { |
|
442 *( ( TUint32* )ptr ) = 0; |
|
443 ptr += sizeof ( TUint32 ); |
|
444 length += sizeof ( TUint32 ); |
|
445 } |
|
446 ptr -= length; |
|
447 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, length ); |
|
448 } |
|
449 return retval; |
|
450 } |
|
451 |
|
452 |
|
453 inline TBool OstTraceGen3( TUint32 aTraceID, const TDesC8& aParam1, const TDesC8& aParam2, TUint aParam3 ) |
|
454 { |
|
455 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
456 if ( retval ) |
|
457 { |
|
458 TInt length = 0; |
|
459 // Check that parameter lenght is not too long |
|
460 TInt length1 = aParam1.Size(); |
|
461 if ((length + length1 + sizeof ( TUint32 )) > KOstMaxDataLength) |
|
462 { |
|
463 length1 = KOstMaxDataLength - (length + sizeof ( TUint32 )); |
|
464 } |
|
465 TInt lengthAligned1 = ( length1 + 3 ) & ~3; |
|
466 if (lengthAligned1 > 0) |
|
467 { |
|
468 length = length + sizeof ( TUint32 ) + lengthAligned1; |
|
469 } |
|
470 // Check that parameter lenght is not too long |
|
471 TInt length2 = aParam2.Size(); |
|
472 if ((length + length2 + sizeof ( TUint32 )) > KOstMaxDataLength) |
|
473 { |
|
474 length2 = KOstMaxDataLength - (length + sizeof ( TUint32 )); |
|
475 } |
|
476 TInt lengthAligned2 = ( length2 + 3 ) & ~3; |
|
477 if (lengthAligned2 > 0) |
|
478 { |
|
479 length = length + sizeof ( TUint32 ) + lengthAligned2; |
|
480 } |
|
481 TUint8 data[ KOstMaxDataLength ]; |
|
482 TUint8* ptr = data; |
|
483 // Set length to zero and calculate it againg |
|
484 // when adding parameters |
|
485 length = 0; |
|
486 if (length1 > 0) |
|
487 { |
|
488 // Number of elements is written before data |
|
489 // In case of Unicode string, number of elements is half of length |
|
490 *( ( TUint32* )ptr ) = length1 / (aParam1.Size() / aParam1.Length()); |
|
491 ptr += sizeof ( TUint32 ); |
|
492 memcpy( ptr, aParam1.Ptr(), length1 ); |
|
493 ptr += length1; |
|
494 // Fillers are written to get 32-bit alignment |
|
495 while ( length1++ < lengthAligned1 ) |
|
496 { |
|
497 *ptr++ = 0; |
|
498 } |
|
499 length += sizeof ( TUint32 ) + lengthAligned1; |
|
500 } |
|
501 else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength) |
|
502 { |
|
503 *( ( TUint32* )ptr ) = 0; |
|
504 ptr += sizeof ( TUint32 ); |
|
505 length += sizeof ( TUint32 ); |
|
506 } |
|
507 if (length2 > 0) |
|
508 { |
|
509 // Number of elements is written before data |
|
510 // In case of Unicode string, number of elements is half of length |
|
511 *( ( TUint32* )ptr ) = length2 / (aParam2.Size() / aParam2.Length()); |
|
512 ptr += sizeof ( TUint32 ); |
|
513 memcpy( ptr, aParam2.Ptr(), length2 ); |
|
514 ptr += length2; |
|
515 // Fillers are written to get 32-bit alignment |
|
516 while ( length2++ < lengthAligned2 ) |
|
517 { |
|
518 *ptr++ = 0; |
|
519 } |
|
520 length += sizeof ( TUint32 ) + lengthAligned2; |
|
521 } |
|
522 else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength) |
|
523 { |
|
524 *( ( TUint32* )ptr ) = 0; |
|
525 ptr += sizeof ( TUint32 ); |
|
526 length += sizeof ( TUint32 ); |
|
527 } |
|
528 // Check that there are enough space to next parameter |
|
529 if ((length + sizeof ( TUint )) <= KOstMaxDataLength) |
|
530 { |
|
531 *( ( TUint* )ptr ) = aParam3; |
|
532 ptr += sizeof ( TUint ); |
|
533 length += sizeof ( TUint ); |
|
534 } |
|
535 ptr -= length; |
|
536 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, length ); |
|
537 } |
|
538 return retval; |
|
539 } |
|
540 |
|
541 inline TBool OstTraceGen3( TUint32 aTraceID, const TDesC8& aParam1, const TDesC8& aParam2, TUint32 aParam3 ) |
|
542 { |
|
543 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
544 if ( retval ) |
|
545 { |
|
546 TInt length = 0; |
|
547 // Check that parameter lenght is not too long |
|
548 TInt length1 = aParam1.Size(); |
|
549 if ((length + length1 + sizeof ( TUint32 )) > KOstMaxDataLength) |
|
550 { |
|
551 length1 = KOstMaxDataLength - (length + sizeof ( TUint32 )); |
|
552 } |
|
553 TInt lengthAligned1 = ( length1 + 3 ) & ~3; |
|
554 if (lengthAligned1 > 0) |
|
555 { |
|
556 length = length + sizeof ( TUint32 ) + lengthAligned1; |
|
557 } |
|
558 // Check that parameter lenght is not too long |
|
559 TInt length2 = aParam2.Size(); |
|
560 if ((length + length2 + sizeof ( TUint32 )) > KOstMaxDataLength) |
|
561 { |
|
562 length2 = KOstMaxDataLength - (length + sizeof ( TUint32 )); |
|
563 } |
|
564 TInt lengthAligned2 = ( length2 + 3 ) & ~3; |
|
565 if (lengthAligned2 > 0) |
|
566 { |
|
567 length = length + sizeof ( TUint32 ) + lengthAligned2; |
|
568 } |
|
569 TUint8 data[ KOstMaxDataLength ]; |
|
570 TUint8* ptr = data; |
|
571 // Set length to zero and calculate it againg |
|
572 // when adding parameters |
|
573 length = 0; |
|
574 if (length1 > 0) |
|
575 { |
|
576 // Number of elements is written before data |
|
577 // In case of Unicode string, number of elements is half of length |
|
578 *( ( TUint32* )ptr ) = length1 / (aParam1.Size() / aParam1.Length()); |
|
579 ptr += sizeof ( TUint32 ); |
|
580 memcpy( ptr, aParam1.Ptr(), length1 ); |
|
581 ptr += length1; |
|
582 // Fillers are written to get 32-bit alignment |
|
583 while ( length1++ < lengthAligned1 ) |
|
584 { |
|
585 *ptr++ = 0; |
|
586 } |
|
587 length += sizeof ( TUint32 ) + lengthAligned1; |
|
588 } |
|
589 else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength) |
|
590 { |
|
591 *( ( TUint32* )ptr ) = 0; |
|
592 ptr += sizeof ( TUint32 ); |
|
593 length += sizeof ( TUint32 ); |
|
594 } |
|
595 if (length2 > 0) |
|
596 { |
|
597 // Number of elements is written before data |
|
598 // In case of Unicode string, number of elements is half of length |
|
599 *( ( TUint32* )ptr ) = length2 / (aParam2.Size() / aParam2.Length()); |
|
600 ptr += sizeof ( TUint32 ); |
|
601 memcpy( ptr, aParam2.Ptr(), length2 ); |
|
602 ptr += length2; |
|
603 // Fillers are written to get 32-bit alignment |
|
604 while ( length2++ < lengthAligned2 ) |
|
605 { |
|
606 *ptr++ = 0; |
|
607 } |
|
608 length += sizeof ( TUint32 ) + lengthAligned2; |
|
609 } |
|
610 else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength) |
|
611 { |
|
612 *( ( TUint32* )ptr ) = 0; |
|
613 ptr += sizeof ( TUint32 ); |
|
614 length += sizeof ( TUint32 ); |
|
615 } |
|
616 // Check that there are enough space to next parameter |
|
617 if ((length + sizeof ( TUint )) <= KOstMaxDataLength) |
|
618 { |
|
619 *( ( TUint* )ptr ) = aParam3; |
|
620 ptr += sizeof ( TUint ); |
|
621 length += sizeof ( TUint ); |
|
622 } |
|
623 ptr -= length; |
|
624 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, length ); |
|
625 } |
|
626 return retval; |
|
627 } |
|
628 |
|
629 |
|
630 #endif |
|
631 |
|
632 // End of file |
|
633 |