runtime/trace: report negative frequency as a time-ordering problem

This should fix the solaris/amd64 builder.

Change-Id: Idd6460cc9e842f7b874c9757379986aa723c974c
Reviewed-on: https://go-review.googlesource.com/12922
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Russ Cox 2015-07-30 13:39:30 -04:00
parent 4e15092006
commit ca6f7e45cb

View File

@ -191,8 +191,10 @@ func parseEvents(rawEvents []rawEvent) (events []*Event, err error) {
case EvFrequency: case EvFrequency:
ticksPerSec = int64(raw.args[0]) ticksPerSec = int64(raw.args[0])
if ticksPerSec <= 0 { if ticksPerSec <= 0 {
err = fmt.Errorf("EvFrequency contains invalid frequency %v at offset 0x%x", // The most likely cause for this is tick skew on different CPUs.
ticksPerSec, raw.off) // For example, solaris/amd64 seems to have wildly different
// ticks on different CPUs.
err = ErrTimeOrder
return return
} }
case EvTimerGoroutine: case EvTimerGoroutine: