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