|
1 // Copyright (c) 2002-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 // |
|
15 |
|
16 #include <e32test.h> |
|
17 #include <e32property.h> |
|
18 |
|
19 #include "bm_suite.h" |
|
20 |
|
21 static const TInt32 KUidPropBenchmarkCategoryValue = 0x101f75b7; |
|
22 static const TUid KPropBenchmarkCategory = { KUidPropBenchmarkCategoryValue }; |
|
23 static _LIT_SECURITY_POLICY_PASS(KPassPolicy); |
|
24 |
|
25 typedef void (*MeasurementFunc)(TBMResult*, TBMUInt64 aIter, struct Measurement*); |
|
26 enum TSetGetType |
|
27 { |
|
28 EOneArg, |
|
29 EThreeArgsInt, |
|
30 EThreeArgsBuf8, |
|
31 EThreeArgsBuf16 |
|
32 }; |
|
33 |
|
34 struct Measurement |
|
35 { |
|
36 MeasurementFunc iFunc; |
|
37 TPtrC iName; |
|
38 TBool iRemote; |
|
39 RProperty::TType iType; |
|
40 TInt iSize; |
|
41 TSetGetType iSetGetType; |
|
42 |
|
43 Measurement(MeasurementFunc aFunc, const TDesC& aName, |
|
44 RProperty::TType aType, TInt aSize, TBool aRemote = EFalse, |
|
45 TSetGetType aSetGetType = EOneArg) : |
|
46 iFunc(aFunc), iName(aName), iRemote(aRemote), iType(aType), iSize(aSize), |
|
47 iSetGetType(aSetGetType) {} |
|
48 }; |
|
49 |
|
50 class Property : public BMProgram |
|
51 { |
|
52 public : |
|
53 Property() : BMProgram(_L("Properties")) |
|
54 {} |
|
55 virtual TBMResult* Run(TBMUInt64 aIter, TInt* aCount); |
|
56 |
|
57 |
|
58 static TBMResult iResults[]; |
|
59 static Measurement iMeasurements[]; |
|
60 |
|
61 static void NotificationLatencyParent(TBMResult* aResult, TBMUInt64 aIter, Measurement*); |
|
62 static TInt NotificationLatencyChild(TAny*); |
|
63 |
|
64 static void SetOverhead(TBMResult* aResult, TBMUInt64 aIter, struct Measurement* aM); |
|
65 static void GetOverhead(TBMResult* aResult, TBMUInt64 aIter, struct Measurement* aM); |
|
66 |
|
67 |
|
68 private: |
|
69 static TBuf8<RProperty::KMaxPropertySize> iInBuf; |
|
70 static TBuf8<RProperty::KMaxPropertySize> iOutBuf; |
|
71 static TBuf16<RProperty::KMaxPropertySize> iInBuf16; |
|
72 static TBuf16<RProperty::KMaxPropertySize> iOutBuf16; |
|
73 }; |
|
74 |
|
75 Measurement Property::iMeasurements[] = |
|
76 { |
|
77 Measurement(&Property::NotificationLatencyParent, _L("Local Int Notification Latency "), |
|
78 RProperty::EInt, 0, EFalse), |
|
79 Measurement(&Property::NotificationLatencyParent, _L("Remote Int Notification Latency"), |
|
80 RProperty::EInt, 0,ETrue), |
|
81 Measurement(&Property::NotificationLatencyParent, _L("Local Byte(1) Notification Latency"), |
|
82 RProperty::EByteArray, 1, EFalse), |
|
83 Measurement(&Property::NotificationLatencyParent, _L("Remote Byte(1) Notification Latency"), |
|
84 RProperty::EByteArray, 1, ETrue), |
|
85 Measurement(&Property::NotificationLatencyParent, _L("Local Byte(8) Notification Latency"), |
|
86 RProperty::EByteArray, 8, EFalse), |
|
87 Measurement(&Property::NotificationLatencyParent, _L("Remote Byte(8) Notification Latency"), |
|
88 RProperty::EByteArray, 8,ETrue), |
|
89 Measurement(&Property::NotificationLatencyParent, _L("Local Byte(512) Notification Latency"), |
|
90 RProperty::EByteArray, 512, EFalse), |
|
91 Measurement(&Property::NotificationLatencyParent, _L("Remote Byte(512) Notification Latency"), |
|
92 RProperty::EByteArray, 512,ETrue), |
|
93 |
|
94 Measurement(&Property::NotificationLatencyParent, _L("Local Int Notification Latency ThreeArgsInt"), |
|
95 RProperty::EInt, 0, EFalse, EThreeArgsInt), |
|
96 Measurement(&Property::NotificationLatencyParent, _L("Remote Int Notification Latency ThreeArgsInt"), |
|
97 RProperty::EInt, 0,ETrue, EThreeArgsInt), |
|
98 Measurement(&Property::NotificationLatencyParent, _L("Local Byte(1) Notification Latency ThreeArgsBuf8"), |
|
99 RProperty::EByteArray, 1, EFalse, EThreeArgsBuf8), |
|
100 Measurement(&Property::NotificationLatencyParent, _L("Remote Byte(1) Notification Latency ThreeArgsBuf8"), |
|
101 RProperty::EByteArray, 1, ETrue, EThreeArgsBuf8), |
|
102 Measurement(&Property::NotificationLatencyParent, _L("Local TUint16(1) Notification Latency ThreeArgsBuf16"), |
|
103 RProperty::EByteArray, 1, EFalse, EThreeArgsBuf16), |
|
104 Measurement(&Property::NotificationLatencyParent, _L("Remote TUint16(1) Notification Latency ThreeArgsBuf16"), |
|
105 RProperty::EByteArray, 1, ETrue, EThreeArgsBuf16), |
|
106 Measurement(&Property::NotificationLatencyParent, _L("Local Byte(8) Notification Latency ThreeArgsBuf8"), |
|
107 RProperty::EByteArray, 8, EFalse, EThreeArgsBuf8), |
|
108 Measurement(&Property::NotificationLatencyParent, _L("Remote Byte(8) Notification Latency ThreeArgsBuf8"), |
|
109 RProperty::EByteArray, 8,ETrue, EThreeArgsBuf8), |
|
110 Measurement(&Property::NotificationLatencyParent, _L("Local TUint16(8) Notification Latency ThreeArgsBuf16"), |
|
111 RProperty::EByteArray, 8, EFalse, EThreeArgsBuf16), |
|
112 Measurement(&Property::NotificationLatencyParent, _L("Remote TUint16(8) Notification Latency ThreeArgsBuf16"), |
|
113 RProperty::EByteArray, 8,ETrue, EThreeArgsBuf16), |
|
114 Measurement(&Property::NotificationLatencyParent, _L("Local Byte(512) Notification Latency ThreeArgsBuf8"), |
|
115 RProperty::EByteArray, 512, EFalse, EThreeArgsBuf8), |
|
116 Measurement(&Property::NotificationLatencyParent, _L("Remote Byte(512) Notification Latency ThreeArgsBuf8"), |
|
117 RProperty::EByteArray, 512,ETrue, EThreeArgsBuf8), |
|
118 Measurement(&Property::NotificationLatencyParent, _L("Local TUint16(512) Notification Latency ThreeArgsBuf16"), |
|
119 RProperty::ELargeByteArray, 512, EFalse, EThreeArgsBuf16), |
|
120 Measurement(&Property::NotificationLatencyParent, _L("Remote TUint16(512) Notification Latency ThreeArgsBuf16"), |
|
121 RProperty::ELargeByteArray, 512,ETrue, EThreeArgsBuf16), |
|
122 |
|
123 |
|
124 |
|
125 Measurement(&Property::SetOverhead, _L("Int Set Overhead"), |
|
126 RProperty::EInt, 0), |
|
127 Measurement(&Property::SetOverhead, _L("Byte(1) Set Overhead"), |
|
128 RProperty::EByteArray, 1), |
|
129 Measurement(&Property::SetOverhead, _L("Byte(8) Set Overhead"), |
|
130 RProperty::EByteArray, 8), |
|
131 Measurement(&Property::SetOverhead, _L("Byte(512) Set Overhead"), |
|
132 RProperty::EByteArray, 512), |
|
133 |
|
134 Measurement(&Property::SetOverhead, _L("Int Set Overhead ThreeArgsInt"), |
|
135 RProperty::EInt, 0, EFalse, EThreeArgsInt), |
|
136 Measurement(&Property::SetOverhead, _L("Byte(1) Set Overhead ThreeArgsBuf8"), |
|
137 RProperty::EByteArray, 1, EFalse, EThreeArgsBuf8), |
|
138 Measurement(&Property::SetOverhead, _L("TUint16(1) Set Overhead ThreeArgsBuf16"), |
|
139 RProperty::EByteArray, 1, EFalse, EThreeArgsBuf16), |
|
140 Measurement(&Property::SetOverhead, _L("Byte(8) Set Overhead ThreeArgsBuf8"), |
|
141 RProperty::EByteArray, 8, EFalse, EThreeArgsBuf8), |
|
142 Measurement(&Property::SetOverhead, _L("TUint16(8) Set Overhead ThreeArgsBuf16"), |
|
143 RProperty::EByteArray, 8, EFalse, EThreeArgsBuf16), |
|
144 Measurement(&Property::SetOverhead, _L("Byte(512) Set Overhead ThreeArgsBuf8"), |
|
145 RProperty::EByteArray, 512, EFalse, EThreeArgsBuf8), |
|
146 Measurement(&Property::SetOverhead, _L("TUint16(512) Set Overhead ThreeArgsBuf16"), |
|
147 RProperty::ELargeByteArray, 512, EFalse, EThreeArgsBuf16), |
|
148 |
|
149 |
|
150 |
|
151 Measurement(&Property::GetOverhead, _L("Int Get Overhead"), |
|
152 RProperty::EInt, 0), |
|
153 Measurement(&Property::GetOverhead, _L("Byte(1) Get Overhead"), |
|
154 RProperty::EByteArray, 1), |
|
155 Measurement(&Property::GetOverhead, _L("Byte(8) Get Overhead"), |
|
156 RProperty::EByteArray, 8), |
|
157 Measurement(&Property::GetOverhead, _L("Byte(512) Get Overhead"), |
|
158 RProperty::EByteArray, 512), |
|
159 |
|
160 Measurement(&Property::GetOverhead, _L("Int Get Overhead ThreeArgsInt"), |
|
161 RProperty::EInt, 0, EFalse, EThreeArgsInt), |
|
162 Measurement(&Property::GetOverhead, _L("Byte(1) Get Overhead ThreeArgsBuf8"), |
|
163 RProperty::EByteArray, 1, EFalse, EThreeArgsBuf8), |
|
164 Measurement(&Property::GetOverhead, _L("TUint16(1) Get Overhead ThreeArgsBuf16"), |
|
165 RProperty::EByteArray, 1, EFalse, EThreeArgsBuf16), |
|
166 Measurement(&Property::GetOverhead, _L("Byte(8) Get Overhead ThreeArgsBuf8"), |
|
167 RProperty::EByteArray, 8, EFalse, EThreeArgsBuf8), |
|
168 Measurement(&Property::GetOverhead, _L("TUint16(8) Get Overhead ThreeArgsBuf16"), |
|
169 RProperty::EByteArray, 8, EFalse, EThreeArgsBuf16), |
|
170 Measurement(&Property::GetOverhead, _L("Byte(512) Get Overhead ThreeArgsBuf8"), |
|
171 RProperty::EByteArray, 512, EFalse, EThreeArgsBuf8), |
|
172 Measurement(&Property::GetOverhead, _L("TUint16(512) Get Overhead ThreeArgsBuf16"), |
|
173 RProperty::ELargeByteArray, 512, EFalse, EThreeArgsBuf16), |
|
174 |
|
175 }; |
|
176 TBMResult Property::iResults[sizeof(Property::iMeasurements)/sizeof(Property::iMeasurements[0])]; |
|
177 |
|
178 TBuf8<RProperty::KMaxPropertySize> Property::iInBuf(RProperty::KMaxPropertySize); |
|
179 TBuf8<RProperty::KMaxPropertySize> Property::iOutBuf(RProperty::KMaxPropertySize); |
|
180 TBuf16<RProperty::KMaxPropertySize> Property::iInBuf16(RProperty::KMaxPropertySize); |
|
181 TBuf16<RProperty::KMaxPropertySize> Property::iOutBuf16(RProperty::KMaxPropertySize); |
|
182 |
|
183 |
|
184 static Property property; |
|
185 |
|
186 class NotificationLatencyArgs : public TBMSpawnArgs |
|
187 { |
|
188 public: |
|
189 |
|
190 TBMUInt64 iIterationCount; |
|
191 RProperty::TType iType; |
|
192 TInt iSize; |
|
193 TSetGetType iSetGetType; |
|
194 |
|
195 NotificationLatencyArgs(RProperty::TType aType, TInt aSize, TInt aRemote, TBMUInt64 aIter, |
|
196 TSetGetType aSetGetType); |
|
197 }; |
|
198 |
|
199 NotificationLatencyArgs::NotificationLatencyArgs(RProperty::TType aType, TInt aSize, TInt aRemote, |
|
200 TBMUInt64 aIter, TSetGetType aSetGetType) : |
|
201 TBMSpawnArgs(Property::NotificationLatencyChild, KBMPriorityLow, aRemote, sizeof(*this)), |
|
202 iIterationCount(aIter), iType(aType), iSize(aSize), iSetGetType(aSetGetType) |
|
203 { |
|
204 } |
|
205 |
|
206 void Property::NotificationLatencyParent(TBMResult* aResult, TBMUInt64 aIter, struct Measurement* aM) |
|
207 { |
|
208 RProperty time; |
|
209 TInt r = time.Define(KPropBenchmarkCategory, 0, RProperty::EByteArray, KPassPolicy, KPassPolicy); |
|
210 BM_ERROR(r, r == KErrNone); |
|
211 r = time.Attach(KPropBenchmarkCategory, 0); |
|
212 BM_ERROR(r, r == KErrNone); |
|
213 |
|
214 RProperty prop; |
|
215 r = prop.Define(KPropBenchmarkCategory, 1, aM->iType, KPassPolicy, KPassPolicy); |
|
216 BM_ERROR(r, r == KErrNone); |
|
217 r = prop.Attach(KPropBenchmarkCategory, 1); |
|
218 BM_ERROR(r, r == KErrNone); |
|
219 |
|
220 NotificationLatencyArgs sl(aM->iType, aM->iSize, aM->iRemote, aIter, aM->iSetGetType); |
|
221 MBMChild* child = property.SpawnChild(&sl); |
|
222 for (TBMUInt64 i = 0; i < aIter; ++i) |
|
223 { |
|
224 TRequestStatus st; |
|
225 prop.Subscribe(st); |
|
226 User::WaitForRequest(st); |
|
227 switch(aM->iSetGetType) |
|
228 { |
|
229 case EOneArg: |
|
230 if (aM->iType == RProperty::EInt) |
|
231 { |
|
232 TInt value; |
|
233 r = prop.Get(value); |
|
234 BM_ERROR(r, r == KErrNone); |
|
235 } |
|
236 else |
|
237 { |
|
238 r = prop.Get(iInBuf); |
|
239 BM_ERROR(r, r == KErrNone); |
|
240 } |
|
241 break; |
|
242 case EThreeArgsInt: |
|
243 { |
|
244 TInt value; |
|
245 r = prop.Get(KPropBenchmarkCategory, 1, value); |
|
246 BM_ERROR(r, r == KErrNone); |
|
247 } |
|
248 break; |
|
249 case EThreeArgsBuf8: |
|
250 r = prop.Get(KPropBenchmarkCategory, 1, iInBuf); |
|
251 BM_ERROR(r, r == KErrNone); |
|
252 break; |
|
253 case EThreeArgsBuf16: |
|
254 r = prop.Get(KPropBenchmarkCategory, 1, iInBuf16); |
|
255 BM_ERROR(r, r == KErrNone); |
|
256 break; |
|
257 } |
|
258 |
|
259 TBMTicks now; |
|
260 ::bmTimer.Stamp(&now); |
|
261 BM_ERROR(st.Int(), st.Int() == KErrNone); |
|
262 |
|
263 // subscribe for the time just before Set() |
|
264 time.Subscribe(st); |
|
265 User::WaitForRequest(st); |
|
266 BM_ERROR(st.Int(), st.Int() == KErrNone); |
|
267 // get the time just before Set() |
|
268 TBMTicks propSetTime; |
|
269 TPtr8 ptr((TUint8*) &propSetTime, sizeof(propSetTime), sizeof(propSetTime)); |
|
270 r = time.Get(KPropBenchmarkCategory, 0, ptr); |
|
271 BM_ERROR(r, r == KErrNone); |
|
272 |
|
273 aResult->Cumulate(TBMTicksDelta(propSetTime, now)); |
|
274 } |
|
275 prop.Close(); |
|
276 time.Close(); |
|
277 child->WaitChildExit(); |
|
278 r = prop.Delete(KPropBenchmarkCategory, 1); |
|
279 BM_ERROR(r, r == KErrNone); |
|
280 r = time.Delete(KPropBenchmarkCategory, 0); |
|
281 BM_ERROR(r, r == KErrNone); |
|
282 } |
|
283 |
|
284 TInt Property::NotificationLatencyChild(TAny* cookie) |
|
285 { |
|
286 NotificationLatencyArgs* sl = (NotificationLatencyArgs*) cookie; |
|
287 TInt prio = BMProgram::SetAbsPriority(RThread(), sl->iChildOrigPriority); |
|
288 |
|
289 for (TInt j = 0; j < RProperty::KMaxPropertySize; ++j) |
|
290 { |
|
291 iOutBuf[j] = (TUint8)(j + 1); |
|
292 } |
|
293 RProperty time; |
|
294 RProperty prop; |
|
295 TInt r = prop.Attach(KPropBenchmarkCategory, 1); |
|
296 BM_ERROR(r, r == KErrNone); |
|
297 for (TBMUInt64 i = 0; i < sl->iIterationCount; ++i) |
|
298 { |
|
299 TBMTicks propSetTime; |
|
300 ::bmTimer.Stamp(&propSetTime); |
|
301 switch(sl->iSetGetType) |
|
302 { |
|
303 case EOneArg: |
|
304 if (sl->iType == RProperty::EInt) |
|
305 { |
|
306 TInt value = 0xdeadbeef; |
|
307 r = prop.Set(value); |
|
308 BM_ERROR(r, r == KErrNone); |
|
309 } |
|
310 else |
|
311 { |
|
312 TPtrC8 ptr(iOutBuf.Ptr(), sl->iSize); |
|
313 r = prop.Set(ptr); |
|
314 BM_ERROR(r, r == KErrNone); |
|
315 } |
|
316 break; |
|
317 case EThreeArgsInt: |
|
318 { |
|
319 TInt value = 0xdeadbeef; |
|
320 r = prop.Set(KPropBenchmarkCategory, 1, value); |
|
321 BM_ERROR(r, r == KErrNone); |
|
322 } |
|
323 break; |
|
324 case EThreeArgsBuf8: |
|
325 { |
|
326 TPtrC8 ptr(iOutBuf.Ptr(), sl->iSize); |
|
327 r = prop.Set(KPropBenchmarkCategory, 1, ptr); |
|
328 BM_ERROR(r, r == KErrNone); |
|
329 } |
|
330 break; |
|
331 case EThreeArgsBuf16: |
|
332 { |
|
333 TPtrC16 ptr(iOutBuf16.Ptr(), sl->iSize); |
|
334 r = prop.Set(KPropBenchmarkCategory, 1, ptr); |
|
335 BM_ERROR(r, r == KErrNone); |
|
336 } |
|
337 break; |
|
338 } |
|
339 // publish the time just before Set() |
|
340 TPtr8 ptr((TUint8*) &propSetTime, sizeof(propSetTime), sizeof(propSetTime)); |
|
341 r = time.Set(KPropBenchmarkCategory, 0, ptr); |
|
342 BM_ERROR(r, r == KErrNone); |
|
343 } |
|
344 prop.Close(); |
|
345 time.Close(); |
|
346 |
|
347 BMProgram::SetAbsPriority(RThread(), prio); |
|
348 return KErrNone; |
|
349 } |
|
350 |
|
351 |
|
352 void Property::SetOverhead(TBMResult* aResult, TBMUInt64 aIter, struct Measurement* aM) |
|
353 { |
|
354 RProperty prop; |
|
355 TInt r = prop.Define(KPropBenchmarkCategory, 1, aM->iType, KPassPolicy, KPassPolicy); |
|
356 BM_ERROR(r, r == KErrNone); |
|
357 r = prop.Attach(KPropBenchmarkCategory, 1); |
|
358 BM_ERROR(r, r == KErrNone); |
|
359 |
|
360 if (aM->iType == RProperty::EByteArray) |
|
361 { |
|
362 TPtrC8 ptr(iOutBuf.Ptr(), aM->iSize); |
|
363 r = prop.Set(ptr); |
|
364 BM_ERROR(r, r == KErrNone); |
|
365 } |
|
366 |
|
367 TBMTimeInterval ti; |
|
368 ti.Begin(); |
|
369 for (TBMUInt64 i = 0; i < aIter; ++i) |
|
370 { |
|
371 switch(aM->iSetGetType) |
|
372 { |
|
373 case EOneArg: |
|
374 if (aM->iType == RProperty::EInt) |
|
375 { |
|
376 TInt value = 1; |
|
377 r = prop.Set(value); |
|
378 BM_ERROR(r, r == KErrNone); |
|
379 } |
|
380 else |
|
381 { |
|
382 TPtrC8 ptr(iOutBuf.Ptr(), aM->iSize); |
|
383 r = prop.Set(ptr); |
|
384 BM_ERROR(r, r == KErrNone); |
|
385 } |
|
386 break; |
|
387 case EThreeArgsInt: |
|
388 { |
|
389 TInt value = 1; |
|
390 r = prop.Set(KPropBenchmarkCategory, 1, value); |
|
391 BM_ERROR(r, r == KErrNone); |
|
392 } |
|
393 break; |
|
394 case EThreeArgsBuf8: |
|
395 { |
|
396 TPtrC8 ptr(iOutBuf.Ptr(), aM->iSize); |
|
397 r = prop.Set(KPropBenchmarkCategory, 1, ptr); |
|
398 BM_ERROR(r, r == KErrNone); |
|
399 } |
|
400 break; |
|
401 case EThreeArgsBuf16: |
|
402 { |
|
403 TPtrC16 ptr(iOutBuf16.Ptr(), aM->iSize); |
|
404 r = prop.Set(KPropBenchmarkCategory, 1, ptr); |
|
405 BM_ERROR(r, r == KErrNone); |
|
406 } |
|
407 break; |
|
408 } |
|
409 } |
|
410 TBMTicks t = ti.End(); |
|
411 |
|
412 prop.Close(); |
|
413 r = prop.Delete(KPropBenchmarkCategory, 1); |
|
414 BM_ERROR(r, r == KErrNone); |
|
415 |
|
416 aResult->Cumulate(t, aIter); |
|
417 } |
|
418 |
|
419 void Property::GetOverhead(TBMResult* aResult, TBMUInt64 aIter, struct Measurement* aM) |
|
420 { |
|
421 RProperty prop; |
|
422 TInt r = prop.Define(KPropBenchmarkCategory, 1, aM->iType, KPassPolicy, KPassPolicy); |
|
423 BM_ERROR(r, r == KErrNone); |
|
424 r = prop.Attach(KPropBenchmarkCategory, 1); |
|
425 BM_ERROR(r, r == KErrNone); |
|
426 |
|
427 if (aM->iType == RProperty::EByteArray) |
|
428 { |
|
429 TPtrC8 ptr(iOutBuf.Ptr(), aM->iSize); |
|
430 r = prop.Set(ptr); |
|
431 BM_ERROR(r, r == KErrNone); |
|
432 } |
|
433 |
|
434 TBMTimeInterval ti; |
|
435 ti.Begin(); |
|
436 for (TBMUInt64 i = 0; i < aIter; ++i) |
|
437 { |
|
438 switch(aM->iSetGetType) |
|
439 { |
|
440 case EOneArg: |
|
441 if (aM->iType == RProperty::EInt) |
|
442 { |
|
443 TInt value = 1; |
|
444 r = prop.Get(value); |
|
445 BM_ERROR(r, r == KErrNone); |
|
446 } |
|
447 else |
|
448 { |
|
449 r = prop.Get(iInBuf); |
|
450 BM_ERROR(r, r == KErrNone); |
|
451 } |
|
452 break; |
|
453 case EThreeArgsInt: |
|
454 { |
|
455 TInt value = 1; |
|
456 r = prop.Get(KPropBenchmarkCategory, 1, value); |
|
457 BM_ERROR(r, r == KErrNone); |
|
458 } |
|
459 break; |
|
460 case EThreeArgsBuf8: |
|
461 r = prop.Get(KPropBenchmarkCategory, 1, iInBuf); |
|
462 BM_ERROR(r, r == KErrNone); |
|
463 break; |
|
464 case EThreeArgsBuf16: |
|
465 r = prop.Get(KPropBenchmarkCategory, 1, iInBuf16); |
|
466 BM_ERROR(r, r == KErrNone); |
|
467 break; |
|
468 } |
|
469 } |
|
470 TBMTicks t = ti.End(); |
|
471 |
|
472 prop.Close(); |
|
473 r = prop.Delete(KPropBenchmarkCategory, 1); |
|
474 BM_ERROR(r, r == KErrNone); |
|
475 |
|
476 aResult->Cumulate(t, aIter); |
|
477 } |
|
478 |
|
479 |
|
480 |
|
481 TBMResult* Property::Run(TBMUInt64 aIter, TInt* aCount) |
|
482 { |
|
483 TInt count = sizeof(iResults)/sizeof(iResults[0]); |
|
484 |
|
485 for (TInt i = 0; i < count; ++i) |
|
486 { |
|
487 iResults[i].Reset(iMeasurements[i].iName); |
|
488 iMeasurements[i].iFunc(&iResults[i], aIter, &iMeasurements[i]); |
|
489 iResults[i].Update(); |
|
490 } |
|
491 |
|
492 *aCount = count; |
|
493 return iResults; |
|
494 } |
|
495 |
|
496 void AddProperty() |
|
497 { |
|
498 BMProgram* next = bmSuite; |
|
499 bmSuite=(BMProgram*)&property; |
|
500 bmSuite->Next()=next; |
|
501 } |