diff --git a/src/internal/trace/order.go b/src/internal/trace/order.go index 36ed58d675..d0b58301d6 100644 --- a/src/internal/trace/order.go +++ b/src/internal/trace/order.go @@ -133,7 +133,7 @@ func order1007(m map[int][]*Event) (events []*Event, err error) { ev.Ts = ts } } - sort.Stable(eventList(events)) + sort.Sort(eventList(events)) return } @@ -243,7 +243,20 @@ func (l orderEventList) Len() int { } func (l orderEventList) Less(i, j int) bool { - return l[i].ev.Ts < l[j].ev.Ts + 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] } func (l orderEventList) Swap(i, j int) {