List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:October 4 2007 4:10pm
Subject:bk commit into 6.0 tree (jas:1.2614)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of . When  does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-10-04 12:10:17-04:00, jas@rowvwade. +6 -0
  Add more diagnostic trace options include sync object dump
  and SyncObject contention tester.

  storage/falcon/Database.cpp@stripped, 2007-10-04 12:10:09-04:00, jas@rowvwade. +10 -1
    Add more diagnostic trace options include sync object dump
    and SyncObject contention tester.

  storage/falcon/Database.h@stripped, 2007-10-04 12:10:09-04:00, jas@rowvwade. +2 -0
    Add more diagnostic trace options include sync object dump
    and SyncObject contention tester.

  storage/falcon/Makefile.am@stripped, 2007-10-04 12:10:09-04:00, jas@rowvwade. +10 -2
    Added class SyncTest.

  storage/falcon/SyncObject.cpp@stripped, 2007-10-04 12:10:10-04:00, jas@rowvwade. +26 -2
    Turned off snoozed during contention state variable contention
    backoff.  Also added SyncObject::dump to simplify extraction
    of runtime data.

  storage/falcon/SyncObject.h@stripped, 2007-10-04 12:10:10-04:00, jas@rowvwade. +1 -0
    Turned off snoozed during contention state variable contention
    backoff.  Also added SyncObject::dump to simplify extraction
    of runtime data.

  storage/falcon/SyncTest.cpp@stripped, 2007-10-04 12:10:10-04:00, jas@rowvwade. +1 -2
    Fixed destructor problem.

diff -Nrup a/storage/falcon/Database.cpp b/storage/falcon/Database.cpp
--- a/storage/falcon/Database.cpp	2007-10-03 13:02:47 -04:00
+++ b/storage/falcon/Database.cpp	2007-10-04 12:10:09 -04:00
@@ -72,6 +72,7 @@
 #include "MemMgr.h"
 #include "RecordScavenge.h"
 #include "LogStream.h"
+#include "SyncTest.h"
 
 #ifndef STORAGE_ENGINE
 #include "Applications.h"
@@ -92,7 +93,6 @@ extern unsigned int falcon_page_size;
 #ifdef LICENSE
 #include "LicenseManager.h"
 #include "LicenseProduct.h"
-#include ".\database.h"
 #endif
 
 #ifdef _DEBUG
@@ -2277,6 +2277,15 @@ void Database::debugTrace(void)
 {
 	if (falcon_debug_trace & FALC0N_TRACE_TRANSACTIONS)
 		transactionManager->printBlockage();
+
+	if (falcon_debug_trace & FALC0N_SYNC_TEST)
+		{
+		SyncTest syncTest;
+		syncTest.test();
+		}
 	
+	if (falcon_debug_trace & FALC0N_SYNC_OBJECTS)
+		SyncObject::dump();
+				
 	falcon_debug_trace = 0;
 }
diff -Nrup a/storage/falcon/Database.h b/storage/falcon/Database.h
--- a/storage/falcon/Database.h	2007-10-03 13:02:47 -04:00
+++ b/storage/falcon/Database.h	2007-10-04 12:10:09 -04:00
@@ -42,6 +42,8 @@
 #define VERSION_SERIAL_LOG				COMBINED_VERSION(ODS_VERSION2, ODS_MINOR_VERSION1)
 
 static const int FALC0N_TRACE_TRANSACTIONS	= 1;
+static const int FALC0N_SYNC_TEST			= 2;
+static const int FALC0N_SYNC_OBJECTS		= 4;
 
 #define TABLE_HASH_SIZE		101
 
diff -Nrup a/storage/falcon/Makefile.am b/storage/falcon/Makefile.am
--- a/storage/falcon/Makefile.am	2007-09-30 17:11:00 -04:00
+++ b/storage/falcon/Makefile.am	2007-10-04 12:10:09 -04:00
@@ -159,7 +159,11 @@ falcon_headers= Agent.h Alias.h Applicat
 		StorageHandler.h \
 		StorageTable.h StorageTableShare.h Stream.h \
 		StreamSegment.h SymbolManager.h Sync.h SynchronizationObject.h \
-		Synchronize.h SyncObject.h SyncWait.h Syntax.h \
+		Synchronize.h \
+		SyncObject.h \
+		SyncTest.h \
+		SyncWait.h \
+		Syntax.h \
 		TableAttachment.h \
 		TableFilter.h \
 		Table.h \
