os/graphics/graphicstest/graphicstestharness/inc/tprofiler.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicstest/graphicstestharness/inc/tprofiler.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,99 @@
     1.4 +// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @test
    1.22 + @internalComponent - Internal Symbian test code 
    1.23 +*/
    1.24 +
    1.25 +#ifndef __TPROFILER_H__
    1.26 +#define __TPROFILER_H__
    1.27 +
    1.28 +#include <e32base.h>
    1.29 +#include <test/tefexportconst.h>
    1.30 +
    1.31 +class CTestStep;
    1.32 +
    1.33 +_LIT(KSqlInsert,        "SQL_UPLOAD_VERSION_0:insert into performance.testresultstable (sessionid, testname, testattribute, testunits, testresultvalue) values ");
    1.34 +_LIT(KSqlData,          "SQL_UPLOAD_VERSION_0:('%u', '%S', '%S', '%S', '%d');");
    1.35 +_LIT(KMicroSeconds,     "us");
    1.36 +_LIT(KPixelsPerSecond,  "pixels/second");
    1.37 +_LIT(KFrameRate,        "frames/second");
    1.38 +_LIT(KCharacterRate,    "characters/second");
    1.39 +_LIT(KGlyphRate,        "glyphs/second");
    1.40 +_LIT(KVariation,        "Rot_%i_SrcMode_%i_DestMode_%i_Iters_%i");
    1.41 +_LIT(KVariationPPI,     "Rot_%i_SrcMode_%i_DestMode_%i_Iters_%i_PPI_%i");
    1.42 +_LIT(KVariationZOrder,  "ZOrd_%i_SrcMode_%i_DestMode_%i_Iters_%i_PPI_%i");
    1.43 +_LIT(KVariationCPI,     "Rot_%i_SrcMode_%i_DestMode_%i_Iters_%i_CPI_%i");
    1.44 +_LIT(KMaxTime,          "%S_Max");
    1.45 +_LIT(KMinTime,          "%S_Min");
    1.46 +_LIT(KMean,             "%S_Mean");
    1.47 +_LIT(KTrimmedMean,      "%S_TrimmedMean");
    1.48 +
    1.49 +class CTProfiler : public CBase
    1.50 +    {
    1.51 +public:
    1.52 +    IMPORT_C static CTProfiler* NewL(CTestStep& aTestStep);
    1.53 +    IMPORT_C ~CTProfiler();
    1.54 +    IMPORT_C void StartTimer();
    1.55 +    IMPORT_C TInt64 StopTimer();
    1.56 +    IMPORT_C void InitResults();
    1.57 +    IMPORT_C void MarkResultSetL();
    1.58 +    IMPORT_C void MarkResultSetAndSuspendL();
    1.59 +    IMPORT_C TUint32 GetTrimedMean();
    1.60 +    IMPORT_C TUint32 Mean();
    1.61 +    IMPORT_C TInt PercentageChange(TInt aFirstTime, TInt aSecondTime);
    1.62 +    IMPORT_C void ResultsAnalysis(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters);
    1.63 +    IMPORT_C void ResultsAnalysisPixelRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels);
    1.64 +    IMPORT_C void ResultsAnalysisCharacterRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels);
    1.65 +    IMPORT_C void ResultsAnalysisAverageByIterations(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters);
    1.66 +    IMPORT_C void ResultsAnalysisAverageByNumberOfIterations(const TDesC& aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters);
    1.67 +    IMPORT_C void ResultsAnalysisFrameRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels);
    1.68 +    IMPORT_C void ResultsAnalysisScreenRotationRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels);
    1.69 +    IMPORT_C void ResultsAnalysisZorderSwitchingRate(const TDesC & aTestName, TInt aZorderSwitching, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels);
    1.70 +	IMPORT_C void FreeResultsMemory();
    1.71 +	IMPORT_C TUint32 TimeMax();
    1.72 +	IMPORT_C TUint32 TimeMin();
    1.73 +	IMPORT_C void ShowResultArrayInTimingOrder();
    1.74 +	IMPORT_C void SetStoreResultInTimingOrder(TBool aStoreResultInTimingOrder);
    1.75 +	IMPORT_C void SqlInsert(const TDesC* aTestName, const TDesC* aTestAttribute, const TDesC* aTestUnit, TInt32 aTestResultValue);
    1.76 +	IMPORT_C void ResultsAnalysisGlyphRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels);
    1.77 +
    1.78 +private:
    1.79 +    CTProfiler(CTestStep& aTestStep);
    1.80 +    void ConstructL();
    1.81 +    
    1.82 +private:
    1.83 +    TUint32             iStart;
    1.84 +    TUint32             iEnd;
    1.85 +    TUint32             iDiff;
    1.86 +    TInt                iFreq;  
    1.87 +    RArray<TUint32>     iResults;
    1.88 +    RArray<TUint32>     iResultsTimingOrder;
    1.89 +    TBool               iResultsInitalised;
    1.90 +    CTestStep&          iTestStep;
    1.91 +    TBool               iStoreResultInTimingOrder;
    1.92 +    /*
    1.93 +     * The session identifier is a number which allows a number of
    1.94 +     * related performance metrics for a given test to be grouped
    1.95 +     * under the same "session".
    1.96 +     */
    1.97 +	 TUint32			iSessionId;
    1.98 +    };
    1.99 +
   1.100 +#endif
   1.101 +
   1.102 +