mirror of
https://github.com/golang/go
synced 2024-11-20 06:04:52 -07:00
internal/trace: add comment for stable sort
As per comments in cl/11834. Change-Id: I285536b882fa9496e15d77d0d4c16ee913aca581 Reviewed-on: https://go-review.googlesource.com/11861 Reviewed-by: Daniel Theophanes <kardianos@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
d16c7f8004
commit
1b96091a05
@ -254,6 +254,8 @@ func parseEvents(rawEvents []rawEvent) (events []*Event, err error) {
|
||||
}
|
||||
|
||||
// Sort by time and translate cpu ticks to real time.
|
||||
// Use stable sort because adjacent events in a batch can have the same timestamp
|
||||
// (this was observed on some VMs).
|
||||
sort.Stable(eventList(events))
|
||||
if ticksPerSec == 0 {
|
||||
err = fmt.Errorf("no EvFrequency event")
|
||||
|
Loading…
Reference in New Issue
Block a user