]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: warn that cputicks() might not be monotonic.
authorKeith Randall <khr@golang.org>
Tue, 21 Oct 2014 21:46:07 +0000 (14:46 -0700)
committerKeith Randall <khr@golang.org>
Tue, 21 Oct 2014 21:46:07 +0000 (14:46 -0700)
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

src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/asm_amd64p32.s
src/runtime/asm_arm.s
src/runtime/stubs.go

index b0ed2d8ceb785e278dd24cb849f6d60d8c79803e..20d3c47c94d2f8483552d38b50b5a9d775cf485c 100644 (file)
@@ -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.
index 2ee3312086133b8ce47d557b42c7b6a287aa312c..709834180e55a31b774d81da9b785be628790d23 100644 (file)
@@ -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
index e27f67e1eecb54b5cc2c05d712411e6f00263329..28875bc55a146a4e386b68c58f4731f3de0288ea 100644 (file)
@@ -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
index b21441488a6e77c39e867bd2093d536a1f132fa9..621d13187acf0df513c652b4a73a16fc994d86f6 100644 (file)
@@ -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
index 6561094ff18dcfe70cfd1d6b8c77ed3687bef194..3419047198e813fd0065d9a5805985ad8b63e547 100644 (file)
@@ -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)