@@ -315,7 +319,11 @@ falcon_sources= Agent.cpp Alias.cpp \
 		StorageHandler.cpp \
 		StorageTable.cpp StorageTableShare.cpp Stream.cpp \
 		StreamSegment.cpp SymbolManager.cpp Sync.cpp Synchronize.cpp \
-		SyncObject.cpp SyncWait.cpp Syntax.cpp TableAttachment.cpp \
+		SyncObject.cpp\
+		SyncTest.cpp\
+		SyncWait.cpp\
+		Syntax.cpp\
+		TableAttachment.cpp \
 		Table.cpp \
 		TableSpace.cpp \
 		TableSpaceManager.cpp \
diff -Nrup a/storage/falcon/SyncObject.cpp b/storage/falcon/SyncObject.cpp
--- a/storage/falcon/SyncObject.cpp	2007-09-20 11:42:42 -04:00
+++ b/storage/falcon/SyncObject.cpp	2007-10-04 12:10:10 -04:00
@@ -49,7 +49,7 @@
 //#define STALL_THRESHOLD	1000
 
 #define BACKOFF	\
-		if (thread)\
+		if (false)\
 			thread->sleep(1);\
 		else\
 			thread = Thread::getThread("SyncObject::lock")
@@ -59,7 +59,7 @@
 #define BUMP(counter)							++counter
 #define BUMP_INTERLOCKED(counter)				INTERLOCKED_INCREMENT(counter)
 
-static const int				MAX_SYNC_OBJECTS = 2000;
+static const int				MAX_SYNC_OBJECTS = 300000;
 static volatile INTERLOCK_TYPE	nextSyncObjectId;
 static SyncObject				*syncObjects[MAX_SYNC_OBJECTS];
 
@@ -617,6 +617,30 @@ void SyncObject::analyze(Stream* stream)
 					syncObject->exclusiveCount,
 					syncObject->waitCount,
 					(syncObject->waitCount) ? syncObject->queueLength / syncObject->waitCount : 0);
+#endif
+}
+
+void SyncObject::dump(void)
+{
+#ifdef TRACE_SYNC_OBJECTS
+	FILE *out = fopen("SyncObject.dat", "w");
+	
+	if (!out)
+		return;
+		
+	fprintf(out, "Where\tShares\tExclusives\tWaits\tAverage Queue\n");
+	SyncObject *syncObject;
+	
+	for (int n = 1; n < MAX_SYNC_OBJECTS; ++n)
+		if ( (syncObject = syncObjects[n]) && syncObject->where)
+			fprintf(out, "%s\t%d\t%d\t%d\t%d\t\n",
+					syncObject->where,
+					syncObject->sharedCount,
+					syncObject->exclusiveCount,
+					syncObject->waitCount,
+					(syncObject->waitCount) ? syncObject->queueLength / syncObject->waitCount : 0);
+	
+	fclose(out);
 #endif
 }
 
diff -Nrup a/storage/falcon/SyncObject.h b/storage/falcon/SyncObject.h
--- a/storage/falcon/SyncObject.h	2007-09-20 11:42:42 -04:00
+++ b/storage/falcon/SyncObject.h	2007-10-04 12:10:10 -04:00
@@ -79,6 +79,7 @@ public:
 
 	static void		analyze(Stream* stream);
 	static void		getSyncInfo(InfoTable* infoTable);
+	static void		dump(void);
 
 	inline Thread* getExclusiveThread()
 		{ return exclusiveThread; };
diff -Nrup a/storage/falcon/SyncTest.cpp b/storage/falcon/SyncTest.cpp
--- a/storage/falcon/SyncTest.cpp	2007-09-20 11:42:43 -04:00
+++ b/storage/falcon/SyncTest.cpp	2007-10-04 12:10:10 -04:00
@@ -32,6 +32,7 @@ SyncTest::SyncTest(void) : Thread("SyncT
 
 SyncTest::~SyncTest(void)
 {
+	useCount = 0;
 	delete [] threads;
 }
 
@@ -77,7 +78,6 @@ void SyncTest::test()
 		sync.unlock();
 		Thread::sleep(1000);
 		stop = true;
-		//sync.lock(Exclusive);
 		threadBarn->waitForAll();
 		int total = 0;
 		
@@ -90,7 +90,6 @@ void SyncTest::test()
 			printf(" %d", threads[thd].count);
 					
 		printf("\n");
-		//sync.unlock();
 		}
 	
 	threadBarn->shutdownAll();
Thread
bk commit into 6.0 tree (jas:1.2614)U-ROWVWADEjas4 Oct