--- a/egl/eglinterface/include/khrplatform.h Mon May 03 13:44:32 2010 +0300
+++ b/egl/eglinterface/include/khrplatform.h Fri May 14 17:10:13 2010 +0300
@@ -130,7 +130,7 @@
# define KHRAPI KHRONOS_APICALL
#endif
-#if defined (__ARMCC_2__)
+#if defined(__ARMCC__)
#define KHRONOS_APIATTRIBUTES __softfp
#else
#define KHRONOS_APIATTRIBUTES
--- a/graphicscomposition/surfaceupdate/inc/contentreadyforcomposition.h Mon May 03 13:44:32 2010 +0300
+++ b/graphicscomposition/surfaceupdate/inc/contentreadyforcomposition.h Fri May 14 17:10:13 2010 +0300
@@ -38,17 +38,18 @@
the compositor and will be used in future compositions involving that
surface.
-The compositor maintains a content update count for each registered
-surface that determines when content ready notifications will be
-completed. The content update count is internally incremented by the
-compositor every time it receives a valid content update for a
-registered surface. Frames may be skipped if the client submits
-content updates too fast, meaning that not every update is displayed
-on screen. The first valid content update sets the content update
-count to one. Updates sent before the surface is registered do not
-affect the content update count. Content ready notifications for
-aContentUpdate = 1 will only be successfully completed after at least
-one content update has been received.
+Each compositor in the system maintains its own content update count
+for each registered surface that determines when content ready
+notifications will be completed. Therefore the content update count is
+considered per-surface-per-screen. The content update count is
+internally incremented by the compositor every time it receives a
+valid content update for a registered surface. Frames may be skipped
+if the client submits content updates too fast, meaning that not every
+update is displayed on screen. The first valid content update sets the
+content update count to one. Updates sent before the surface is
+registered do not affect the content update count. Content ready
+notifications for aContentUpdate = 1 will only be successfully
+completed after at least one content update has been received.
*/
class MContentReadyForComposition
{
--- a/graphicstest/graphicstestharness/bwins/tprofileru.def Mon May 03 13:44:32 2010 +0300
+++ b/graphicstest/graphicstestharness/bwins/tprofileru.def Fri May 14 17:10:13 2010 +0300
@@ -17,9 +17,10 @@
?ResultsAnalysisFrameRate@CTProfiler@@QAEXABVTDesC16@@HHHHH@Z @ 16 NONAME ; void CTProfiler::ResultsAnalysisFrameRate(class TDesC16 const &, int, int, int, int, int)
?StartTimer@CTProfiler@@QAEXXZ @ 17 NONAME ; void CTProfiler::StartTimer(void)
?FreeResultsMemory@CTProfiler@@QAEXXZ @ 18 NONAME ; void CTProfiler::FreeResultsMemory(void)
- ?TimeMin@CTProfiler@@QAEKXZ @ 19 NONAME ; unsigned long CTProfiler::TimeMin(void)
- ?TimeMax@CTProfiler@@QAEKXZ @ 20 NONAME ; unsigned long CTProfiler::TimeMax(void)
- ?MarkResultSetAndSuspendL@CTProfiler@@QAEXXZ @ 21 NONAME ; void CTProfiler::MarkResultSetAndSuspendL(void)
- ?SetStoreResultInTimingOrder@CTProfiler@@QAEXH@Z @ 22 NONAME ; void CTProfiler::SetStoreResultInTimingOrder(int)
- ?ShowResultArrayInTimingOrder@CTProfiler@@QAEXXZ @ 23 NONAME ; void CTProfiler::ShowResultArrayInTimingOrder(void)
+ ?TimeMin@CTProfiler@@QAEKXZ @ 19 NONAME ; unsigned long CTProfiler::TimeMin(void)
+ ?TimeMax@CTProfiler@@QAEKXZ @ 20 NONAME ; unsigned long CTProfiler::TimeMax(void)
+ ?MarkResultSetAndSuspendL@CTProfiler@@QAEXXZ @ 21 NONAME ; void CTProfiler::MarkResultSetAndSuspendL(void)
+ ?SetStoreResultInTimingOrder@CTProfiler@@QAEXH@Z @ 22 NONAME ; void CTProfiler::SetStoreResultInTimingOrder(int)
+ ?ShowResultArrayInTimingOrder@CTProfiler@@QAEXXZ @ 23 NONAME ; void CTProfiler::ShowResultArrayInTimingOrder(void)
+ ?SqlInsert@CTProfiler@@QAEXPBVTDesC16@@00J@Z @ 24 NONAME ; void CTProfiler::SqlInsert(class TDesC16 const *, class TDesC16 const *, class TDesC16 const *, long)
--- a/graphicstest/graphicstestharness/eabi/tprofileru.def Mon May 03 13:44:32 2010 +0300
+++ b/graphicstest/graphicstestharness/eabi/tprofileru.def Fri May 14 17:10:13 2010 +0300
@@ -26,4 +26,5 @@
_ZN10CTProfiler24MarkResultSetAndSuspendLEv @ 25 NONAME
_ZN10CTProfiler27SetStoreResultInTimingOrderEi @ 26 NONAME
_ZN10CTProfiler28ShowResultArrayInTimingOrderEv @ 27 NONAME
+ _ZN10CTProfiler9SqlInsertEPK7TDesC16S2_S2_l @ 28 NONAME
--- a/graphicstest/graphicstestharness/inc/tprofiler.h Mon May 03 13:44:32 2010 +0300
+++ b/graphicstest/graphicstestharness/inc/tprofiler.h Fri May 14 17:10:13 2010 +0300
@@ -27,6 +27,20 @@
class CTestStep;
+_LIT(KSqlInsert, "SQL_UPLOAD_VERSION_0:insert into performance.testresultstable (sessionid, testname, testattribute, testunits, testresultvalue) values ");
+_LIT(KSqlData, "SQL_UPLOAD_VERSION_0:('%u', '%S', '%S', '%S', '%d');");
+_LIT(KMicroSeconds, "us");
+_LIT(KPixelsPerSecond, "pixels/second");
+_LIT(KFrameRate, "frames/second");
+_LIT(KCharacterRate, "characters/second");
+_LIT(KVariation, "Rot_%i_SrcMode_%i_DestMode_%i_Iters_%i");
+_LIT(KVariationPPI, "Rot_%i_SrcMode_%i_DestMode_%i_Iters_%i_PPI_%i");
+_LIT(KVariationZOrder, "ZOrd_%i_SrcMode_%i_DestMode_%i_Iters_%i_PPI_%i");
+_LIT(KVariationCPI, "Rot_%i_SrcMode_%i_DestMode_%i_Iters_%i_CPI_%i");
+_LIT(KMaxTime, "%S_Max");
+_LIT(KMinTime, "%S_Min");
+_LIT(KMean, "%S_Mean");
+_LIT(KTrimmedMean, "%S_TrimmedMean");
class CTProfiler : public CBase
{
@@ -54,6 +68,8 @@
IMPORT_C TUint32 TimeMin();
IMPORT_C void ShowResultArrayInTimingOrder();
IMPORT_C void SetStoreResultInTimingOrder(TBool aStoreResultInTimingOrder);
+ IMPORT_C void SqlInsert(const TDesC* aTestName, const TDesC* aTestAttribute, const TDesC* aTestUnit, TInt32 aTestResultValue);
+
private:
CTProfiler(CTestStep& aTestStep);
@@ -69,6 +85,12 @@
TBool iResultsInitalised;
CTestStep& iTestStep;
TBool iStoreResultInTimingOrder;
+ /*
+ * The session identifier is a number which allows a number of
+ * related performance metrics for a given test to be grouped
+ * under the same "session".
+ */
+ TUint32 iSessionId;
};
#endif
--- a/graphicstest/graphicstestharness/src/tprofiler.cpp Mon May 03 13:44:32 2010 +0300
+++ b/graphicstest/graphicstestharness/src/tprofiler.cpp Fri May 14 17:10:13 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 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"
@@ -20,6 +20,7 @@
*/
#include <test/TestExecuteStepBase.h>
+#include <e32math.h>
#include <hal.h>
#include "tprofiler.h"
@@ -106,8 +107,24 @@
iResultsInitalised = ETrue;
iDiff = 0;
iResults.Reset();
- iResultsTimingOrder.Reset();
+ iSessionId = Math::Random();
+ if (iSessionId < 1000000)
+ {
+ /*
+ * The reason for bumping up low session id values is that it allows
+ * us to in the future to re-compact the session ids into a unique
+ * number range from zero to one million. Duplicate session id values
+ * generated on the same day can cause confusion but will be very rare.
+ */
+ iSessionId += 1000000;
+ }
+ /*
+ * The build system needs to know the session id because it maps it to
+ * the job ID it is running, so it can map test results to a particular
+ * build in question.
+ */
+ PROFILER_INFO_PRINTF2(_L("SQL_SESSION_ID=%u"), iSessionId);
StartTimer();
}
@@ -234,9 +251,19 @@
EXPORT_C void CTProfiler::ResultsAnalysis(const TDesC& aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters)
{
PROFILER_TEST(iResultsInitalised);
-
- PROFILER_INFO_PRINTF7(_L("TID: %S Rot: %i SrcMode: %i DestMode: %i Iters: %i TrimmedMean: %i us"), &aTestName, aRotation, aSrcScreenMode, aDstScreenMode, aIters, GetTrimedMean());
- PROFILER_INFO_PRINTF3(_L("Max: %i Min: %i "), TimeMax(), TimeMin());
+ TBuf<128> variation;
+ variation.Format(KVariation, aRotation, aSrcScreenMode, aDstScreenMode,aIters);
+ TBuf<128> variationMax;
+ variationMax.Format(KMaxTime, &variation);
+ TBuf<128> variationMin;
+ variationMin.Format(KMinTime, &variation);
+ TBuf<128> variationTrimmedMean;
+ variationTrimmedMean.Format(KTrimmedMean, &variation);
+
+ SqlInsert(&aTestName, &variationTrimmedMean, &KMicroSeconds, GetTrimedMean());
+ SqlInsert(&aTestName, &variationMax, &KPixelsPerSecond, TimeMax());
+ SqlInsert(&aTestName, &variationMin, &KPixelsPerSecond, TimeMin());
+
iResultsInitalised = EFalse;
}
@@ -254,10 +281,21 @@
EXPORT_C void CTProfiler::ResultsAnalysisPixelRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixelsPerIteration)
{
PROFILER_TEST(iResultsInitalised);
+
TReal time = (TReal)iResults[0] / 1000000;
- TInt32 pixelRate = aNumPixelsPerIteration*aIters/time;
- PROFILER_INFO_PRINTF7(_L("TID: %S Rot: %i SrcMode: %i DestMode: %i Iters: %i TrimmedMean: %i pixels/second"), &aTestName, aRotation, aSrcScreenMode, aDstScreenMode, aIters, pixelRate);
- PROFILER_INFO_PRINTF3(_L("Max: %i Min: %i "), TimeMax(), TimeMin());
+ TInt32 pixelRate = aNumPixelsPerIteration * aIters / time;
+
+ TBuf<128> variation;
+ variation.Format(KVariationPPI, aRotation, aSrcScreenMode, aDstScreenMode, aIters, aNumPixelsPerIteration);
+ TBuf<128> variationMax;
+ variationMax.Format(KMaxTime, &variation);
+ TBuf<128> variationMin;
+ variationMin.Format(KMinTime, &variation);
+
+ SqlInsert(&aTestName, &variation, &KPixelsPerSecond, pixelRate);
+ SqlInsert(&aTestName, &variationMax, &KPixelsPerSecond, TimeMax());
+ SqlInsert(&aTestName, &variationMin, &KPixelsPerSecond, TimeMin());
+
iResultsInitalised = EFalse;
}
@@ -277,8 +315,18 @@
PROFILER_TEST(iResultsInitalised);
TReal time = (TReal)iResults[0] / 1000000;
TInt32 characterRate = aNumCharsPerIteration*aIters/time;
- PROFILER_INFO_PRINTF7(_L("TID: %S Rot: %i SrcMode: %i DestMode: %i Iters: %i TrimmedMean: %i characters/second"), &aTestName, aRotation, aSrcScreenMode, aDstScreenMode, aIters, characterRate);
- PROFILER_INFO_PRINTF3(_L("Max: %i Min: %i "), TimeMax(), TimeMin());
+
+ TBuf<128> variation;
+ variation.Format(KVariationCPI, aRotation, aSrcScreenMode, aDstScreenMode, aIters, aNumCharsPerIteration);
+ TBuf<128> variationMax;
+ variationMax.Format(KMaxTime, &variation);
+ TBuf<128> variationMin;
+ variationMin.Format(KMinTime, &variation);
+
+ SqlInsert(&aTestName, &variation, &KCharacterRate, characterRate);
+ SqlInsert(&aTestName, &variationMax, &KCharacterRate, TimeMax());
+ SqlInsert(&aTestName, &variationMin, &KCharacterRate, TimeMin());
+
iResultsInitalised = EFalse;
}
@@ -298,11 +346,54 @@
{
PROFILER_TEST(iResultsInitalised);
- PROFILER_INFO_PRINTF7(_L("TID: %S Rot: %i SrcMode: %i DestMode: %i Iters: %i TrimmedMean: %i us"), &aTestName, aRotation, aSrcScreenMode, aDstScreenMode, aIters, iResults[0]/aIters);
- PROFILER_INFO_PRINTF3(_L("Max: %i Min: %i "), TimeMax(), TimeMin());
+ TUint32 result = iResults[0]/aIters;
+
+ TBuf<128> variation;
+ variation.Format(KVariation, aRotation, aSrcScreenMode, aDstScreenMode,aIters);
+ TBuf<128> variationMax;
+ variationMax.Format(KMaxTime, &variation);
+ TBuf<128> variationMin;
+ variationMin.Format(KMinTime, &variation);
+
+ SqlInsert(&aTestName, &variation, &KMicroSeconds, result);
+ SqlInsert(&aTestName, &variationMax, &KMicroSeconds, TimeMax());
+ SqlInsert(&aTestName, &variationMin, &KMicroSeconds, TimeMin());
+
iResultsInitalised = EFalse;
}
-
+
+/**
+ * Generate an SQL insert statement into the logs, intended for subsequent
+ * extraction by a script to load into the database.
+ * Inserts data fields for
+ * (sessionid, testname, testattribute, testunits, testresultvalue).
+ * An example insertion:
+ * <code>
+ * SQL_UPLOAD_VERSION_0:insert into performance.testresultstable (sessionid, testname, testattribute, testunits, testresultvalue) values
+ * SQL_UPLOAD_VERSION_0:('1136416860', 'GRAPHICS-UI-BENCH-S60-0009', 'Rot_0_SrcMode_0_DestMode_0_Iters_25', 'pixels/second', '394159');
+ * </code>
+ *
+ * @param aTestName Column testname
+ * @param aTestAttribute Column testattribute
+ * @param aTestUnit Column testunits
+ * @param aTestResultValue Column testresultvalue
+ */
+EXPORT_C void CTProfiler::SqlInsert(const TDesC* aTestName, const TDesC* aTestAttribute, const TDesC* aTestUnit, TInt32 aTestResultValue)
+ {
+ TBuf<200>scratchPad;
+ /*
+ * There is a 256 character limit on logging output, and a 7 vararg limit
+ * on the macro we can use to issue printfs to the test framework. Each
+ * output line which has SQL in it needs to have a marker at the front so
+ * that a script can reliably extract the SQL statements. Hence we use
+ * the following incremental strategy of getting our SQL statements output
+ * into the logs.
+ */
+ scratchPad.Format(KSqlInsert);
+ PROFILER_INFO_PRINTF2(_L("%S"), &scratchPad);
+ scratchPad.Format(KSqlData, iSessionId, aTestName, aTestAttribute, aTestUnit, aTestResultValue);
+ PROFILER_INFO_PRINTF2(_L("%S"), &scratchPad);
+ }
/**
Reports analysis results for frame rates
@@ -321,8 +412,19 @@
TReal time = (TReal)iResults[0] / 1000000;
TInt32 pixelRate = aNumPixelsPerIteration * aIters / time;
TInt32 frameRate = aIters / time;
- PROFILER_INFO_PRINTF7(_L("TID: %S Rot: %i SrcMode: %i DestMode: %i Iters: %i TrimmedMean: %i pixels/second"), &aTestName, aRotation, aSrcScreenMode, aDstScreenMode, aIters, pixelRate);
- PROFILER_INFO_PRINTF4(_L("Max: %i Min: %i Framerate: %i frames/second"), TimeMax(), TimeMin(), frameRate);
+
+ TBuf<128> variation;
+ variation.Format(KVariation, aRotation, aSrcScreenMode, aDstScreenMode, aIters);
+ TBuf<128> variationMax;
+ variationMax.Format(KMaxTime, &variation);
+ TBuf<128> variationMin;
+ variationMin.Format(KMinTime, &variation);
+
+ SqlInsert(&aTestName, &variation, &KPixelsPerSecond, pixelRate);
+ SqlInsert(&aTestName, &variation, &KFrameRate, frameRate);
+ SqlInsert(&aTestName, &variationMax, &KPixelsPerSecond, TimeMax());
+ SqlInsert(&aTestName, &variationMin, &KPixelsPerSecond, TimeMin());
+
iResultsInitalised = EFalse;
}
@@ -343,8 +445,19 @@
TReal time = (TReal)iResults[0] / 1000000;
TInt32 pixelRate = aNumPixelsPerIteration * aIters / time;
TInt32 frameRate = aIters / time;
- PROFILER_INFO_PRINTF7(_L("TID: %S Rot: %i SrcMode: %i DestMode: %i Iters: %i TrimmedMean: %i pixels/second"), &aTestName, aRotation, aSrcScreenMode, aDstScreenMode, aIters, pixelRate);
- PROFILER_INFO_PRINTF4(_L("Max: %i Min: %i Framerate: %i frames/second"), TimeMax(), TimeMin(), frameRate);
+
+ TBuf<128> variation;
+ variation.Format(KVariationPPI, aRotation, aSrcScreenMode, aDstScreenMode, aIters, aNumPixelsPerIteration);
+ TBuf<128> variationMax;
+ variationMax.Format(KMaxTime, &variation);
+ TBuf<128> variationMin;
+ variationMin.Format(KMinTime, &variation);
+
+ SqlInsert(&aTestName, &variation, &KPixelsPerSecond, pixelRate);
+ SqlInsert(&aTestName, &variation, &KFrameRate, frameRate);
+ SqlInsert(&aTestName, &variationMax, &KPixelsPerSecond, TimeMax());
+ SqlInsert(&aTestName, &variationMin, &KPixelsPerSecond, TimeMin());
+
iResultsInitalised = EFalse;
}
@@ -364,8 +477,19 @@
TReal time = (TReal)iResults[0] / 1000000;
TInt32 pixelRate = aNumPixelsPerIteration * aIters / time;
TInt32 frameRate = aIters / time;
- PROFILER_INFO_PRINTF7(_L("TID: %S Rot: %i SrcMode: %i DestMode: %i Iters: %i TrimmedMean: %i pixels/second"), &aTestName, aZorderSwitching, aSrcScreenMode, aDstScreenMode, aIters, pixelRate);
- PROFILER_INFO_PRINTF4(_L("Max: %i Min: %i Framerate: %i frames/second"), TimeMax(), TimeMin(), frameRate);
+
+ TBuf<128> variation;
+ variation.Format(KVariationZOrder, aZorderSwitching, aSrcScreenMode, aDstScreenMode, aIters, aNumPixelsPerIteration);
+ TBuf<128> variationMax;
+ variationMax.Format(KMaxTime, &variation);
+ TBuf<128> variationMin;
+ variationMin.Format(KMinTime, &variation);
+
+ SqlInsert(&aTestName, &variation, &KPixelsPerSecond, pixelRate);
+ SqlInsert(&aTestName, &variation, &KFrameRate, frameRate);
+ SqlInsert(&aTestName, &variationMax, &KPixelsPerSecond, TimeMax());
+ SqlInsert(&aTestName, &variationMin, &KPixelsPerSecond, TimeMin());
+
iResultsInitalised = EFalse;
}
@@ -397,9 +521,19 @@
EXPORT_C void CTProfiler::ResultsAnalysisAverageByNumberOfIterations(const TDesC& aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode,TInt aIters)
{
PROFILER_TEST(iResultsInitalised);
+ TBuf<128> variation;
+ variation.Format(KVariation, aRotation, aSrcScreenMode, aDstScreenMode, aIters);
+ TBuf<128> variationMean;
+ variationMean.Format(KMean, &variation);
+ TBuf<128> variationMax;
+ variationMax.Format(KMaxTime, &variation);
+ TBuf<128> variationMin;
+ variationMin.Format(KMinTime, &variation);
+
+ SqlInsert(&aTestName, &variationMean, &KMicroSeconds, Mean());
+ SqlInsert(&aTestName, &variationMax, &KPixelsPerSecond, TimeMax());
+ SqlInsert(&aTestName, &variationMin, &KPixelsPerSecond, TimeMin());
- PROFILER_INFO_PRINTF7(_L("TID: %S Rot: %i SrcMode: %i DestMode: %i Iters: %i TrimmedMean: %i us"), &aTestName, aRotation, aSrcScreenMode, aDstScreenMode, aIters, Mean());
- PROFILER_INFO_PRINTF3(_L("Max: %i Min: %i "), TimeMax(), TimeMin());
iResultsInitalised = EFalse;
}
--- a/graphicstest/uibench/group/bld.inf Mon May 03 13:44:32 2010 +0300
+++ b/graphicstest/uibench/group/bld.inf Fri May 14 17:10:13 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 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"
@@ -20,18 +20,18 @@
PRJ_EXPORTS
PRJ_TESTEXPORTS
-../scripts/te_uibench.script z:/uibench/te_uibench.script
+../scripts/te_uibench.script z:/uibench/te_uibench.script
../scripts/te_uibenchoutlineshadow.script z:/uibench/te_uibenchoutlineshadow.script
-../scripts/te_uibench.ini z:/uibench/te_uibench.ini
+../scripts/te_uibench.ini z:/uibench/te_uibench.ini
../scripts/te_uibench_gdi.script z:/uibench/te_uibench_gdi.script
../scripts/te_uibench_gdi.ini z:/uibench/te_uibench_gdi.ini
-../scripts/te_uibench_gce.script z:/uibench/te_uibench_gce.script
-../scripts/te_uibench_gce.ini z:/uibench/te_uibench_gce.ini
-../scripts/uibench2db.pl z:/uibench/uibench2db.pl
-
-../scripts/te_uibench_legacy.bat z:/uibench/te_uibench_legacy.bat
+../scripts/te_uibench_gce.script z:/uibench/te_uibench_gce.script
+../scripts/te_uibench_gce.ini z:/uibench/te_uibench_gce.ini
+../scripts/mysql.pm z:/uibench/mysql.pm
+../scripts/uploadsqlfromtestrun.pl z:/uibench/uploadsqlfromtestrun.pl
+../scripts/te_uibench_legacy.bat z:/uibench/te_uibench_legacy.bat
../scripts/te_uibench_out_legacy.bat z:/uibench/te_uibench_out_legacy.bat
./te_uibench.iby /epoc32/rom/include/te_uibench.iby
./te_outlineshadow.iby /epoc32/rom/include/te_outlineshadow.iby
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graphicstest/uibench/scripts/createdatabase.sql Fri May 14 17:10:13 2010 +0300
@@ -0,0 +1,55 @@
+# HeidiSQL Dump
+#
+# --------------------------------------------------------
+# Host: 4GBD02346
+# Database: performance
+# Server version: 5.1.43-community
+# Server OS: Win32
+# Target compatibility: ANSI SQL
+# HeidiSQL version: 4.0
+# Date/time: 2/16/2010 7:15:11 PM
+# --------------------------------------------------------
+
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI,NO_BACKSLASH_ESCAPES';*/
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;*/
+
+
+#
+# Database structure for database 'performance'
+#
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ "performance" /*!40100 DEFAULT CHARACTER SET ascii */;
+
+USE "performance";
+
+
+#
+# Table structure for table 'jobsessionmap'
+#
+
+CREATE TABLE /*!32312 IF NOT EXISTS*/ "jobsessionmap" (
+ "iterator" int(10) unsigned NOT NULL AUTO_INCREMENT,
+ "jobid" int(10) unsigned NOT NULL,
+ "sessionid" bigint(20) unsigned NOT NULL,
+ PRIMARY KEY ("iterator"),
+ UNIQUE KEY "iterator" ("iterator")
+) AUTO_INCREMENT=6 COMMENT='Maps session identifiers to job identifiers';
+
+
+
+#
+# Table structure for table 'testresultstable'
+#
+
+CREATE TABLE /*!32312 IF NOT EXISTS*/ "testresultstable" (
+ "iterator" int(8) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Allows easy reference and ordering of data inserted. Autogenerated number during insertion.',
+ "sessionid" bigint(20) unsigned NOT NULL COMMENT 'Random value, unique per test execution framework instance. First million reserved for compaction.',
+ "testname" text NOT NULL COMMENT 'The testexecute framework test name should be used here to map a test result to the test case source code.',
+ "testattribute" text NOT NULL COMMENT 'A given performance test may produce several attributes, e.g. framerate value, characters per second value. Each of these is a separate attribute.',
+ "testunits" text NOT NULL COMMENT 'Numerical results have a unit. For example, this could be fps for frames per second, or MB/s for Megabits per second.',
+ "testresultvalue" double unsigned NOT NULL COMMENT 'Numerical result value in the units specified in testunits',
+ PRIMARY KEY ("iterator")
+) AUTO_INCREMENT=27 COMMENT='Raw test results from graphics package performance tests.';
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE;*/
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graphicstest/uibench/scripts/mysql.pm Fri May 14 17:10:13 2010 +0300
@@ -0,0 +1,1124 @@
+# Copyright (C) 2002 Hiroyuki OYAMA. Japan. All rights reserved.
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+package Net::MySQL;
+
+use 5.004;
+use IO::Socket;
+use Carp;
+use vars qw($VERSION $DEBUG);
+use strict;
+$VERSION = '0.09';
+
+use constant COMMAND_SLEEP => "\x00";
+use constant COMMAND_QUIT => "\x01";
+use constant COMMAND_INIT_DB => "\x02";
+use constant COMMAND_QUERY => "\x03";
+use constant COMMAND_FIELD_LIST => "\x04";
+use constant COMMAND_CREATE_DB => "\x05";
+use constant COMMAND_DROP_DB => "\x06";
+use constant COMMAND_REFRESH => "\x07";
+use constant COMMAND_SHUTDOWN => "\x08";
+use constant COMMAND_STATISTICS => "\x09";
+use constant COMMAND_PROCESS_INFO => "\x0A";
+use constant COMMAND_CONNECT => "\x0B";
+use constant COMMAND_PROCESS_KILL => "\x0C";
+use constant COMMAND_DEBUG => "\x0D";
+use constant COMMAND_PING => "\x0E";
+use constant COMMAND_TIME => "\x0F";
+use constant COMMAND_DELAYED_INSERT => "\x10";
+use constant COMMAND_CHANGE_USER => "\x11";
+use constant COMMAND_BINLOG_DUMP => "\x12";
+use constant COMMAND_TABLE_DUMP => "\x13";
+use constant COMMAND_CONNECT_OUT => "\x14";
+
+use constant DEFAULT_PORT_NUMBER => 3306;
+use constant BUFFER_LENGTH => 1460;
+use constant DEFAULT_UNIX_SOCKET => '/tmp/mysql.sock';
+
+
+sub new
+{
+ my $class = shift;
+ my %args = @_;
+
+ my $self = bless {
+ hostname => $args{hostname},
+ unixsocket => $args{unixsocket} || DEFAULT_UNIX_SOCKET,
+ port => $args{port} || DEFAULT_PORT_NUMBER,
+ database => $args{database},
+ user => $args{user},
+ password => $args{password},
+ timeout => $args{timeout} || 60,
+ 'socket' => undef,
+ salt => '',
+ protocol_version => undef,
+ client_capabilities => 0,
+ affected_rows_length => 0,
+ }, $class;
+ $self->debug($args{debug});
+ $self->_initialize;
+ return $self;
+}
+
+
+sub query
+{
+ my $self = shift;
+ my $sql = join '', @_;
+ my $mysql = $self->{socket};
+
+ return $self->_execute_command(COMMAND_QUERY, $sql);
+}
+
+
+sub create_database
+{
+ my $self = shift;
+ my $db_name = shift;
+ my $mysql = $self->{socket};
+
+ return $self->_execute_command(COMMAND_CREATE_DB, $db_name);
+}
+
+
+sub drop_database
+{
+ my $self = shift;
+ my $db_name = shift;
+ my $mysql = $self->{socket};
+
+ return $self->_execute_command(COMMAND_DROP_DB, $db_name);
+}
+
+
+sub close
+{
+ my $self = shift;
+ my $mysql = $self->{socket};
+ return unless $mysql->can('send');
+
+ my $quit_message =
+ chr(length(COMMAND_QUIT)). "\x00\x00\x00". COMMAND_QUIT;
+ $mysql->send($quit_message, 0);
+ $self->_dump_packet($quit_message) if Net::MySQL->debug;
+ $mysql->close;
+}
+
+
+sub get_affected_rows_length
+{
+ my $self = shift;
+ $self->{affected_rows_length};
+}
+
+
+sub get_insert_id
+{
+ my $self = shift;
+ $self->{insert_id};
+}
+
+
+sub create_record_iterator
+{
+ my $self = shift;
+ return undef unless $self->has_selected_record;
+
+ my $record = Net::MySQL::RecordIterator->new(
+ $self->{selected_record}
+ );
+ $self->{selected_record} = undef;
+ $record->parse;
+ return $record;
+}
+
+
+sub has_selected_record
+{
+ my $self = shift;
+ $self->{selected_record} ? 1 : undef;
+}
+
+
+sub is_error
+{
+ my $self = shift;
+ $self->{error_code} ? 1 : undef;
+}
+
+
+sub get_error_code
+{
+ my $self = shift;
+ $self->{error_code};
+}
+
+
+sub get_error_message
+{
+ my $self = shift;
+ $self->{server_message};
+}
+
+
+sub debug
+{
+ my $class = shift;
+ $DEBUG = shift if @_;
+ $DEBUG;
+}
+
+
+sub _connect
+{
+ my $self = shift;
+
+ my $mysql;
+ if ($self->{hostname}) {
+ printf "Use INET Socket: %s %d/tcp\n", $self->{hostname}, $self->{port}
+ if $self->debug;
+ $mysql = IO::Socket::INET->new(
+ PeerAddr => $self->{hostname},
+ PeerPort => $self->{port},
+ Proto => 'tcp',
+ Timeout => $self->{timeout} || 60,
+ ) or croak "Couldn't connect to $self->{hostname}:$self->{port}/tcp: $@";
+ }
+ else {
+ printf "Use UNIX Socket: %s\n", $self->{unixsocket} if $self->debug;
+ $mysql = IO::Socket::UNIX->new(
+ Type => SOCK_STREAM,
+ Peer => $self->{unixsocket},
+ ) or croak "Couldn't connect to $self->{unixsocket}: $@";
+ }
+ $mysql->autoflush(1);
+ $self->{socket} = $mysql;
+}
+
+
+sub _get_server_information
+{
+ my $self = shift;
+ my $mysql = $self->{socket};
+
+ my $message;
+ $mysql->recv($message, BUFFER_LENGTH, 0);
+ $self->_dump_packet($message)
+ if Net::MySQL->debug;
+ my $i = 0;
+ my $packet_length = ord substr $message, $i, 1;
+ $i += 4;
+ $self->{protocol_version} = ord substr $message, $i, 1;
+ printf "Protocol Version: %d\n", $self->{protocol_version}
+ if Net::MySQL->debug;
+ if ($self->{protocol_version} == 10) {
+ $self->{client_capabilities} = 1;
+ }
+
+ ++$i;
+ my $string_end = index($message, "\0", $i) - $i;
+ $self->{server_version} = substr $message, $i, $string_end;
+ printf "Server Version: %s\n", $self->{server_version}
+ if Net::MySQL->debug;
+
+ $i += $string_end + 1;
+ $self->{server_thread_id} = unpack 'v', substr $message, $i, 2;
+ $i += 4;
+ $self->{salt} = substr $message, $i, 8;
+ #
+ $i += 8+1;
+ if (length $message >= $i + 1) {
+ $i += 1;
+ }
+ if (length $message >= $i + 18) {
+ # get server_language
+ # get server_status
+ }
+ $i += 18 - 1;
+ if (length $message >= $i + 12 - 1) {
+ $self->{salt} .= substr $message, $i, 12;
+ }
+ printf "Salt: %s\n", $self->{salt} if Net::MySQL->debug;
+
+}
+
+
+sub _request_authentication
+{
+ my $self = shift;
+ my $mysql = $self->{socket};
+ $self->_send_login_message();
+
+ my $auth_result;
+ $mysql->recv($auth_result, BUFFER_LENGTH, 0);
+ $self->_dump_packet($auth_result) if Net::MySQL->debug;
+ if ($self->_is_error($auth_result)) {
+ $mysql->close;
+ if (length $auth_result < 7) {
+ croak "Timeout of authentication";
+ }
+ croak substr $auth_result, 7;
+ }
+ print "connect database\n" if Net::MySQL->debug;
+}
+
+
+sub _send_login_message
+{
+ my $self = shift;
+ my $mysql = $self->{socket};
+ my $body = "\0\0\x01\x0d\xa6\03\0\0\0\0\x01".
+ "\x21\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0".
+ join "\0",
+ $self->{user},
+ "\x14".
+ Net::MySQL::Password->scramble(
+ $self->{password}, $self->{salt}, $self->{client_capabilities}
+ );
+ $body .= $self->{database};
+ $body .= "\0";
+ my $login_message = chr(length($body)-3). $body;
+ $mysql->send($login_message, 0);
+ $self->_dump_packet($login_message) if Net::MySQL->debug;
+}
+
+
+
+sub _execute_command
+{
+ my $self = shift;
+ my $command = shift;
+ my $sql = shift;
+ my $mysql = $self->{socket};
+
+ my $message = pack('V', length($sql) + 1). $command. $sql;
+ $mysql->send($message, 0);
+ $self->_dump_packet($message) if Net::MySQL->debug;
+
+ my $result;
+ $mysql->recv($result, BUFFER_LENGTH, 0);
+ $self->_dump_packet($result) if Net::MySQL->debug;
+ $self->_reset_status;
+
+ if ($self->_is_error($result)) {
+ return $self->_set_error_by_packet($result);
+ }
+ elsif ($self->_is_select_query_result($result)) {
+ return $self->_get_record_by_server($result);
+ }
+ elsif ($self->_is_update_query_result($result)){
+ return $self->_get_affected_rows_information_by_packet($result);
+ }
+ else {
+ croak 'Unknown Result: '. $self->_get_result_length($result). 'byte';
+ }
+}
+
+
+sub _initialize
+{
+ my $self = shift;
+ $self->_connect;
+ $self->_get_server_information;
+ $self->_request_authentication;
+}
+
+
+sub _set_error_by_packet
+{
+ my $self = shift;
+ my $packet = shift;
+
+ my $error_message = $self->_get_server_message($packet);
+ $self->{server_message} = $error_message;
+ $self->{error_code} = $self->_get_error_code($packet);
+ return undef;
+}
+
+
+sub _get_record_by_server
+{
+ my $self = shift;
+ my $packet = shift;
+ my $mysql = $self->{socket};
+ $self->_get_column_length($packet);
+ while ($self->_has_next_packet($packet)) {
+ my $next_result;
+ $mysql->recv($next_result, BUFFER_LENGTH, 0);
+ $packet .= $next_result;
+ $self->_dump_packet($next_result) if Net::MySQL->debug;
+ }
+ $self->{selected_record} = $packet;
+}
+
+
+sub _get_affected_rows_information_by_packet
+{
+ my $self = shift;
+ my $packet = shift;
+
+ $self->{affected_rows_length} = $self->_get_affected_rows_length($packet);
+ $self->{insert_id} = $self->_get_insert_id($packet);
+ $self->{server_message} = $self->_get_server_message($packet);
+ return $self->{affected_rows_length};
+}
+
+
+sub _is_error
+{
+ my $self = shift;
+ my $packet = shift;
+ return 1 if length $packet < 4;
+ ord(substr $packet, 4) == 255;
+}
+
+
+sub _is_select_query_result
+{
+ my $self = shift;
+ my $packet = shift;
+ return undef if $self->_is_error($packet);
+ ord(substr $packet, 4) >= 1;
+}
+
+
+sub _is_update_query_result
+{
+ my $self = shift;
+ my $packet = shift;
+ return undef if $self->_is_error($packet);
+ ord(substr $packet, 4) == 0;
+}
+
+
+sub _get_result_length
+{
+ my $self = shift;
+ my $packet = shift;
+ ord(substr $packet, 0, 1)
+}
+
+
+sub _get_column_length
+{
+ my $self = shift;
+ my $packet = shift;
+ ord(substr $packet, 4);
+}
+
+
+sub _get_affected_rows_length
+{
+ my $self = shift;
+ my $packet = shift;
+ my $pos = 5;
+ return Net::MySQL::Util::get_field_length($packet, \$pos);
+}
+
+
+sub _get_insert_id
+{
+ my $self = shift;
+ my $packet = shift;
+ return ord(substr $packet, 6, 1) if ord(substr $packet, 6, 1) != 0xfc;
+ unpack 'v', substr $packet, 7, 2;
+}
+
+
+sub _get_server_message
+{
+ my $self = shift;
+ my $packet = shift;
+ return '' if length $packet < 7;
+ substr $packet, 7;
+}
+
+
+sub _get_error_code
+{
+ my $self = shift;
+ my $packet = shift;
+ $self->_is_error($packet)
+ or croak "_get_error_code(): Is not error packet";
+ unpack 'v', substr $packet, 5, 2;
+}
+
+
+sub _reset_status
+{
+ my $self = shift;
+ $self->{insert_id} = 0;
+ $self->{server_message} = '';
+ $self->{error_code} = undef;
+ $self->{selected_record} = undef;
+}
+
+
+sub _has_next_packet
+{
+ my $self = shift;
+ #substr($_[0], -1) ne "\xfe";
+ return substr($_[0], -5) ne "\xfe\0\0\x22\x00";
+}
+
+
+sub _dump_packet {
+ my $self = shift;
+ my $packet = shift;
+ my ($method_name) = (caller(1))[3];
+ my $str = sprintf "%s():\n", $method_name;
+ while ($packet =~ /(.{1,16})/sg) {
+ my $line = $1;
+ $str .= join ' ', map {sprintf '%02X', ord $_} split //, $line;
+ $str .= ' ' x (16 - length $line);
+ $str .= ' ';
+ $str .= join '', map {
+ sprintf '%s', (/[\w\d\*\,\?\%\=\'\;\(\)\.-]/) ? $_ : '.'
+ } split //, $line;
+ $str .= "\n";
+ }
+ print $str;
+}
+
+
+
+package Net::MySQL::RecordIterator;
+use strict;
+
+use constant NULL_COLUMN => 251;
+use constant UNSIGNED_CHAR_COLUMN => 251;
+use constant UNSIGNED_SHORT_COLUMN => 252;
+use constant UNSIGNED_INT24_COLUMN => 253;
+use constant UNSIGNED_INT32_COLUMN => 254;
+use constant UNSIGNED_CHAR_LENGTH => 1;
+use constant UNSIGNED_SHORT_LENGTH => 2;
+use constant UNSIGNED_INT24_LENGTH => 3;
+use constant UNSIGNED_INT32_LENGTH => 4;
+use constant UNSIGNED_INT32_PAD_LENGTH => 4;
+
+
+sub new
+{
+ my $class = shift;
+ my $packet = shift;
+ bless {
+ packet => $packet,
+ position => 0,
+ column => [],
+ }, $class;
+}
+
+
+sub parse
+{
+ my $self = shift;
+ $self->_get_column_length;
+ $self->_get_column_name;
+}
+
+
+sub each
+{
+ my $self = shift;
+ my @result;
+ return undef if $self->is_end_of_packet;
+
+ for (1..$self->{column_length}) {
+ push @result, $self->_get_string_and_seek_position;
+ }
+ $self->{position} += 4;
+
+ return \@result;
+}
+
+
+sub is_end_of_packet
+{
+ my $self = shift;
+ return substr($self->{packet}, $self->{position}, 1) eq "\xFE";
+}
+
+
+sub get_field_length
+{
+ my $self = shift;
+ $self->{column_length};
+}
+
+
+sub get_field_names
+{
+ my $self = shift;
+ map { $_->{column} } @{$self->{column}};
+}
+
+
+sub _get_column_length
+{
+ my $self = shift;
+ $self->{position} += 4;
+ $self->{column_length} = ord substr $self->{packet}, $self->{position}, 1;
+ $self->{position} += 5;
+ printf "Column Length: %d\n", $self->{column_length}
+ if Net::MySQL->debug;
+}
+
+
+sub _get_column_name
+{
+ my $self = shift;
+
+ for my $i (1.. $self->{column_length}) {
+ $self->_get_string_and_seek_position;
+ $self->_get_string_and_seek_position;
+ my $table = $self->_get_string_and_seek_position;
+ $self->_get_string_and_seek_position;
+ my $column = $self->_get_string_and_seek_position;
+ $self->_get_string_and_seek_position;
+ push @{$self->{column}}, {
+ table => $table,
+ column => $column,
+ };
+ $self->_get_string_and_seek_position;
+ $self->{position} += 4;
+ }
+ $self->{position} += 9;
+ printf "Column name: '%s'\n",
+ join ", ", map { $_->{column} } @{$self->{column}}
+ if Net::MySQL->debug;
+}
+
+
+sub _get_string_and_seek_position
+{
+ my $self = shift;
+
+ my $length = $self->_get_field_length();
+
+ return undef unless defined $length;
+
+ my $string = substr $self->{packet}, $self->{position}, $length;
+ $self->{position} += $length;
+ return $string;
+}
+
+
+sub _get_field_length
+{
+ my $self = shift;
+ return Net::MySQL::Util::get_field_length($self->{packet}, \$self->{position});
+}
+
+
+package Net::MySQL::Util;
+use strict;
+
+use constant NULL_COLUMN => 251;
+use constant UNSIGNED_CHAR_COLUMN => 251;
+use constant UNSIGNED_SHORT_COLUMN => 252;
+use constant UNSIGNED_INT24_COLUMN => 253;
+use constant UNSIGNED_INT32_COLUMN => 254;
+use constant UNSIGNED_CHAR_LENGTH => 1;
+use constant UNSIGNED_SHORT_LENGTH => 2;
+use constant UNSIGNED_INT24_LENGTH => 3;
+use constant UNSIGNED_INT32_LENGTH => 4;
+use constant UNSIGNED_INT32_PAD_LENGTH => 4;
+
+
+sub get_field_length
+{
+ my $packet = shift;
+ my $pos = shift;
+
+ my $head = ord substr(
+ $packet,
+ $$pos,
+ UNSIGNED_CHAR_LENGTH
+ );
+ $$pos += UNSIGNED_CHAR_LENGTH;
+
+ return undef if $head == NULL_COLUMN;
+ if ($head < UNSIGNED_CHAR_COLUMN) {
+ return $head;
+ }
+ elsif ($head == UNSIGNED_SHORT_COLUMN) {
+ my $length = unpack 'v', substr(
+ $packet,
+ $$pos,
+ UNSIGNED_SHORT_LENGTH
+ );
+ $$pos += UNSIGNED_SHORT_LENGTH;
+ return $length;
+ }
+ elsif ($head == UNSIGNED_INT24_COLUMN) {
+ my $int24 = substr(
+ $packet, $$pos,
+ UNSIGNED_INT24_LENGTH
+ );
+ my $length = unpack('C', substr($int24, 0, 1))
+ + (unpack('C', substr($int24, 1, 1)) << 8)
+ + (unpack('C', substr($int24, 2, 1)) << 16);
+ $$pos += UNSIGNED_INT24_LENGTH;
+ return $length;
+ }
+ else {
+ my $int32 = substr(
+ $packet, $$pos,
+ UNSIGNED_INT32_LENGTH
+ );
+ my $length = unpack('C', substr($int32, 0, 1))
+ + (unpack('C', substr($int32, 1, 1)) << 8)
+ + (unpack('C', substr($int32, 2, 1)) << 16)
+ + (unpack('C', substr($int32, 3, 1)) << 24);
+ $$pos += UNSIGNED_INT32_LENGTH;
+ $$pos += UNSIGNED_INT32_PAD_LENGTH;
+ return $length;
+ }
+}
+
+
+
+package Net::MySQL::Password;
+use strict;
+use Digest::SHA1;
+
+sub scramble {
+ my $class = shift;
+ my $password = shift;
+ my $hash_seed = shift;
+ return '' unless $password;
+ return '' if length $password == 0;
+ return _make_scrambled_password($hash_seed, $password);
+}
+
+
+sub _make_scrambled_password {
+ my $message = shift;
+ my $password = shift;
+
+ my $ctx = Digest::SHA1->new;
+ $ctx->reset;
+ $ctx->add($password);
+ my $stage1 = $ctx->digest;
+
+ $ctx->reset;
+ $ctx->add($stage1);
+ my $stage2 = $ctx->digest;
+
+ $ctx->reset;
+ $ctx->add($message);
+ $ctx->add($stage2);
+ my $result = $ctx->digest;
+ return _my_crypt($result, $stage1);
+}
+
+sub _my_crypt {
+ my $s1 = shift;
+ my $s2 = shift;
+ my $l = length($s1) - 1;
+ my $result = '';
+ for my $i (0..$l) {
+ $result .= pack 'C', (unpack('C', substr($s1, $i, 1)) ^ unpack('C', substr($s2, $i, 1)));
+ }
+ return $result;
+}
+
+package Net::MySQL::Password32;
+use strict;
+
+sub scramble
+{
+ my $class = shift;
+ my $password = shift;
+ my $hash_seed = shift;
+ my $client_capabilities = shift;
+
+ return '' unless $password;
+ return '' if length $password == 0;
+
+ my $hsl = length $hash_seed;
+ my @out;
+ my @hash_pass = _get_hash($password);
+ my @hash_mess = _get_hash($hash_seed);
+
+ my ($max_value, $seed, $seed2);
+ my ($dRes, $dSeed, $dMax);
+ if ($client_capabilities < 1) {
+ $max_value = 0x01FFFFFF;
+ $seed = _xor_by_long($hash_pass[0], $hash_mess[0]) % $max_value;
+ $seed2 = int($seed / 2);
+ } else {
+ $max_value= 0x3FFFFFFF;
+ $seed = _xor_by_long($hash_pass[0], $hash_mess[0]) % $max_value;
+ $seed2 = _xor_by_long($hash_pass[1], $hash_mess[1]) % $max_value;
+ }
+ $dMax = $max_value;
+
+ for (my $i=0; $i < $hsl; $i++) {
+ $seed = int(($seed * 3 + $seed2) % $max_value);
+ $seed2 = int(($seed + $seed2 + 33) % $max_value);
+ $dSeed = $seed;
+ $dRes = $dSeed / $dMax;
+ push @out, int($dRes * 31) + 64;
+ }
+
+ if ($client_capabilities == 1) {
+ # Make it harder to break
+ $seed = ($seed * 3 + $seed2 ) % $max_value;
+ $seed2 = ($seed + $seed2 + 33 ) % $max_value;
+ $dSeed = $seed;
+
+ $dRes = $dSeed / $dMax;
+ my $e = int($dRes * 31);
+ for (my $i=0; $i < $hsl ; $i++) {
+ $out[$i] ^= $e;
+ }
+ }
+ return join '', map { chr $_ } @out;
+}
+
+
+sub _get_hash
+{
+ my $password = shift;
+
+ my $nr = 1345345333;
+ my $add = 7;
+ my $nr2 = 0x12345671;
+ my $tmp;
+ my $pwlen = length $password;
+ my $c;
+
+ for (my $i=0; $i < $pwlen; $i++) {
+ my $c = substr $password, $i, 1;
+ next if $c eq ' ' || $c eq "\t";
+ my $tmp = ord $c;
+ my $value = ((_and_by_char($nr, 63) + $add) * $tmp) + $nr * 256;
+ $nr = _xor_by_long($nr, $value);
+ $nr2 += _xor_by_long(($nr2 * 256), $nr);
+ $add += $tmp;
+ }
+ return (_and_by_long($nr, 0x7fffffff), _and_by_long($nr2, 0x7fffffff));
+}
+
+
+sub _and_by_char
+{
+ my $source = shift;
+ my $mask = shift;
+
+ return $source & $mask;
+}
+
+
+sub _and_by_long
+{
+ my $source = shift;
+ my $mask = shift || 0xFFFFFFFF;
+
+ return _cut_off_to_long($source) & _cut_off_to_long($mask);
+}
+
+
+sub _xor_by_long
+{
+ my $source = shift;
+ my $mask = shift || 0;
+
+ return _cut_off_to_long($source) ^ _cut_off_to_long($mask);
+}
+
+
+sub _cut_off_to_long
+{
+ my $source = shift;
+
+ if ($] >= 5.006) {
+ $source = $source % (0xFFFFFFFF + 1) if $source > 0xFFFFFFFF;
+ return $source;
+ }
+ while ($source > 0xFFFFFFFF) {
+ $source -= 0xFFFFFFFF + 1;
+ }
+ return $source;
+}
+
+
+1;
+__END__
+
+=head1 NAME
+
+Net::MySQL - Pure Perl MySQL network protocol interface.
+
+=head1 SYNOPSIS
+
+ use Net::MySQL;
+
+ my $mysql = Net::MySQL->new(
+ # hostname => 'mysql.example.jp', # Default use UNIX socket
+ database => 'your_database_name',
+ user => 'user',
+ password => 'password'
+ );
+
+ # INSERT example
+ $mysql->query(q{
+ INSERT INTO tablename (first, next) VALUES ('Hello', 'World')
+ });
+ printf "Affected row: %d\n", $mysql->get_affected_rows_length;
+
+ # SLECT example
+ $mysql->query(q{SELECT * FROM tablename});
+ my $record_set = $mysql->create_record_iterator;
+ while (my $record = $record_set->each) {
+ printf "First column: %s Next column: %s\n",
+ $record->[0], $record->[1];
+ }
+ $mysql->close;
+
+=head1 DESCRIPTION
+
+Net::MySQL is a Pure Perl client interface for the MySQL database. This module implements network protocol between server and client of MySQL, thus you don't need external MySQL client library like libmysqlclient for this module to work. It means this module enables you to connect to MySQL server from some operation systems which MySQL is not ported. How nifty!
+
+Since this module's final goal is to completely replace DBD::mysql, API is made similar to that of DBI.
+
+From perl you activate the interface with the statement
+
+ use Net::MySQL;
+
+After that you can connect to multiple MySQL daemon and send multiple queries to any of them via a simple object oriented interface.
+
+There are two classes which have public APIs: Net::MySQL and Net::MySQL::RecordIterator.
+
+ $mysql = Net::MySQL->new(
+ hostname => $host,
+ database => $database,
+ user => $user,
+ password => $password,
+ );
+
+Once you have connected to a daemon, you can can execute SQL with:
+
+ $mysql->query(q{
+ INSERT INTO foo (id, message) VALUES (1, 'Hello World')
+ });
+
+If you want to retrieve results, you need to create a so-called statement handle with:
+
+ $mysql->query(q{
+ SELECT id, message FROM foo
+ });
+ if ($mysql->has_selected_record) {
+ my $a_record_iterator = $mysql->create_record_iterator;
+ # ...
+ }
+
+This Net::MySQL::RecordIterator object can be used for multiple purposes. First of all you can retreive a row of data:
+
+ my $record = $a_record_iterator->each;
+
+The each() method takes out the reference result of one line at a time, and the return value is ARRAY reference.
+
+=head2 Net::MySQL API
+
+=over 4
+
+=item new(HASH)
+
+ use Net::MySQL;
+ use strict;
+
+ my $mysql = Net::MySQL->new(
+ unixsocket => $path_to_socket,
+ hostname => $host,
+ database => $database,
+ user => $user,
+ password => $password,
+ );
+
+The constructor of Net::MySQL. Connection with MySQL daemon is established and the object is returned. Argument hash contains following parameters:
+
+=over 8
+
+=item unixsocket
+
+Path of the UNIX socket where MySQL daemon. default is F</tmp/mysql.sock>.
+Supposing I<hostname> is omitted, it will connect by I<UNIX Socket>.
+
+=item hostname
+
+Name of the host where MySQL daemon runs.
+Supposing I<hostname> is specified, it will connect by I<INET Socket>.
+
+=item port
+
+Port where MySQL daemon listens to. default is 3306.
+
+=item database
+
+Name of the database to connect.
+
+=item user / password
+
+Username and password for database authentication.
+
+=item timeout
+
+The waiting time which carries out a timeout when connection is overdue is specified.
+
+=item debug
+
+The exchanged packet will be outputted if a true value is given.
+
+=back
+
+
+=item create_database(DB_NAME)
+
+A create_DATABASE() method creates a database by the specified name.
+
+ $mysql->create_database('example_db');
+ die $mysql->get_error_message if $mysql->is_error;
+
+=item drop_database(DB_NAME)
+
+A drop_database() method deletes the database of the specified name.
+
+ $mysql->drop_database('example_db');
+ die $mysql->get_error_message if $mysql->is_error;
+
+=item query(SQL_STRING)
+
+A query() method transmits the specified SQL string to MySQL database, and obtains the response.
+
+=item create_record_iterator()
+
+When SELECT type SQL is specified, Net::MySQL::RecordIterator object which shows the reference result is returned.
+
+ $mysql->query(q{SELECT * FROM table});
+ my $a_record_iterator = $mysql->create_recrod_iterator();
+
+Net::MySQL::RecordIterator object is applicable to acquisition of a reference result. See L<"/Net::SQL::RecordIterator API"> for more.
+
+=item get_affected_rows_length()
+
+returns the number of records finally influenced by specified SQL.
+
+ my $affected_rows = $mysql->get_affected_rows_length;
+
+=item get_insert_id()
+
+MySQL has the ability to choose unique key values automatically. If this happened, the new ID will be stored in this attribute.
+
+=item is_error()
+
+TRUE will be returned if the error has occurred.
+
+=item has_selected_record()
+
+TRUE will be returned if it has a reference result by SELECT.
+
+=item get_field_length()
+
+return the number of column.
+
+=item get_field_names()
+
+return column names by ARRAY.
+
+=item close()
+
+transmits an end message to MySQL daemon, and closes a socket.
+
+=back
+
+=head2 Net::MySQL::RecordIterator API
+
+Net::MySQL::RecordIterator object is generated by the query() method of Net::MySQL object. Thus it has no public constructor method.
+
+=over 4
+
+=item each()
+
+each() method takes out only one line from a result, and returns it as an ARRAY reference. C<undef> is returned when all the lines has been taken out.
+
+ while (my $record = $a_record_iterator->each) {
+ printf "Column 1: %s Column 2: %s Collumn 3: %s\n",
+ $record->[0], $record->[1], $record->[2];
+ }
+
+=back
+
+=head1 SUPPORT OPERATING SYSTEM
+
+This module has been tested on these OSes.
+
+=over 4
+
+=item * MacOS 9.x
+
+with MacPerl5.6.1r.
+
+=item * MacOS X
+
+with perl5.6.0 build for darwin.
+
+=item * Windows2000
+
+with ActivePerl5.6.1 build631.
+
+=item * FreeBSD 3.4 and 4.x
+
+with perl5.6.1 build for i386-freebsd.
+
+with perl5.005_03 build for i386-freebsd.
+
+=item * Linux
+
+with perl 5.005_03 built for ppc-linux.
+
+with perl 5.6.0 bult for i386-linux.
+
+=item * Solaris 2.6 (SPARC)
+
+with perl 5.6.1 built for sun4-solaris.
+
+with perl 5.004_04 built for sun4-solaris.
+
+Can use on Solaris2.6 with perl5.004_04, although I<make test> is failure.
+
+=back
+
+This list is the environment which I can use by the test usually. Net::MySQL will operate also in much environment which is not in a list.
+
+I believe this module can work with whatever perls which has B<IO::Socket>. I'll be glad if you give me a report of successful installation of this module on I<rare> OSes.
+
+=head1 SEE ALSO
+
+L<libmysql>, L<IO::Socket>
+
+=head1 AUTHOR
+
+Hiroyuki OYAMA E<lt>oyama@module.jpE<gt>
+
+=head1 COPYRIGHT AND LICENCE
+
+Copyright (C) 2002 Hiroyuki OYAMA. Japan. All rights reserved.
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
--- a/graphicstest/uibench/scripts/resultsmunger.py Mon May 03 13:44:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-# 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:
-# # Scans the working directory for files and processes them
-# # assuming they are the output from the te_uibench component
-# # Outputs a results.csv file that contains:-
-# # filename, testid1, result1, testid2, result2 etc
-#
-#
-
-import os
-import dircache
-import re
-
-out_file = open("results.csv","w")
-
-files=dircache.listdir(os.getcwd())
-
-bitbltfinder = re.compile('.* ((.?)BitBlt(.?)) o: (.*), (.+)bit->(.*) mode - for (.*) bitmaps, per bitmap=(.*) .*')
-bitmapcreatefinder = re.compile('.* Bitmap->Create - for (.*) bitmaps, per bitmap=(.*) .*')
-bitmapdupfinder = re.compile('.* Bitmap->Duplicate - for (.*) bitmaps, per bitmap (.*) .*')
-fontdupfinder = re.compile('.* Font->Duplicate - for (.*) fonts, per font (.*) .*')
-solidcolourfinder = re.compile('.* (Rect->Fill) o: (.*), (.*) mode - colour: (.*) - per fill (.*) .*')
-
-count = 0
-while count < len(files):
- print 'files[',count,']=',files[count]
-
- if files[count] != "results.csv":
-
- out_file.write(files[count]+", ")
-
- in_file = open(files[count],"r")
- text = " "
- while text!="":
- text = in_file.readline()
-
- bcresult = bitmapcreatefinder.match(text)
- if bcresult:
- print "BitmapCreate "+bcresult.group(2)
- out_file.write("BitmapCreate, ")
- out_file.write(bcresult.group(2)+", ")
-
- bdresult = bitmapdupfinder.match(text)
- if bdresult:
- print "BitmapDuplicate "+bdresult.group(2)
- out_file.write("BitmapDuplicate, ")
- out_file.write(bdresult.group(2)+", ")
-
- fdresult = fontdupfinder.match(text)
- if fdresult:
- print "FontDuplicate "+fdresult.group(2)
- out_file.write("FontDuplicate, ")
- out_file.write(fdresult.group(2)+", ")
-
- scresult = solidcolourfinder.match(text)
- if scresult:
- test = scresult.group(1)+"-"+scresult.group(2)+"o-"+scresult.group(3)+"m"+scresult.group(4)+"c"
- print "Solid Colour "+scresult.group(5)
- out_file.write(test+", ")
- out_file.write(scresult.group(5)+", ")
-
- result = bitbltfinder.match(text)
- if result:
- test = result.group(1)+"-"+result.group(4)+"o-"+result.group(5)+"bit-"+result.group(6)+"m"
- print test
- print result.group(8)
- out_file.write(test+", ")
- out_file.write(result.group(8)+", ")
- in_file.close()
- out_file.write("\n")
-
- count = count + 1
-
-out_file.close()
\ No newline at end of file
--- a/graphicstest/uibench/scripts/ui_benchresults.pl Mon May 03 13:44:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-# 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:
-# This script extracts the data from a uibench.htm file
-#
-#
-
-my $htm=$ARGV[0];
-print "Parsing $htm, time, unit, rot, src, dst\n";
-my $testdata = process_test_log2($htm,'st_perf_');
-foreach my $result (@$testdata) {
- next if defined $testname and $result->{'testname'} ne $testname;
- if ($ARGV[1] eq '--notestname') {
- print "$result->{'dura'}\n";
- } elsif ($ARGV[1] eq '-tab') {
- print "$result->{'testname'} $result->{'dura'} $result->{'unit'} $result->{'rota'} $result->{'smode'} $result->{'dmode'}\n";
- } else {
- print "$result->{'testname'},$result->{'dura'},$result->{'unit'},$result->{'rota'},$result->{'smode'},$result->{'dmode'}\n";
- }
-}
-exit;
-
-sub process_test_log2 {
- my ($file,$prefix) = @_;
- print "Processing $file\n" if $DEBUG;
- open(LOG,$file) or die "Error opening $file\n$!\n";
-
- my $result = [];
- my ($name,$start,$end);
-
- while (my $line = <LOG>) {
-
- if ($line =~ /[0-9:]{12}\s+.+?\s+TID:\s*/) {
- ($prt1,$prt2)=split(/\s+TID:\s+/,$line);
- ($tname,$prt3)=split(/\s+Rot:\s+/,$prt2);
- ($rotation,$x1,$srcMode,$x2,$dstMode,$x3,$iters,$x5,$duration, $unit)=split(/\s+/,$prt3);
- push @$result, {'testname' => $tname, 'dura' => $duration, 'rota' => $rotation, 'smode' => $srcMode, 'dmode' => $dstMode, 'unit' => $unit};
- }
- }
- return $result;
-}
-
--- a/graphicstest/uibench/scripts/uibench2db.pl Mon May 03 13:44:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,447 +0,0 @@
-#!perl
-# 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:
-# # Script: uibench2db.pl
-# # Function: This script takes the performance log files created by
-# # the graphics uibench apps performace test and outputs data to the
-# # SymSym database
-# # call: uibench2db.pl --dir="\\loncoredev02.intra\graphics\9.2" --writedb --writecsv
-# # Design: This script looks at all the files under --dir
-# # seeking first build.html files then specific test reset logs.
-# # The test result contents are then extracted.
-# # Results for this build already in the database are deleted.
-# # The new results are added to the database.
-# # The raw results are available at
-# # http://smglinx.intra/SymSym/query/dbquery.pl?dbfilter=team+%3D+%27uibench%27&viewdata=other&dbview=table&dbschema=performance&p_reset=1&dbtable=performance_uibench_tests&Submit=%3E
-# # The results are graphed at
-# # http://smglinx.intra/twiki/bin/view/Perfresult/TestReportUibench
-# # uibench Location of script //EPOC/DV3/task/2005/November/UI-Perf/master-mnt/graphics/ui_bench/scripts/uibench2db.pl
-# # uibench contact David Kren
-# # SMG Location of script //EPOC/development/sag/performance/scripts/uibench2db.pl
-# # The SMG contact for the above is Patrick Diamond ext 1316
-# # Instructions for adding new performance testcase results
-# # 1) If the result is in a new file then add its name to
-# # the global variable @testfiles_tef
-# # 2) amend the function process_build_tef_file to extract the performance data
-# # 3) run this script with the parms --dir & --writecsv but without --writedb
-# # check the contents of the csv file
-# # 4) To switch on debugging run on the cmd line "set DEBUG=2"
-# # If stuck after trying the above contact Patrick Diamond ext 1316
-# # -- SQL Definitation
-# # CREATE TABLE performance.performance_uibench_tests (
-# # team text,
-# # platform text,
-# # build text,
-# # testdate timestamp,
-# # testname text,
-# # resulttype text,
-# # result real);
-# # GRANT INSERT,DELETE,SELECT ON TABLE performance.performance_uibench_tests to performance_uibench;
-# # GRANT SELECT ON TABLE performance.performance_uibench_tests to public;
-# # GRANT USAGE ON SCHEMA performance to performance_uibench;
-# # CREATE INDEX performance_uibench_tests_platform ON performance.performance_uibench_tests(platform);
-# # CREATE INDEX performance_uibench_tests_testname ON performance.performance_uibench_tests(testname text_pattern_ops);
-# # COMMENT ON TABLE performance.performance_uibench_tests is 'Overnight performance test results for Graphics team, uibench results';
-# ovgbenchmark.htm TESTEXECUTEfbstest_T_Performance.script.htm TESTEXECUTEscdvtest_t_performance.script.htm
-#
-#
-
-use Getopt::Long;
-use File::Basename;
-use File::Find;
-use strict;
-use warnings;
-
-my ($file,$help,$platform,$days,$writedb,$writecsv);
-$days=2;
-
-my @testfiles_tef = ('TESTEXECUTEte_uibench.Script.htm');
-my @testfiles_rtest ;
-
-GetOptions ('dir=s' => \$file,
- 'platform|p=s' => \$platform,
- 'days|d=s' => \$days,
- 'writecsv' => \$writecsv,
- 'writedb' => \$writedb,
- 'help|h|?' =>\$help) || usage();
-
-usage(0) if $help;
-usage(1,'dir') if not defined $file;
-usage(1,'days') if not defined $days or $days !~ /^[0-9]+$/;
-$file =~ s/\\/\//g; # swap all \ for / in file/dir name
-my $DEBUG=0;
-$DEBUG=$ENV{DEBUG} if exists $ENV{DEBUG};
-
-my @files;
-
-# if the path points to a file then use that
-if ( -f $file ) {
- push @files,$file;
-} else {
- # use the path as a dir path and search for build.html files
- print "Searching for build.html files\n" if $DEBUG;
- $file .= '/'; # ensure dir path ends in /
- $file =~ s/\/\/$/\//g; # ensure dir path doesn't end in //
- foreach my $f ("${file}build.html" , glob($file . '*/build.html')) {
- next if not defined $f;
- next if not -f $f;
- next if -M $f > $days;
- push @files,$f;
- }
-}
-
-
-# check that this machine has the perl drivers necessary to contact the database
-check_db_drivers();
-
-# DB connect
-my $dbh;
-$dbh = connect_to_db() if defined $writedb;
-
-# Now extract test data from each build and call script to place data in database
-foreach my $f (@files) {
- my $testdata = process_test_build($f);
-
- my $team='uibench';
- my $build = $testdata->{'build'};
- my $date = $testdata->{'date'};
- my $platform = $testdata->{'platform'};
-
- $dbh->begin_work if defined $writedb;
- remove_duplicates ($dbh,$team,$build,$platform,$date) if defined $writedb;
- my $csv;
- open($csv,'>',dirname($f) . "/performance.csv") or die $! if defined $writecsv;
-
- # loop over each result and output it to db and csv
- foreach my $result (@{$testdata->{'results'}}) {
- next if not defined $result;
- next if not defined $result->{'value'} or $result->{'value'} eq '';
-
- process_sql($dbh,$team,$platform,$build,$date,$result->{'testname'},$result->{'type'},$result->{'value'}) if defined $writedb;
- print $csv "$team,$platform,$build,$date,\"$result->{'testname'}\",\"$result->{'type'}\",$result->{'value'}\n" if defined $writecsv;
-
- print "." if not $DEBUG;
- }
-
- $dbh->commit or die ("DB error : $dbh->errorstr") if defined $writedb;
- close($csv) if defined $writecsv;
-
- print "\n" if not $DEBUG;
-}
-
-#########################
-# Define subroutines
-
-# print out a usage message for this script and exit
-sub usage {
- my ($r,$p) = @_;
- $r = 0 if not defined $r;
-
- print "uibench2db.pl \n";
- print "Error: Parameter \"--$p\" missing\n" if defined $p;
-
- print " --dir=<location of the build.html file with the test results>\n";
- print " --days=<filter on number of days since data(zip) file was modified>\n";
- print " --help : this text\n";
- exit $r;
-}
-
-# Find and process each performance test case log
-sub process_test_build {
- my ($file) = @_;
- print "Function process_test_build: $file\n" if $DEBUG;
-
- my $testdata = {'date' => undef,'platform' => undef, 'build' => undef, 'results' => []};
- my $dir = dirname($file);
-
- # find date,platform and build values for this set of test results
- process_build_log($testdata,$file);
-
- # find and process rtest logs
- foreach my $f (@testfiles_rtest) {
- print "\tLooking for $f\n" if $DEBUG > 1;
- my ($logfile) = glob("$dir/*/$f");
- process_build_rtest_file($testdata,$logfile) if defined $logfile;
- }
-
- # find and process TEF logs
- foreach my $f (@testfiles_tef) {
- print "\tLooking for $f\n" if $DEBUG > 1;
- my ($logfile) = glob("$dir/*/$f");
- process_build_tef_file($testdata,$logfile) if defined $logfile;
- }
-
- return $testdata;
-}
-
-# Extract the platform and date from the build.html file
-sub process_build_log {
- my ($test,$build_log) = @_;
-
- open (FH, "<", $build_log) or die "Error opening $file\n$!\n";
- my @lines = <FH>;
- close(FH);
-
- # extract the build date and platform
- my ($date_line) = grep {/Build report for build /} @lines;
- my ($year,$month,$day,$hour,$minute,$platform) =
- ($date_line =~ /([0-9]{4})_([0-9][0-9])_([0-9][0-9])_([0-9][0-9])([0-9][0-9])_(.*?)\</);
- $test->{'date'} = "$year-$month-$day $hour:$minute";
-
- # determine the platform name
- my @tags = split /_/,lc($platform);
- $test->{'platform'} = "$tags[1] $tags[0] $tags[2]";
-
- # extract the name of the build
- my ($build_line) = grep {/Full OS Build Used:/} @lines;
- my ($build) = ($build_line =~ /Used:\s*(.*?)\.*\</);
- $test->{'build'} = $build;
-}
-
-
-# Extract the platform and date from the build.summary file
-sub process_build_rtest_file {
- my ($testdata,$file) = @_;
-
- print "Function process_build_rtest_file : $file\n" if $DEBUG;
- my $data = read_file($file);
- 1 while $data =~ s/\<.*?\>//g; # strip all html tags
-
- my ($txt,$state) = ('','');
- foreach my $line (split /\n/,$data) {
- chomp($line);
- $line =~ s/[[:cntrl:]]//g; # strip ctl chars
- if ($line =~ /^RTEST TITLE:\s*([a-z]+.*?)\s*$/i) {
- # start of new test case
- $state = $1;
- $state =~ s/\s*[0-9\.\(\)]+$//; # strip numeric suffix
- $txt = '';
- } elsif ($state ne '' and $line =~ /^RTEST: SUCCESS\s*:/i) {
- # end of test case
- $txt .= "$line\n";
- process_build_rtest_text($txt, $testdata->{'results'},$file,$state);
- $txt = '';
- $state = '';
- } elsif ($state eq '' and $line =~ /^\s*RTEST:\s+Level\s+[0-9]+\s+Next\s+test\s+.\s+(.*?)\s*$/i) {
- # start of new test case where the title hasn't been used
- # e.g. RTEST: Level 001 Next test - Defect tests
- $state = $1;
- $txt = '';
- }
- $txt .= "$line\n" if $state ne '';
- }
-}
-
-# Extract test performance data frome each TEF file
-sub process_build_tef_file {
- my ($testdata,$file) = @_;
-
- print "Function process_build_tef_file : $file\n" if $DEBUG;
- my $result = $testdata->{'results'};
- my $data = read_file($file);
- 1 while $data =~ s/\<.*?\>//g; # strip all html tags
-
-
- my ($txt,$state) = ('','');
- foreach my $line (split /\n/,$data) {
- chomp($line);
- $line =~ s/[[:cntrl:]]/ /g; # strip ctl chars
- $txt .= $line;
- $txt .= "\n";
- }
-
- # process results from TESTEXECUTEte_uibench.script.htm
- if ($file =~ /TESTEXECUTEte_uibench.Script.htm/i) {
-
- my %tests;
-
- # Format 1 : Result displayed in microseconds - Max and Min available
- while ($txt =~ /TID:\s+([^\s]+?)\s+Rot:\s+([0-9]+)\s+SrcMode:\s+([0-9]+)\s+DestMode:\s+([0-9]+)\s+Iters:\s+([0-9]+)\s+TrimmedMean:\s+([0-9]+)\s+us.*?\s+Max:\s+([0-9]+)\s+Min:\s+([0-9]+)\s+/gms) {
- my ($testname,$rot,$srcmode,$destmode,$iters,$microseconds,$max,$min) = ($1,$2,$3,$4,$5,$6,$7,$8);
- next if not defined $max or not defined $min;
- $testname = sprintf('%s,Rot:%1d,SrcMode:%2d,DestMode:%2d',$testname,$rot,$srcmode,$destmode);
- $tests{$testname} = 1; # record the fact that this test has been processed
- push @$result, {'testname' => "$testname,Mean", 'value' => $microseconds, 'type' => 'microseconds'};
- #push @$result, {'testname' => "$testname,Max", 'value' => $max, 'type' => 'microseconds'};
- #push @$result, {'testname' => "$testname,Min", 'value' => $min, 'type' => 'microseconds'};
- print "\t$testname:Mean\t$microseconds\t$microseconds\n" if $DEBUG > 1;
- print "\t$testname:Max\t$max\t$max\n" if $DEBUG > 1;
- print "\t$testname:Min\t$min\t$min\n" if $DEBUG > 1;
- }
-
- # Format 2 : Result displayed in microseconds - Max and Min not available
- while ($txt =~ /TID:\s+(.*?)\s+Rot:\s+([0-9]+)\s+SrcMode:\s+([0-9]+)\s+DestMode:\s+([0-9]+)\s+Iters:\s+([0-9]+)\s+TrimmedMean:\s+([0-9]+)\s+us/g) {
- my ($testname,$rot,$srcmode,$destmode,$iters,$microseconds) = ($1,$2,$3,$4,$5,$6);
- $testname = sprintf('%s,Rot:%1d,SrcMode:%2d,DestMode:%2d',$testname,$rot,$srcmode,$destmode);
- next if exists $tests{$testname} ;# do not process this test again
- push @$result, {'testname' => "$testname,Mean", 'value' => $microseconds, 'type' => 'microseconds'};
- print "\t$testname:Mean\t$microseconds\t$microseconds\n" if $DEBUG > 1;
- }
-
- # Format 3 : Result displayed in pixels/second - Max and Min available
- while ($txt =~ /TID:\s+([^\s]+?)\s+Rot:\s+([0-9]+)\s+SrcMode:\s+([0-9]+)\s+DestMode:\s+([0-9]+)\s+Iters:\s+([0-9]+)\s+TrimmedMean:\s+([0-9]+)\s+pixels\/second.*?\s+Max:\s+([0-9]+)\s+Min:\s+([0-9]+)\s+/gms) {
- my ($testname,$rot,$srcmode,$destmode,$iters,$pps,$max,$min) = ($1,$2,$3,$4,$5,$6,$7,$8);
- next if not defined $max or not defined $min;
- $testname = sprintf('%s,Rot:%1d,SrcMode:%2d,DestMode:%2d',$testname,$rot,$srcmode,$destmode);
- $tests{$testname} = 1; # record the fact that this test has been processed
- push @$result, {'testname' => "$testname,Mean", 'value' => $pps, 'type' => 'pixels/second'};
- #push @$result, {'testname' => "$testname,Max", 'value' => $max, 'type' => 'microseconds'};
- #push @$result, {'testname' => "$testname,Min", 'value' => $min, 'type' => 'microseconds'};
- print "\t$testname:Mean\t$pps\t$pps\n" if $DEBUG > 1;
- print "\t$testname:Max\t$max\t$max\n" if $DEBUG > 1;
- print "\t$testname:Min\t$min\t$min\n" if $DEBUG > 1;
- }
-
- # Format 4 : Result displayed in pixels/second - Max and Min not available
- while ($txt =~ /TID:\s+(.*?)\s+Rot:\s+([0-9]+)\s+SrcMode:\s+([0-9]+)\s+DestMode:\s+([0-9]+)\s+Iters:\s+([0-9]+)\s+TrimmedMean:\s+([0-9]+)\s+pixels\/second/g) {
- my ($testname,$rot,$srcmode,$destmode,$iters,$pps) = ($1,$2,$3,$4,$5,$6);
- $testname = sprintf('%s,Rot:%1d,SrcMode:%2d,DestMode:%2d',$testname,$rot,$srcmode,$destmode);
- next if exists $tests{$testname} ;# do not process this test again
- push @$result, {'testname' => "$testname,Mean", 'value' => $pps, 'type' => 'pixels/second'};
- print "\t$testname:Mean\t$pps\t$pps\n" if $DEBUG > 1;
- }
-
- # Format 5 : Result displayed in characters/second - Max and Min available
- while ($txt =~ /TID:\s+([^\s]+?)\s+Rot:\s+([0-9]+)\s+SrcMode:\s+([0-9]+)\s+DestMode:\s+([0-9]+)\s+Iters:\s+([0-9]+)\s+TrimmedMean:\s+([0-9]+)\s+characters\/second.*?\s+Max:\s+([0-9]+)\s+Min:\s+([0-9]+)\s+/gms) {
- my ($testname,$rot,$srcmode,$destmode,$iters,$cps,$max,$min) = ($1,$2,$3,$4,$5,$6,$7,$8);
- next if not defined $max or not defined $min;
- $testname = sprintf('%s,Rot:%1d,SrcMode:%2d,DestMode:%2d',$testname,$rot,$srcmode,$destmode);
- $tests{$testname} = 1; # record the fact that this test has been processed
- push @$result, {'testname' => "$testname,Mean", 'value' => $cps, 'type' => 'characters/second'};
- #push @$result, {'testname' => "$testname,Max", 'value' => $max, 'type' => 'microseconds'};
- #push @$result, {'testname' => "$testname,Min", 'value' => $min, 'type' => 'microseconds'};
- print "\t$testname:Mean\t$cps\t$cps\n" if $DEBUG > 1;
- print "\t$testname:Max\t$max\t$max\n" if $DEBUG > 1;
- print "\t$testname:Min\t$min\t$min\n" if $DEBUG > 1;
- }
-
- # Format 6 : Result displayed in characters/second - Max and Min not available
- while ($txt =~ /TID:\s+(.*?)\s+Rot:\s+([0-9]+)\s+SrcMode:\s+([0-9]+)\s+DestMode:\s+([0-9]+)\s+Iters:\s+([0-9]+)\s+TrimmedMean:\s+([0-9]+)\s+characters\/second/g) {
- my ($testname,$rot,$srcmode,$destmode,$iters,$cps) = ($1,$2,$3,$4,$5,$6);
- $testname = sprintf('%s,Rot:%1d,SrcMode:%2d,DestMode:%2d',$testname,$rot,$srcmode,$destmode);
- next if exists $tests{$testname} ;# do not process this test again
- push @$result, {'testname' => "$testname,Mean", 'value' => $cps, 'type' => 'characters/second'};
- print "\t$testname:Mean\t$cps\t$cps\n" if $DEBUG > 1;
- }
- }
-}
-
-
-# process the text associated with 1 testcase and extract performace results
-sub process_build_rtest_text {
- my ($txt, $result, $logfile, $testname) = @_;
- print "Function process_build_rtest_text: $logfile, $testname\n" if $DEBUG > 1;
-
- next if not defined $testname or $testname =~ /^\s*$/;
- $testname =~ s/[-]/:/g; # replace - with : as subtitle seperator
- $testname =~ s/\s*performance test\s*$//; # strip unnecessary suffix to test name
- print "$testname \n" if $DEBUG > 1;
-
- if ($testname eq 'T_BENCH') {
- while ($txt =~ /^\s*(.*?):\s*(.*?)\s+ms$/gim) {
- my ($subname,$num) = ($1,$2);
- push @$result, {'testname' => "$testname:$subname", 'value' => $num, 'type' => 'milliseconds'};
- print "\t$testname:$subname\t$num\tmilliseconds\n" if $DEBUG > 1;
- }
-
- }
- return $result;
-}
-
-# return a connection to the databasse
-sub connect_to_db {
- print "Connecting to DB\n" if $DEBUG;
- my $dbh = DBI->connect('DBI:PgPP:dbname=metadata;host=smglinx.symbian.intra', 'performance_uibench', 'grui');
- print "Connected to DB\n" if $DEBUG;
- return $dbh;
-}
-
-# save the result to the database
-sub process_sql {
- my ($dbh,$team,$platform,$build,$testdate,$testname,$resulttype,$result) = @_;
-
- print "Processing $testname result\n" if $DEBUG > 1;
- if ($DEBUG > 1) {
- shift;
- print 'Saving ' . join(',',@_) . "\n";
- }
- my $sth = $dbh->prepare("INSERT INTO performance.performance_uibench_tests (team,platform,build,testdate,testname,resulttype,result) VALUES(?,?,?,?,?,?,?)") or die "Prepare Error $dbh->errorstr";
-
- $sth->execute($team,
- $platform,
- $build,
- $testdate,
- $testname,
- $resulttype,
- $result)
- or die ("Error inserting values $team,$platform,$build,$testdate,$testname,$resulttype,$result\n $dbh->errorstr");
-
- print "Saved result\n" if $DEBUG > 1;
-}
-
-# read in and return the contents of a file
-sub read_file {
- my ($file) = @_;
-
- open (FH,"<",$file) or die "Error reading from $file\n$!\n";
- my $file_size = (stat ($file))[7]; # Size of file
- my $data;
- read(FH, $data, $file_size);
- close(FH);
-
- return $data;
-}
-
-# before saving to the database delete any duplicate data
-sub remove_duplicates {
- my ($dbh,$team,$build,$platform,$date) = @_;
-
- my $sth = $dbh->prepare("delete from performance.performance_uibench_tests where team = ? and build = ? and platform = ? and testdate = ?") or die "Prepare Error $dbh->errorstr";
-
- $sth->execute($team, $build, $platform, $date)
- or die ("Error deleteing values $team,$build\n $dbh->errorstr");
-
-}
-
-
-# ensure that the modules necessary to drive the database interactions are available and loaded
-sub check_db_drivers {
-
- print "Checking for DBI module\n" if $DEBUG;
- eval{require DBI};
- if($@) {
- print "Failed to load DBI\n Now attempting to download and install\nppm install DBI\n";
- system("ppm","install","DBI");
- require DBI;
- }
-
- print "Checking for DBD::PgPP database driver module\n" if $DEBUG;
- eval{require DBD::PgPP};
- if($@) {
- print "Failed to load DBD::PgPP\n Now attempting to download and install\nppm install DBD-PgPP\n";
- system("ppm","install","DBD-PgPP");
- require DBD::PgPP;
- }
-}
-
-sub find_performance_files {
- if ($File::Find::name
- =~ /\/t_performance.txt/i) {
- my $afile = lc($File::Find::name);
- $afile =~ s/\\/\//g;
- push @files, lc($afile);
- print "Found $afile\n" if $DEBUG;
- print "+" if not $DEBUG;
- }
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graphicstest/uibench/scripts/uploadsqlfromtestrun.pl Fri May 14 17:10:13 2010 +0300
@@ -0,0 +1,178 @@
+#!perl
+# Copyright (c) 2010 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:
+# Script to upload performance or other data embedded as SQL statements
+# in test execute output logs.
+#
+# This script keys off "SQL_UPLOAD_VERSION_0:" and "SQL_SESSION_ID=" tags for
+# data extraction.
+
+use Getopt::Long;
+use File::Basename;
+use File::Find;
+use Cwd;
+
+# The default perl install does not provide the mysql database driver, needed
+# to connect to a MySQL database. For convenience we deliver a pure perl
+# implementation locally. This application can use such GPL modules under the
+# System Library exception of GPL. If this script needs to be called from
+# another directory, then the 'use lib ".";' directive won't work. To resolve
+# this problem, run the script "perl installmysqlperlmodule.pl" first.
+
+
+use lib ".";
+
+use MySQL;
+
+use strict;
+use warnings;
+
+our ($searchRoot, $helpOnUsage, $jobId);
+our @globalFileList;
+our @globalSessionTransaction;
+our @bulkSqlTransaction;
+
+sub Usage
+ {
+ my ($aRequireParameter,$aMissingParameter) = @_;
+ $aRequireParameter = 0 if not defined $aRequireParameter;
+
+ print <<END_OF_USAGE_TEXT;
+Usage: perl uploadsqlfromtestrun.pl --dir=searchRootDir --job=jobID [--help]
+
+Note this script requires the Net::MySQL package to either be installed or
+to be supplied in the search path. An example such commandline is:
+
+ Q:\\>perl -IQ:\\epoc32\\release\\winscw\\udeb\\z\\uibench
+ \\epoc32\\release\\winscw\\udeb\\z\\uibench\\uploadsqlfromtestrun.pl
+ --dir=\\epoc32\\winscw\\c\\logs\\testexecute
+ --job=655433
+
+This script recurses through searchRootDir looking for htm files containing
+<prefix>SQL_UPLOAD_VERSION_0:<sql commands>
+upon which it invokes those <sql commands>
+
+It also looks for
+<prefix>SQL_SESSION_ID=<session value>
+upon which it associates the supplied integer jobID with the <session value>
+in the database. In the database these identifiers are unsigned integers:
+jobid int(10) unsigned
+sessionid bigint(20) unsigned
+
+The jobID would normally come from the overnight build system. Low numbered
+jobIDs, i.e. those <10000, would not collide with the build system and so can
+be used when running this script interactively outside the context of a build
+system.
+
+The help option (--help, -h or -?) prints this message
+
+END_OF_USAGE_TEXT
+
+ if (defined $aMissingParameter)
+ {
+ print "Error: Parameter \"--$aMissingParameter\" missing\n"
+ }
+ exit $aRequireParameter;
+ }
+
+sub RemoveBackSlashes
+ {
+ my ($aPath) = @_;
+ $aPath =~ s/\\/\//g;
+ return $aPath;
+ }
+
+sub AddToGlobalFileList
+ {
+ my $aFile = $_;
+
+ if (-f $aFile && $aFile =~ /.*.htm$/i)
+ {
+ push @main::globalFileList, $File::Find::name;
+ }
+ }
+
+sub ParseFiles()
+ {
+ foreach my $file (@main::globalFileList)
+ {
+ open (FILE, "$file");
+ foreach my $line (<FILE>)
+ {
+ if ($line =~ /.*SQL_UPLOAD_VERSION_0:*/i)
+ {
+ $line =~ s/.*SQL_UPLOAD_VERSION_0://g;
+ push @main::bulkSqlTransaction, $line;
+ }
+ if ($line =~ /.*SQL_SESSION_ID=/i)
+ {
+ $line =~ s/.*SQL_SESSION_ID=//g;
+ chomp $line;
+ $line = "INSERT INTO performance.jobsessionmap (jobid, sessionid) VALUES ('"
+ . $main::jobId . "', '"
+ . $line . "');\n"
+ ;
+ push @main::globalSessionTransaction, $line;
+ }
+ }
+ close FILE;
+ }
+ }
+
+sub connectToSqlDatabase
+ {
+ return
+ Net::MySQL->new(
+ hostname => '4GBD02346',
+ database => 'performance',
+ user => 'uibench',
+ password => 'grui'
+ );
+ }
+
+sub UploadSqlData()
+ {
+ my $dbHandle;
+ $dbHandle = connectToSqlDatabase();
+ $dbHandle->query(@bulkSqlTransaction);
+ die if ($dbHandle->is_error);
+ $dbHandle->close;
+
+ # We are re-creating the connection to the database because this forces
+ # the underlying client-server transaction to flush its socket. There
+ # is no flush API that the MySQL perl module gives us. If we don't do
+ # this, the transaction completes without errors, but does not actually
+ # put the session rows into the database!
+ $dbHandle = connectToSqlDatabase();
+ $dbHandle->query(@globalSessionTransaction);
+ $dbHandle->close;
+ }
+
+GetOptions ('dir=s' => \$searchRoot,
+ 'job=s' => \$jobId,
+ 'help|h|?' =>\$helpOnUsage) || Usage();
+
+Usage(0) if $helpOnUsage;
+Usage(1,'dir') if not defined $searchRoot;
+Usage(1,'job') if not defined $jobId;
+
+$searchRoot = RemoveBackSlashes($searchRoot);
+
+@globalFileList = ();
+find(\&AddToGlobalFileList, ($searchRoot));
+
+@bulkSqlTransaction = ();
+@globalSessionTransaction = ();
+ParseFiles();
+UploadSqlData();
--- a/m3g/m3gcore11/src/m3g_math.c Mon May 03 13:44:32 2010 +0300
+++ b/m3g/m3gcore11/src/m3g_math.c Fri May 14 17:10:13 2010 +0300
@@ -1842,7 +1842,7 @@
*/
#if defined(M3G_HW_FLOAT_VFPV2)
-M3G_API __asm void m3gLerp(M3Gint size,
+__weak __asm void m3gLerp(M3Gint size,
M3Gfloat *vec,
M3Gfloat s,
const M3Gfloat *start, const M3Gfloat *end)
@@ -1853,6 +1853,7 @@
// r3 = *start
// sp[0] = *end
+ EXPORT m3gLerp[DYNAMIC]
CODE32
/*
M3Gfloat sCompl = 1.0 - s;
--- a/printingservices/printerdrivers/group/printers.iby Mon May 03 13:44:32 2010 +0300
+++ b/printingservices/printerdrivers/group/printers.iby Fri May 14 17:10:13 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-2010 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"
@@ -20,7 +20,7 @@
#include "pdrstore.iby"
-#ifdef SYMBIAN_EXCLUDE_PRINT
+#ifndef __UPNP_PRINT_FRAMEWORK
REM Feature PRINT is not included in this ROM
--- a/printingservices/printerdriversupport/group/pdrstore.iby Mon May 03 13:44:32 2010 +0300
+++ b/printingservices/printerdriversupport/group/pdrstore.iby Fri May 14 17:10:13 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-2010 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"
@@ -17,7 +17,7 @@
#define __PDRSTORE_IBY__
REM PDRSTORE
-#ifdef SYMBIAN_EXCLUDE_PRINT
+#ifndef __UPNP_PRINT_FRAMEWORK
REM Feature PRINT is not included in this ROM
--- a/printingservices/printerdriversupport/src/FBSDRV.CPP Mon May 03 13:44:32 2010 +0300
+++ b/printingservices/printerdriversupport/src/FBSDRV.CPP Fri May 14 17:10:13 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-2010 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"
@@ -390,7 +390,7 @@
EXPORT_C TBool CFbsDrvControl::TransformBuffer()
{
TInt i;
- for (i = iScanLine->Des().Length() - 1; (i >= 0) && (iScanLine->Des()[i] == 0xFF); i--)
+ for (i = iScanLine->Length() - 1; (i >= 0) && (iScanLine->Des()[i] == 0xFF); i--)
{
}
TInt length = i + 1;
--- a/windowing/windowserver/minigui/group/minigui.oby Mon May 03 13:44:32 2010 +0300
+++ b/windowing/windowserver/minigui/group/minigui.oby Fri May 14 17:10:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 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"
@@ -24,7 +24,7 @@
#define NO_METROTRK_APP // don't want metrotrk application
#define HAS_ETHERNET // include etherDrv, ether802, DHCP
#define SYMBIAN_EXCLUDE_FAX
-#define SYMBIAN_EXCLUDE_IPSEC
+#undef __IPSEC
#define SYMBIAN_EXCLUDE_OBEX
#ifdef SYMBIAN_SYSTEM_STATE_MANAGEMENT
--- a/windowing/windowserver/nga/SERVER/openwfc/CLIENT.CPP Mon May 03 13:44:32 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/CLIENT.CPP Fri May 14 17:10:13 2010 +0300
@@ -548,7 +548,7 @@
// Dispatch the command to the WServ object that will process it
iDestObj->CommandL(opcode, cmdParams); // (call #5)
}
- while(iNextCmd<endCmd && !TWindowServerEvent::EventReceiver()->IsReadyToRun());
+ while(iNextCmd<endCmd);
}
--- a/windowing/windowserver/nga/SERVER/openwfc/screen.cpp Mon May 03 13:44:32 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/screen.cpp Fri May 14 17:10:13 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 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"
@@ -101,7 +101,7 @@
CScreen::CFallbackMap::~CFallbackMap()
{
- delete iMap;
+ delete []iMap;
}
void CScreen::CFallbackMap::ConstructL()
@@ -228,7 +228,7 @@
newMap = new TInt [maxSize];
if (newMap)
{
- delete iMap;
+ delete []iMap;
iMap = newMap;
iMapSize = maxSize;
}