aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/trace.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/trace.go')
-rw-r--r--src/runtime/trace.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/runtime/trace.go b/src/runtime/trace.go
index ac80ca2902..a4d50d77a0 100644
--- a/src/runtime/trace.go
+++ b/src/runtime/trace.go
@@ -453,12 +453,17 @@ func StopTrace() {
}
}
+ // Wait for startNanotime != endNanotime. On Windows the default interval between
+ // system clock ticks is typically between 1 and 15 milliseconds, which may not
+ // have passed since the trace started. Without nanotime moving forward, trace
+ // tooling has no way of identifying how much real time each cputicks time deltas
+ // represent.
for {
trace.endTime = traceClockNow()
trace.endTicks = cputicks()
trace.endNanotime = nanotime()
- // Windows time can tick only every 15ms, wait for at least one tick.
- if trace.endNanotime != trace.startNanotime {
+
+ if trace.endNanotime != trace.startNanotime || faketime != 0 {
break
}
osyield()