Commit f939ee13 authored by Rahul Chaudhry's avatar Rahul Chaudhry Committed by Ian Lance Taylor

runtime: fix GODEBUG=schedtrace=X delay handling.

debug.schedtrace is an int32. Convert it to int64 before
multiplying with constant 1000000. Otherwise, schedtrace
values more than 2147 result in int32 overflow causing
incorrect delays between traces.

Change-Id: I064e8d7b432c1e892a705ee1f31a2e8cdd2c3ea3
Reviewed-on: https://go-review.googlesource.com/17712Reviewed-by: 's avatarAustin Clements <austin@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
parent 08164329
...@@ -3413,7 +3413,7 @@ func sysmon() { ...@@ -3413,7 +3413,7 @@ func sysmon() {
lastscavenge = now lastscavenge = now
nscavenge++ nscavenge++
} }
if debug.schedtrace > 0 && lasttrace+int64(debug.schedtrace*1000000) <= now { if debug.schedtrace > 0 && lasttrace+int64(debug.schedtrace)*1000000 <= now {
lasttrace = now lasttrace = now
schedtrace(debug.scheddetail > 0) schedtrace(debug.scheddetail > 0)
} }
......
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