...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package main
23
24 import (
25 "internal/trace"
26 "internal/trace/event/go122"
27 testgen "internal/trace/internal/testgen/go122"
28 )
29
30 func main() {
31 testgen.Main(gen)
32 }
33
34 func gen(t *testgen.Trace) {
35 g1 := t.Generation(1)
36
37
38 b10 := g1.Batch(trace.ThreadID(0), 0)
39 b10.Event("ProcStatus", trace.ProcID(0), go122.ProcRunning)
40 b10.Event("GoStatus", trace.GoID(1), trace.ThreadID(0), go122.GoRunning)
41 b10.Event("GoStop", "whatever", testgen.NoStack)
42
43
44 b11 := g1.Batch(trace.ThreadID(1), 0)
45 b11.Event("ProcStatus", trace.ProcID(1), go122.ProcRunning)
46 b11.Event("GoStart", trace.GoID(1), testgen.Seq(1))
47 b11.Event("GoStop", "whatever", testgen.NoStack)
48
49 g2 := t.Generation(2)
50
51
52 b21 := g2.Batch(trace.ThreadID(1), 3)
53 b21.Event("ProcStatus", trace.ProcID(1), go122.ProcRunning)
54 b21.Event("GoStart", trace.GoID(1), testgen.Seq(2))
55
56
57 b20 := g2.Batch(trace.ThreadID(0), 5)
58 b20.Event("ProcStatus", trace.ProcID(0), go122.ProcRunning)
59 b20.Event("GoStatus", trace.GoID(1), trace.ThreadID(0), go122.GoRunnable)
60 b20.Event("GoStart", trace.GoID(1), testgen.Seq(1))
61 b20.Event("GoStop", "whatever", testgen.NoStack)
62 }
63
View as plain text