diff mbox

libgo patch committed: Add back syscall time tests

Message ID mcr62hti1qv.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Dec. 7, 2011, 1:55 a.m. UTC
This patch to libgo adds back some benchmark tests which were previously
commented out, and makes them work.  These benchmarks were for the
multiplexing code which was added recently.  Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r 1e88c09c3f8b libgo/go/runtime/export_test.go
--- a/libgo/go/runtime/export_test.go	Tue Dec 06 17:21:24 2011 -0800
+++ b/libgo/go/runtime/export_test.go	Tue Dec 06 17:51:03 2011 -0800
@@ -18,11 +18,8 @@ 
 
 func entersyscall()
 func exitsyscall()
-func LockedOSThread() bool
-
-/* Useless for gccgo.
+func golockedOSThread() bool
 
 var Entersyscall = entersyscall
 var Exitsyscall = exitsyscall
-
-*/
+var LockedOSThread = golockedOSThread
diff -r 1e88c09c3f8b libgo/go/runtime/proc_test.go
--- a/libgo/go/runtime/proc_test.go	Tue Dec 06 17:21:24 2011 -0800
+++ b/libgo/go/runtime/proc_test.go	Tue Dec 06 17:51:03 2011 -0800
@@ -74,8 +74,6 @@ 
 	}
 }
 
-/* These benchmarks are meaningless for gccgo.
-
 func BenchmarkSyscall(b *testing.B) {
 	const CallsPerSched = 1000
 	procs := runtime.GOMAXPROCS(-1)
@@ -125,5 +123,3 @@ 
 		<-c
 	}
 }
-
-*/
diff -r 1e88c09c3f8b libgo/runtime/proc.c
--- a/libgo/runtime/proc.c	Tue Dec 06 17:21:24 2011 -0800
+++ b/libgo/runtime/proc.c	Tue Dec 06 17:51:03 2011 -0800
@@ -1156,6 +1156,26 @@ 
 	return newg;
 }
 
+/* For runtime package testing.  */
+
+void runtime_testing_entersyscall(void)
+  __asm__("libgo_runtime.runtime.entersyscall");
+
+void
+runtime_testing_entersyscall()
+{
+	runtime_entersyscall();
+}
+
+void runtime_testing_exitsyscall(void)
+  __asm__("libgo_runtime.runtime.exitsyscall");
+
+void
+runtime_testing_exitsyscall()
+{
+	runtime_exitsyscall();
+}
+
 G*
 __go_go(void (*fn)(void*), void* arg)
 {
@@ -1330,6 +1350,17 @@ 
 	return g->lockedm != nil && m->lockedg != nil;
 }
 
+// for testing of callbacks
+
+_Bool runtime_golockedOSThread(void)
+  asm("libgo_runtime.runtime.golockedOSThread");
+
+_Bool
+runtime_golockedOSThread(void)
+{
+	return runtime_lockedOSThread();
+}
+
 // for testing of wire, unwire
 uint32
 runtime_mid()