Commit 580337e2 authored by Ian Lance Taylor's avatar Ian Lance Taylor

runtime, time: remove old timer code

Updates #6239
Updates #27707

Change-Id: I65e6471829c9de4677d3ac78ef6cd7aa0a1fc4cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/171884Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarMichael Knyszek <mknyszek@google.com>
Reviewed-by: default avatarEmmanuel Odeke <emm.odeke@gmail.com>
parent 8cf5293c
...@@ -4410,26 +4410,6 @@ func checkdead() { ...@@ -4410,26 +4410,6 @@ func checkdead() {
} }
// Maybe jump time forward for playground. // Maybe jump time forward for playground.
if oldTimers {
gp := timejumpOld()
if gp != nil {
casgstatus(gp, _Gwaiting, _Grunnable)
globrunqput(gp)
_p_ := pidleget()
if _p_ == nil {
throw("checkdead: no p for timer")
}
mp := mget()
if mp == nil {
// There should always be a free M since
// nothing is running.
throw("checkdead: no m for timer")
}
mp.nextp.set(_p_)
notewakeup(&mp.park)
return
}
} else {
_p_ := timejump() _p_ := timejump()
if _p_ != nil { if _p_ != nil {
for pp := &sched.pidle; *pp != 0; pp = &(*pp).ptr().link { for pp := &sched.pidle; *pp != 0; pp = &(*pp).ptr().link {
...@@ -4448,7 +4428,6 @@ func checkdead() { ...@@ -4448,7 +4428,6 @@ func checkdead() {
notewakeup(&mp.park) notewakeup(&mp.park)
return return
} }
}
// There are no goroutines running, so we can look at the P's. // There are no goroutines running, so we can look at the P's.
for _, _p_ := range allp { for _, _p_ := range allp {
......
This diff is collapsed.
...@@ -54,7 +54,7 @@ const ( ...@@ -54,7 +54,7 @@ const (
traceEvGoInSyscall = 32 // denotes that goroutine is in syscall when tracing starts [timestamp, goroutine id] traceEvGoInSyscall = 32 // denotes that goroutine is in syscall when tracing starts [timestamp, goroutine id]
traceEvHeapAlloc = 33 // memstats.heap_live change [timestamp, heap_alloc] traceEvHeapAlloc = 33 // memstats.heap_live change [timestamp, heap_alloc]
traceEvNextGC = 34 // memstats.next_gc change [timestamp, next_gc] traceEvNextGC = 34 // memstats.next_gc change [timestamp, next_gc]
traceEvTimerGoroutine = 35 // denotes timer goroutine [timer goroutine id] traceEvTimerGoroutine = 35 // not currently used; previously denoted timer goroutine [timer goroutine id]
traceEvFutileWakeup = 36 // denotes that the previous wakeup of this goroutine was futile [timestamp] traceEvFutileWakeup = 36 // denotes that the previous wakeup of this goroutine was futile [timestamp]
traceEvString = 37 // string dictionary entry [ID, length, string] traceEvString = 37 // string dictionary entry [ID, length, string]
traceEvGoStartLocal = 38 // goroutine starts running on the same P as the last event [timestamp, goroutine id] traceEvGoStartLocal = 38 // goroutine starts running on the same P as the last event [timestamp, goroutine id]
...@@ -416,13 +416,6 @@ func ReadTrace() []byte { ...@@ -416,13 +416,6 @@ func ReadTrace() []byte {
var data []byte var data []byte
data = append(data, traceEvFrequency|0<<traceArgCountShift) data = append(data, traceEvFrequency|0<<traceArgCountShift)
data = traceAppend(data, uint64(freq)) data = traceAppend(data, uint64(freq))
for i := range timers {
tb := &timers[i]
if tb.gp != nil {
data = append(data, traceEvTimerGoroutine|0<<traceArgCountShift)
data = traceAppend(data, uint64(tb.gp.goid))
}
}
// This will emit a bunch of full buffers, we will pick them up // This will emit a bunch of full buffers, we will pick them up
// on the next iteration. // on the next iteration.
trace.stackTab.dump() trace.stackTab.dump()
......
...@@ -11,10 +11,7 @@ func Sleep(d Duration) ...@@ -11,10 +11,7 @@ func Sleep(d Duration)
// Interface to timers implemented in package runtime. // Interface to timers implemented in package runtime.
// Must be in sync with ../runtime/time.go:/^type timer // Must be in sync with ../runtime/time.go:/^type timer
type runtimeTimer struct { type runtimeTimer struct {
tb uintptr
i int
pp uintptr pp uintptr
when int64 when int64
period int64 period int64
f func(interface{}, uintptr) // NOTE: must not be closure f func(interface{}, uintptr) // NOTE: must not be closure
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment