diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2015-07-02 14:35:23 +0200 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2015-07-02 16:04:07 +0000 |
commit | 1b96091a050d605b900f83e1a28b660729400799 (patch) | |
tree | 350a6f82ee2e538300b6b7b604a70198328b65aa | |
parent | d16c7f8004bd1c9f896367af7ea86f5530596b39 (diff) | |
download | go-1b96091a050d605b900f83e1a28b660729400799.tar.gz go-1b96091a050d605b900f83e1a28b660729400799.zip |
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>
-rw-r--r-- | src/internal/trace/parser.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/internal/trace/parser.go b/src/internal/trace/parser.go index 1117b18e47..ece5bc188d 100644 --- a/src/internal/trace/parser.go +++ b/src/internal/trace/parser.go @@ -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") |