diff options
Diffstat (limited to 'src/cmd/trace/threadgen.go')
| -rw-r--r-- | src/cmd/trace/threadgen.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cmd/trace/threadgen.go b/src/cmd/trace/threadgen.go index c2e2c86f6c..7f9e7a72f0 100644 --- a/src/cmd/trace/threadgen.go +++ b/src/cmd/trace/threadgen.go @@ -138,14 +138,17 @@ func (g *threadGenerator) ProcTransition(ctx *traceContext, ev *trace.Event) { } } - type procArg struct { - Proc uint64 `json:"proc,omitempty"` - } st := ev.StateTransition() viewerEv := traceviewer.InstantEvent{ Resource: uint64(ev.Thread()), Stack: ctx.Stack(viewerFrames(ev.Stack())), - Arg: procArg{Proc: uint64(st.Resource.Proc())}, + + // Annotate with the thread and proc. The thread is redundant, but this is to + // stay consistent with the proc view. + Arg: format.SchedCtxArg{ + ProcID: uint64(st.Resource.Proc()), + ThreadID: uint64(ev.Thread()), + }, } from, to := st.Proc() @@ -159,7 +162,6 @@ func (g *threadGenerator) ProcTransition(ctx *traceContext, ev *trace.Event) { start = ctx.startTime } viewerEv.Name = "proc start" - viewerEv.Arg = format.ThreadIDArg{ThreadID: uint64(ev.Thread())} viewerEv.Ts = ctx.elapsed(start) // TODO(mknyszek): We don't have a state machine for threads, so approximate // running threads with running Ps. |
