Commit 1b96091a authored by Dmitry Vyukov's avatar Dmitry Vyukov Committed by Brad Fitzpatrick

internal/trace: add comment for stable sort

As per comments in cl/11834.

Change-Id: I285536b882fa9496e15d77d0d4c16ee913aca581
Reviewed-on: https://go-review.googlesource.com/11861Reviewed-by: 's avatarDaniel Theophanes <kardianos@gmail.com>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent d16c7f80
......@@ -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")
......
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