]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove unused traceFutileWakeup
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 10 May 2023 01:06:21 +0000 (01:06 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 11 May 2023 21:27:11 +0000 (21:27 +0000)
Also, document traceEvFutileWakeup as not currently used.

Change-Id: I75831a43d39b6c6ceb5a9b6320c3ae9455681572
Reviewed-on: https://go-review.googlesource.com/c/go/+/494184
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/trace.go

index a89c407a8affe1abacb785dc392ee7fcfae3c36d..0e273fba7c39c7a7faf091368a17b36b76fdd237 100644 (file)
@@ -58,7 +58,7 @@ const (
        traceEvHeapAlloc         = 33 // gcController.heapLive change [timestamp, heap_alloc]
        traceEvHeapGoal          = 34 // gcController.heapGoal() (formerly next_gc) change [timestamp, heap goal in bytes]
        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 // not currently used; denotes that the previous wakeup of this goroutine was futile [timestamp]
        traceEvString            = 37 // string dictionary entry [ID, length, string]
        traceEvGoStartLocal      = 38 // goroutine starts running on the same P as the last event [timestamp, goroutine id]
        traceEvGoUnblockLocal    = 39 // goroutine is unblocked on the same P as the last event [timestamp, goroutine id, stack]
@@ -99,13 +99,6 @@ const (
        traceBytesPerNumber = 10
        // Shift of the number of arguments in the first event byte.
        traceArgCountShift = 6
-       // Flag passed to traceGoPark to denote that the previous wakeup of this
-       // goroutine was futile. For example, a goroutine was unblocked on a mutex,
-       // but another goroutine got ahead and acquired the mutex before the first
-       // goroutine is scheduled, so the first goroutine has to block again.
-       // Such wakeups happen on buffered channels and sync.Mutex,
-       // but are generally not interesting for end user.
-       traceFutileWakeup byte = 128
 )
 
 // trace is global tracing context.
@@ -1552,10 +1545,7 @@ func traceGoPreempt() {
 }
 
 func traceGoPark(traceEv byte, skip int) {
-       if traceEv&traceFutileWakeup != 0 {
-               traceEvent(traceEvFutileWakeup, -1)
-       }
-       traceEvent(traceEv & ^traceFutileWakeup, skip)
+       traceEvent(traceEv, skip)
 }
 
 func traceGoUnpark(gp *g, skip int) {