Change-Id: I0b123e65f40570caeee611679d80dc27034d5a52
Reviewed-on: https://go-review.googlesource.com/c/go/+/494183
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
return
}
// if there's trace work to do, start it straight away
- if (traceEnabled() || trace.shutdown) && traceReaderAvailable() != nil {
+ if (traceEnabled() || traceShuttingDown()) && traceReaderAvailable() != nil {
startm(pp, false, false)
return
}
now, pollUntil, _ := checkTimers(pp, 0)
// Try to schedule the trace reader.
- if traceEnabled() || trace.shutdown {
+ if traceEnabled() || traceShuttingDown() {
gp := traceReader()
if gp != nil {
casgstatus(gp, _Gwaiting, _Grunnable)
return trace.enabled
}
+// traceShuttingDown returns true if the trace is currently shutting down.
+func traceShuttingDown() bool {
+ return trace.shutdown
+}
+
// StartTrace enables tracing for the current process.
// While tracing, the data will be buffered and available via ReadTrace.
// StartTrace returns an error if tracing is already enabled.