aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2014-10-21 14:46:07 -0700
committerKeith Randall <khr@golang.org>2014-10-21 14:46:07 -0700
commitb60d5e12e983e7e48ffab47b15e372bd23fbad98 (patch)
tree06cbdf515ac0228fe662c5516d7abbed74e72024 /src/runtime
parentf29bd6c4a4385cd9ad24b4a0da0b66dd4f6644aa (diff)
downloadgo-b60d5e12e983e7e48ffab47b15e372bd23fbad98.tar.xz
runtime: warn that cputicks() might not be monotonic.
Get rid of gocputicks(), it is no longer used. LGTM=bradfitz, dave R=golang-codereviews, bradfitz, dave, minux CC=golang-codereviews https://golang.org/cl/161110044
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/asm_386.s6
-rw-r--r--src/runtime/asm_amd64.s7
-rw-r--r--src/runtime/asm_amd64p32.s7
-rw-r--r--src/runtime/asm_arm.s3
-rw-r--r--src/runtime/stubs.go4
5 files changed, 4 insertions, 23 deletions
diff --git a/src/runtime/asm_386.s b/src/runtime/asm_386.s
index b0ed2d8ceb..20d3c47c94 100644
--- a/src/runtime/asm_386.s
+++ b/src/runtime/asm_386.s
@@ -871,12 +871,6 @@ TEXT runtime·cputicks(SB),NOSPLIT,$0-8
MOVL DX, ret_hi+4(FP)
RET
-TEXT runtime·gocputicks(SB),NOSPLIT,$0-8
- RDTSC
- MOVL AX, ret_lo+0(FP)
- MOVL DX, ret_hi+4(FP)
- RET
-
TEXT runtime·ldt0setup(SB),NOSPLIT,$16-0
// set up ldt 7 to point at tls0
// ldt 1 would be fine on Linux, but on OS X, 7 is as low as we can go.
diff --git a/src/runtime/asm_amd64.s b/src/runtime/asm_amd64.s
index 2ee3312086..709834180e 100644
--- a/src/runtime/asm_amd64.s
+++ b/src/runtime/asm_amd64.s
@@ -855,13 +855,6 @@ TEXT runtime·cputicks(SB),NOSPLIT,$0-0
MOVQ AX, ret+0(FP)
RET
-TEXT runtime·gocputicks(SB),NOSPLIT,$0-8
- RDTSC
- SHLQ $32, DX
- ADDQ DX, AX
- MOVQ AX, ret+0(FP)
- RET
-
// hash function using AES hardware instructions
TEXT runtime·aeshash(SB),NOSPLIT,$0-32
MOVQ p+0(FP), AX // ptr to data
diff --git a/src/runtime/asm_amd64p32.s b/src/runtime/asm_amd64p32.s
index e27f67e1ee..28875bc55a 100644
--- a/src/runtime/asm_amd64p32.s
+++ b/src/runtime/asm_amd64p32.s
@@ -657,13 +657,6 @@ TEXT runtime·cputicks(SB),NOSPLIT,$0-0
MOVQ AX, ret+0(FP)
RET
-TEXT runtime·gocputicks(SB),NOSPLIT,$0-8
- RDTSC
- SHLQ $32, DX
- ADDQ DX, AX
- MOVQ AX, ret+0(FP)
- RET
-
// hash function using AES hardware instructions
// For now, our one amd64p32 system (NaCl) does not
// support using AES instructions, so have not bothered to
diff --git a/src/runtime/asm_arm.s b/src/runtime/asm_arm.s
index b21441488a..621d13187a 100644
--- a/src/runtime/asm_arm.s
+++ b/src/runtime/asm_arm.s
@@ -1275,9 +1275,6 @@ TEXT runtime·fastrand1(SB),NOSPLIT,$-4-4
MOVW R0, ret+0(FP)
RET
-TEXT runtime·gocputicks(SB),NOSPLIT,$0
- B runtime·cputicks(SB)
-
TEXT runtime·return0(SB),NOSPLIT,$0
MOVW $0, R0
RET
diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go
index 6561094ff1..3419047198 100644
--- a/src/runtime/stubs.go
+++ b/src/runtime/stubs.go
@@ -180,7 +180,11 @@ func exit(code int32)
func breakpoint()
func nanotime() int64
func usleep(usec uint32)
+
+// careful: cputicks is not guaranteed to be monotonic! In particular, we have
+// noticed drift between cpus on certain os/arch combinations. See issue 8976.
func cputicks() int64
+
func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uint32) unsafe.Pointer
func munmap(addr unsafe.Pointer, n uintptr)
func madvise(addr unsafe.Pointer, n uintptr, flags int32)