64 { |
64 { |
65 TInt error = KErrNone; |
65 TInt error = KErrNone; |
66 TUint32 callResults[KNumberOfTraceCallIterations]; |
66 TUint32 callResults[KNumberOfTraceCallIterations]; |
67 for(TInt i = 0; i < KNumberOfTraceCallIterations; i++) |
67 for(TInt i = 0; i < KNumberOfTraceCallIterations; i++) |
68 { |
68 { |
69 error = TimeTraceCall(aApiRunConfig, aApiRunResults); |
69 error = TimeTraceCallL(aApiRunConfig, aApiRunResults); |
70 callResults[i] = aApiRunResults.iApiTraceTime; |
70 callResults[i] = aApiRunResults.iApiTraceTime; |
71 } |
71 } |
72 TUint32 total = 0; |
72 TUint32 total = 0; |
73 for(TInt i = 0; i < KNumberOfTraceCallIterations; i++) |
73 for(TInt i = 0; i < KNumberOfTraceCallIterations; i++) |
74 total += callResults[i]; |
74 total += callResults[i]; |
75 aApiRunResults.iApiTraceTime = total / KNumberOfTraceCallIterations; //average |
75 aApiRunResults.iApiTraceTime = total / KNumberOfTraceCallIterations; //average |
76 return error; |
76 return error; |
77 } |
77 } |
78 |
78 |
79 TInt TUptTraceTester::TimeTraceCall(const TApiRunConfig& aApiRunConfig, TApiRunResults& aApiRunResults) |
79 TInt TUptTraceTester::TimeTraceCallL(const TApiRunConfig& aApiRunConfig, TApiRunResults& aApiRunResults) |
80 { |
80 { |
81 TInt error = KErrNone; |
81 TInt error = KErrNone; |
82 if(TUptTraceCalls::IsKernelTrace(aApiRunConfig.iApiId)) |
82 if(TUptTraceCalls::IsKernelTrace(aApiRunConfig.iApiId)) |
83 { |
83 { |
84 RUptUTrace utracedriver; |
84 RUptUTrace utracedriver; |
89 } |
89 } |
90 utracedriver.Close(); |
90 utracedriver.Close(); |
91 } |
91 } |
92 else |
92 else |
93 { |
93 { |
94 error = TimeUsersideTraceCalls(aApiRunConfig, aApiRunResults); |
94 error = TimeUsersideTraceCallsL(aApiRunConfig, aApiRunResults); |
95 } |
95 } |
96 |
96 |
97 return error; |
97 return error; |
98 } |
98 } |
99 |
99 |
100 TInt TUptTraceTester::TimeUsersideTraceCalls(const TApiRunConfig& aApiRunConfig, TApiRunResults& aApiRunResults) //pass the configuration here |
100 TInt TUptTraceTester::TimeUsersideTraceCallsL(const TApiRunConfig& aApiRunConfig, TApiRunResults& aApiRunResults) //pass the configuration here |
101 { |
101 { |
102 aApiRunResults.iTimeCount = 0; |
102 aApiRunResults.iTimeCount = 0; |
103 CUptTimer timer; |
103 CUptTimer timer; |
104 TInt error = timer.StartBackgroundTimer(); |
104 TInt error = timer.StartBackgroundTimer(); |
105 if(!error) |
105 if(!error) |