diff -r 000000000000 -r bde4ae8d615e os/ossrv/lowlevellibsandfws/pluginfw/Framework/frame/EComPerformance.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Framework/frame/EComPerformance.cpp Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,201 @@ +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// Implementation of static class to log ECom performance +// +// + +/** + @internalComponent + @file +*/ + +#include +#include "EComPerformance.h" + +#ifdef __ECOM_SERVER_PERFORMANCE__ + +TUint32 EComPerformance::iEComStartupStateTimerResults[KEComStartupStateTimerResultMaxCount]; +TInt EComPerformance::iEComStartupStateTimerResultCount = 0; +TClientRequestTimerEntry EComPerformance::iAccumulatedClientRequestTimerResults[KAccumulatedClientRequestTimerResultMaxCount]; +TInt EComPerformance::iAccumulatedClientRequestTimerResultCount = 0; +TEComPerfTimeRecordEntry EComPerformance::iEComPerfTimeRecords[KEComPerfTimerRecordMaxCount]; +TInt EComPerformance::iEComPerfTimeRecordCount = 0; +TEComPerfHeapUsage EComPerformance::iEComStartupStateHeapResults[KEComStartupStateHeapResultMaxCount]; +TInt EComPerformance::iEComStartupStateHeapResultCount=0; + +/** + Retrieves startup state timing data from the given index + @param aTimerIdx The index of the timing entry to retrieve + @param aTimerResult On return contains the timing (using FastCounter) at the given index + @param aState The state the timing data is for + */ +TInt EComPerformance::GetStartupStateTimerResult(TInt aTimerIdx, TUint32& aTimerResult, TInt& aState) + { + TInt resultIdx = aTimerIdx * 2; + aTimerResult = 0; + aState = -1; + + if(iEComStartupStateTimerResultCount > resultIdx + 1) + { + aTimerResult = iEComStartupStateTimerResults[resultIdx]; + aState = iEComStartupStateTimerResults[resultIdx+1]; + } + else + { + RDebug::Print(_L("Exceeded size of %d held by KEComStartupStateTimerResults array\n"), iEComStartupStateTimerResultCount); + return KErrOverflow; + } + return KErrNone; + } + +/** + Records timing data for the given state that can be retrieved using GetStartupStateTimerResult + @param aState The state the timing data is for + */ +void EComPerformance::RecordStartupStateTimerResult(TInt aState) + { + if(iEComStartupStateTimerResultCount+1