mirror of
https://github.com/golang/go
synced 2024-11-26 09:38:10 -07:00
runtime: remove walltime function
There was only one meaningful caller, which changes to call time_now. This clearly separates systems that use walltime1 to be just those that use the stub version of time_now. That is to say, those that do not provide an assembler version of time_now. Change-Id: I14c06cc402070bd705f953af6f9966785015e2a5 Reviewed-on: https://go-review.googlesource.com/c/go/+/314769 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
parent
d09947522d
commit
42953bc9f5
@ -37,14 +37,9 @@ func nanotime() int64 {
|
|||||||
return faketime
|
return faketime
|
||||||
}
|
}
|
||||||
|
|
||||||
func walltime() (sec int64, nsec int32) {
|
|
||||||
return faketime / 1000000000, int32(faketime % 1000000000)
|
|
||||||
}
|
|
||||||
|
|
||||||
//go:linkname time_now time.now
|
//go:linkname time_now time.now
|
||||||
func time_now() (sec int64, nsec int32, mono int64) {
|
func time_now() (sec int64, nsec int32, mono int64) {
|
||||||
sec, nsec = walltime()
|
return faketime / 1e9, int32(faketime % 1e9), faketime
|
||||||
return sec, nsec, nanotime()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func write(fd uintptr, p unsafe.Pointer, n int32) int32 {
|
func write(fd uintptr, p unsafe.Pointer, n int32) int32 {
|
||||||
|
@ -20,10 +20,6 @@ func nanotime() int64 {
|
|||||||
return nanotime1()
|
return nanotime1()
|
||||||
}
|
}
|
||||||
|
|
||||||
func walltime() (sec int64, nsec int32) {
|
|
||||||
return walltime1()
|
|
||||||
}
|
|
||||||
|
|
||||||
// write must be nosplit on Windows (see write1)
|
// write must be nosplit on Windows (see write1)
|
||||||
//
|
//
|
||||||
//go:nosplit
|
//go:nosplit
|
||||||
|
@ -16,6 +16,6 @@ import _ "unsafe" // for go:linkname
|
|||||||
|
|
||||||
//go:linkname time_now time.now
|
//go:linkname time_now time.now
|
||||||
func time_now() (sec int64, nsec int32, mono int64) {
|
func time_now() (sec int64, nsec int32, mono int64) {
|
||||||
sec, nsec = walltime()
|
sec, nsec = walltime1()
|
||||||
return sec, nsec, nanotime()
|
return sec, nsec, nanotime()
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ func writeLogdHeader() int {
|
|||||||
// hdr[3:7] sec unsigned uint32, little endian.
|
// hdr[3:7] sec unsigned uint32, little endian.
|
||||||
// hdr[7:11] nsec unsigned uint32, little endian.
|
// hdr[7:11] nsec unsigned uint32, little endian.
|
||||||
hdr[0] = 0 // LOG_ID_MAIN
|
hdr[0] = 0 // LOG_ID_MAIN
|
||||||
sec, nsec := walltime()
|
sec, nsec, _ := time_now()
|
||||||
packUint32(hdr[3:7], uint32(sec))
|
packUint32(hdr[3:7], uint32(sec))
|
||||||
packUint32(hdr[7:11], uint32(nsec))
|
packUint32(hdr[7:11], uint32(nsec))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user