|
1 // Created by TraceCompiler 2.1.2 |
|
2 // DO NOT EDIT, CHANGES WILL BE LOST |
|
3 |
|
4 #ifndef __CCPIXIDXDBTRACES_H__ |
|
5 #define __CCPIXIDXDBTRACES_H__ |
|
6 |
|
7 #define KOstTraceComponentID 0x2001f6f7 |
|
8 |
|
9 #define CPIXIDXDB_DUMPDOCUMENT 0x860001 |
|
10 #define DUP1_CPIXIDXDB_DUMPDOCUMENT 0x860002 |
|
11 #define DUP2_CPIXIDXDB_DUMPDOCUMENT 0x860003 |
|
12 #define CCPIXIDXDB_ADDL 0x860004 |
|
13 #define CCPIXIDXDB_UPDATEL 0x860005 |
|
14 #define CCPIXIDXDB_DELETEDOCUMENTSL 0x860006 |
|
15 |
|
16 |
|
17 #ifndef __KERNEL_MODE__ |
|
18 inline TBool OstTraceGen1( TUint32 aTraceID, const TDesC16& aParam1 ) |
|
19 { |
|
20 TBool retval; |
|
21 TInt size = aParam1.Size(); |
|
22 // BTrace assumes that parameter size is atleast 4 bytes |
|
23 if (size % 4 == 0) |
|
24 { |
|
25 TUint8* ptr = ( TUint8* )aParam1.Ptr(); |
|
26 // Data is written directly and length is determined from trace message length |
|
27 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size ); |
|
28 } |
|
29 else |
|
30 { |
|
31 TUint8 data[ KOstMaxDataLength ]; |
|
32 TUint8* ptr = data; |
|
33 if (size > KOstMaxDataLength) |
|
34 { |
|
35 size = KOstMaxDataLength; |
|
36 } |
|
37 TInt sizeAligned = ( size + 3 ) & ~3; |
|
38 memcpy( ptr, aParam1.Ptr(), size ); |
|
39 ptr += size; |
|
40 // Fillers are written to get 32-bit alignment |
|
41 while ( size++ < sizeAligned ) |
|
42 { |
|
43 *ptr++ = 0; |
|
44 } |
|
45 ptr -= sizeAligned; |
|
46 size = sizeAligned; |
|
47 // Data is written directly and length is determined from trace message length |
|
48 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size ); |
|
49 } |
|
50 return retval; |
|
51 } |
|
52 #endif |
|
53 |
|
54 |
|
55 #ifndef __KERNEL_MODE__ |
|
56 inline TBool OstTraceGen2( TUint32 aTraceID, const TDesC16& aParam1, const TDesC16& aParam2 ) |
|
57 { |
|
58 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
59 if ( retval ) |
|
60 { |
|
61 TInt length = 0; |
|
62 // Check that parameter lenght is not too long |
|
63 TInt length1 = aParam1.Size(); |
|
64 if ((length + length1 + sizeof ( TUint32 )) > KOstMaxDataLength) |
|
65 { |
|
66 length1 = KOstMaxDataLength - (length + sizeof ( TUint32 )); |
|
67 } |
|
68 TInt lengthAligned1 = ( length1 + 3 ) & ~3; |
|
69 if (lengthAligned1 > 0) |
|
70 { |
|
71 length = length + sizeof ( TUint32 ) + lengthAligned1; |
|
72 } |
|
73 // Check that parameter lenght is not too long |
|
74 TInt length2 = aParam2.Size(); |
|
75 if ((length + length2 + sizeof ( TUint32 )) > KOstMaxDataLength) |
|
76 { |
|
77 length2 = KOstMaxDataLength - (length + sizeof ( TUint32 )); |
|
78 } |
|
79 TInt lengthAligned2 = ( length2 + 3 ) & ~3; |
|
80 if (lengthAligned2 > 0) |
|
81 { |
|
82 length = length + sizeof ( TUint32 ) + lengthAligned2; |
|
83 } |
|
84 TUint8 data[ KOstMaxDataLength ]; |
|
85 TUint8* ptr = data; |
|
86 // Set length to zero and calculate it againg |
|
87 // when adding parameters |
|
88 length = 0; |
|
89 if (length1 > 0) |
|
90 { |
|
91 // Number of elements is written before data |
|
92 // In case of Unicode string, number of elements is half of length |
|
93 *( ( TUint32* )ptr ) = length1 / (aParam1.Size() / aParam1.Length()); |
|
94 ptr += sizeof ( TUint32 ); |
|
95 memcpy( ptr, aParam1.Ptr(), length1 ); |
|
96 ptr += length1; |
|
97 // Fillers are written to get 32-bit alignment |
|
98 while ( length1++ < lengthAligned1 ) |
|
99 { |
|
100 *ptr++ = 0; |
|
101 } |
|
102 length += sizeof ( TUint32 ) + lengthAligned1; |
|
103 } |
|
104 else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength) |
|
105 { |
|
106 *( ( TUint32* )ptr ) = 0; |
|
107 ptr += sizeof ( TUint32 ); |
|
108 length += sizeof ( TUint32 ); |
|
109 } |
|
110 if (length2 > 0) |
|
111 { |
|
112 // Number of elements is written before data |
|
113 // In case of Unicode string, number of elements is half of length |
|
114 *( ( TUint32* )ptr ) = length2 / (aParam2.Size() / aParam2.Length()); |
|
115 ptr += sizeof ( TUint32 ); |
|
116 memcpy( ptr, aParam2.Ptr(), length2 ); |
|
117 ptr += length2; |
|
118 // Fillers are written to get 32-bit alignment |
|
119 while ( length2++ < lengthAligned2 ) |
|
120 { |
|
121 *ptr++ = 0; |
|
122 } |
|
123 length += sizeof ( TUint32 ) + lengthAligned2; |
|
124 } |
|
125 else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength) |
|
126 { |
|
127 *( ( TUint32* )ptr ) = 0; |
|
128 ptr += sizeof ( TUint32 ); |
|
129 length += sizeof ( TUint32 ); |
|
130 } |
|
131 ptr -= length; |
|
132 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, length ); |
|
133 } |
|
134 return retval; |
|
135 } |
|
136 #endif |
|
137 |
|
138 |
|
139 #endif |
|
140 |
|
141 // End of file |
|
142 |