|
1 // Created by TraceCompiler 2.1.2 |
|
2 // DO NOT EDIT, CHANGES WILL BE LOST |
|
3 |
|
4 #ifndef __APPLICATIONSPLUGINTRACES_H__ |
|
5 #define __APPLICATIONSPLUGINTRACES_H__ |
|
6 |
|
7 #define KOstTraceComponentID 0x2001a9d7 |
|
8 |
|
9 #define CAPPLICATIONSPLUGIN_NEWL_ENTRY 0x8a0001 |
|
10 #define CAPPLICATIONSPLUGIN_NEWL_EXIT 0x8a0002 |
|
11 #define CAPPLICATIONSPLUGIN_HANDLEAPPLISTEVENT_ENTRY 0x8a0003 |
|
12 #define CAPPLICATIONSPLUGIN_HANDLEAPPLISTEVENT_EXIT 0x8a0004 |
|
13 #define CAPPLICATIONSPLUGIN_ADDWIDGETINFOL 0x860001 |
|
14 #define DUP1_CAPPLICATIONSPLUGIN_ADDWIDGETINFOL 0x860002 |
|
15 #define _ADDAPPLICATIONINFOL 0x860003 |
|
16 #define DUP1__ADDAPPLICATIONINFOL 0x860004 |
|
17 #define CAPPLICATIONSPLUGIN_ISAPPHIDDENL 0x860005 |
|
18 #define DUP1_CAPPLICATIONSPLUGIN_ISAPPHIDDENL 0x860006 |
|
19 #define CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML 0x860007 |
|
20 #define DUP1_CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML 0x860008 |
|
21 #define CAPPLICATIONSPLUGIN_HANDLEAPPLISTEVENT 0x860009 |
|
22 #define STATE_DUP1_CAPPLICATIONSPLUGIN_ISAPPHIDDENL 0x870001 |
|
23 |
|
24 |
|
25 #ifndef __KERNEL_MODE__ |
|
26 inline TBool OstTraceGen1( TUint32 aTraceID, const TDesC16& aParam1 ) |
|
27 { |
|
28 TBool retval; |
|
29 TInt size = aParam1.Size(); |
|
30 // BTrace assumes that parameter size is atleast 4 bytes |
|
31 if (size % 4 == 0) |
|
32 { |
|
33 TUint8* ptr = ( TUint8* )aParam1.Ptr(); |
|
34 // Data is written directly and length is determined from trace message length |
|
35 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size ); |
|
36 } |
|
37 else |
|
38 { |
|
39 TUint8 data[ KOstMaxDataLength ]; |
|
40 TUint8* ptr = data; |
|
41 if (size > KOstMaxDataLength) |
|
42 { |
|
43 size = KOstMaxDataLength; |
|
44 } |
|
45 TInt sizeAligned = ( size + 3 ) & ~3; |
|
46 memcpy( ptr, aParam1.Ptr(), size ); |
|
47 ptr += size; |
|
48 // Fillers are written to get 32-bit alignment |
|
49 while ( size++ < sizeAligned ) |
|
50 { |
|
51 *ptr++ = 0; |
|
52 } |
|
53 ptr -= sizeAligned; |
|
54 size = sizeAligned; |
|
55 // Data is written directly and length is determined from trace message length |
|
56 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size ); |
|
57 } |
|
58 return retval; |
|
59 } |
|
60 #endif |
|
61 |
|
62 |
|
63 #ifndef __KERNEL_MODE__ |
|
64 inline TBool OstTraceGen2( TUint32 aTraceID, const TDesC16& aParam1, const TDesC16& aParam2 ) |
|
65 { |
|
66 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
67 if ( retval ) |
|
68 { |
|
69 TInt length = 0; |
|
70 // Check that parameter lenght is not too long |
|
71 TInt length1 = aParam1.Size(); |
|
72 if ((length + length1 + sizeof ( TUint32 )) > KOstMaxDataLength) |
|
73 { |
|
74 length1 = KOstMaxDataLength - (length + sizeof ( TUint32 )); |
|
75 } |
|
76 TInt lengthAligned1 = ( length1 + 3 ) & ~3; |
|
77 if (lengthAligned1 > 0) |
|
78 { |
|
79 length = length + sizeof ( TUint32 ) + lengthAligned1; |
|
80 } |
|
81 // Check that parameter lenght is not too long |
|
82 TInt length2 = aParam2.Size(); |
|
83 if ((length + length2 + sizeof ( TUint32 )) > KOstMaxDataLength) |
|
84 { |
|
85 length2 = KOstMaxDataLength - (length + sizeof ( TUint32 )); |
|
86 } |
|
87 TInt lengthAligned2 = ( length2 + 3 ) & ~3; |
|
88 if (lengthAligned2 > 0) |
|
89 { |
|
90 length = length + sizeof ( TUint32 ) + lengthAligned2; |
|
91 } |
|
92 TUint8 data[ KOstMaxDataLength ]; |
|
93 TUint8* ptr = data; |
|
94 // Set length to zero and calculate it againg |
|
95 // when adding parameters |
|
96 length = 0; |
|
97 if (length1 > 0) |
|
98 { |
|
99 // Number of elements is written before data |
|
100 // In case of Unicode string, number of elements is half of length |
|
101 *( ( TUint32* )ptr ) = length1 / (aParam1.Size() / aParam1.Length()); |
|
102 ptr += sizeof ( TUint32 ); |
|
103 memcpy( ptr, aParam1.Ptr(), length1 ); |
|
104 ptr += length1; |
|
105 // Fillers are written to get 32-bit alignment |
|
106 while ( length1++ < lengthAligned1 ) |
|
107 { |
|
108 *ptr++ = 0; |
|
109 } |
|
110 length += sizeof ( TUint32 ) + lengthAligned1; |
|
111 } |
|
112 else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength) |
|
113 { |
|
114 *( ( TUint32* )ptr ) = 0; |
|
115 ptr += sizeof ( TUint32 ); |
|
116 length += sizeof ( TUint32 ); |
|
117 } |
|
118 if (length2 > 0) |
|
119 { |
|
120 // Number of elements is written before data |
|
121 // In case of Unicode string, number of elements is half of length |
|
122 *( ( TUint32* )ptr ) = length2 / (aParam2.Size() / aParam2.Length()); |
|
123 ptr += sizeof ( TUint32 ); |
|
124 memcpy( ptr, aParam2.Ptr(), length2 ); |
|
125 ptr += length2; |
|
126 // Fillers are written to get 32-bit alignment |
|
127 while ( length2++ < lengthAligned2 ) |
|
128 { |
|
129 *ptr++ = 0; |
|
130 } |
|
131 length += sizeof ( TUint32 ) + lengthAligned2; |
|
132 } |
|
133 else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength) |
|
134 { |
|
135 *( ( TUint32* )ptr ) = 0; |
|
136 ptr += sizeof ( TUint32 ); |
|
137 length += sizeof ( TUint32 ); |
|
138 } |
|
139 ptr -= length; |
|
140 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, length ); |
|
141 } |
|
142 return retval; |
|
143 } |
|
144 #endif |
|
145 |
|
146 |
|
147 inline TBool OstTraceGen2( TUint32 aTraceID, const TDesC8& aParam1, const TDesC8& aParam2 ) |
|
148 { |
|
149 TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID ); |
|
150 if ( retval ) |
|
151 { |
|
152 TInt length = 0; |
|
153 // Check that parameter lenght is not too long |
|
154 TInt length1 = aParam1.Size(); |
|
155 if ((length + length1 + sizeof ( TUint32 )) > KOstMaxDataLength) |
|
156 { |
|
157 length1 = KOstMaxDataLength - (length + sizeof ( TUint32 )); |
|
158 } |
|
159 TInt lengthAligned1 = ( length1 + 3 ) & ~3; |
|
160 if (lengthAligned1 > 0) |
|
161 { |
|
162 length = length + sizeof ( TUint32 ) + lengthAligned1; |
|
163 } |
|
164 // Check that parameter lenght is not too long |
|
165 TInt length2 = aParam2.Size(); |
|
166 if ((length + length2 + sizeof ( TUint32 )) > KOstMaxDataLength) |
|
167 { |
|
168 length2 = KOstMaxDataLength - (length + sizeof ( TUint32 )); |
|
169 } |
|
170 TInt lengthAligned2 = ( length2 + 3 ) & ~3; |
|
171 if (lengthAligned2 > 0) |
|
172 { |
|
173 length = length + sizeof ( TUint32 ) + lengthAligned2; |
|
174 } |
|
175 TUint8 data[ KOstMaxDataLength ]; |
|
176 TUint8* ptr = data; |
|
177 // Set length to zero and calculate it againg |
|
178 // when adding parameters |
|
179 length = 0; |
|
180 if (length1 > 0) |
|
181 { |
|
182 // Number of elements is written before data |
|
183 // In case of Unicode string, number of elements is half of length |
|
184 *( ( TUint32* )ptr ) = length1 / (aParam1.Size() / aParam1.Length()); |
|
185 ptr += sizeof ( TUint32 ); |
|
186 memcpy( ptr, aParam1.Ptr(), length1 ); |
|
187 ptr += length1; |
|
188 // Fillers are written to get 32-bit alignment |
|
189 while ( length1++ < lengthAligned1 ) |
|
190 { |
|
191 *ptr++ = 0; |
|
192 } |
|
193 length += sizeof ( TUint32 ) + lengthAligned1; |
|
194 } |
|
195 else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength) |
|
196 { |
|
197 *( ( TUint32* )ptr ) = 0; |
|
198 ptr += sizeof ( TUint32 ); |
|
199 length += sizeof ( TUint32 ); |
|
200 } |
|
201 if (length2 > 0) |
|
202 { |
|
203 // Number of elements is written before data |
|
204 // In case of Unicode string, number of elements is half of length |
|
205 *( ( TUint32* )ptr ) = length2 / (aParam2.Size() / aParam2.Length()); |
|
206 ptr += sizeof ( TUint32 ); |
|
207 memcpy( ptr, aParam2.Ptr(), length2 ); |
|
208 ptr += length2; |
|
209 // Fillers are written to get 32-bit alignment |
|
210 while ( length2++ < lengthAligned2 ) |
|
211 { |
|
212 *ptr++ = 0; |
|
213 } |
|
214 length += sizeof ( TUint32 ) + lengthAligned2; |
|
215 } |
|
216 else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength) |
|
217 { |
|
218 *( ( TUint32* )ptr ) = 0; |
|
219 ptr += sizeof ( TUint32 ); |
|
220 length += sizeof ( TUint32 ); |
|
221 } |
|
222 ptr -= length; |
|
223 retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, length ); |
|
224 } |
|
225 return retval; |
|
226 } |
|
227 |
|
228 |
|
229 #endif |
|
230 |
|
231 // End of file |
|
232 |