]> Cypherpunks repositories - gostls13.git/commit
internal/trace: stable sort events
authorDmitry Vyukov <dvyukov@google.com>
Wed, 1 Jul 2015 14:41:27 +0000 (16:41 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 2 Jul 2015 00:37:16 +0000 (00:37 +0000)
commit64e48bbaba5a35049befe695ce0ff54ce93e2955
tree48adac69484ead3197b41e1404d1b19224c7408f
parentcd2e2f60e77c05d68755ce5df4c401be1ea5b0d3
internal/trace: stable sort events

On some VMs two events can happen at the same time. For examples:
179827399 GoStart p=2 g=11 off=936359 g=11
179827399 GoUnblock p=2 g=0 off=936355 g=11
If we do non-stable sort, the events can be reordered making the trace inconsistent.
Do stable sort instead.

Batches are dumped in FIFO order, so if these same-time events are split into
separate batches, stable sort still works.

Events on different CPUs go into different batches and can be reordered.
But the intention is that causally-related events on different CPUs
will have larger (non-zero) time diff.

Update #11320

Change-Id: Id1df96af41dff68ea1782ab4b23d5afd63b890c9
Reviewed-on: https://go-review.googlesource.com/11834
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/internal/trace/parser.go