Commit b0b09212 authored by Peter Weinberger's avatar Peter Weinberger

Revert "internal/trace: change Less to make sorting events deterministice"

This reverts commit 1764609b.

Reason for revert: It breaks the dragonfly trybot, in which there are sometimes (non-deterministically) Events with the same timestamp that have to occur in a specific order.

Change-Id: I714e640c6ab5ccb23d5577e8aa98c7716ede7ad2
Reviewed-on: https://go-review.googlesource.com/114356Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 8aa57f1e
......@@ -133,7 +133,7 @@ func order1007(m map[int][]*Event) (events []*Event, err error) {
ev.Ts = ts
}
}
sort.Sort(eventList(events))
sort.Stable(eventList(events))
return
}
......@@ -243,20 +243,7 @@ func (l orderEventList) Len() int {
}
func (l orderEventList) Less(i, j int) bool {
a, b := l[i].ev, l[j].ev
if a.Ts != b.Ts {
return a.Ts < b.Ts
}
if a.Type != b.Type {
return a.Type < b.Type
}
if a.P != b.P {
return a.P < b.P
}
if a.G != b.G {
return a.G < b.G
}
return a.Args[0] < b.Args[0]
return l[i].ev.Ts < l[j].ev.Ts
}
func (l orderEventList) Swap(i, j int) {
......
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