viewerEv := traceviewer.InstantEvent{
Resource: uint64(proc),
Stack: ctx.Stack(viewerFrames(ev.Stack())),
+
+ // Annotate with the thread and proc. The proc is redundant, but this is to
+ // stay consistent with the thread view, where it's useful information.
+ Arg: format.SchedCtxArg{
+ ProcID: uint64(st.Resource.Proc()),
+ ThreadID: uint64(ev.Thread()),
+ },
}
from, to := st.Proc()
start = ctx.startTime
}
viewerEv.Name = "proc start"
- viewerEv.Arg = format.ThreadIDArg{ThreadID: uint64(ev.Thread())}
viewerEv.Ts = ctx.elapsed(start)
ctx.IncThreadStateCount(ctx.elapsed(start), traceviewer.ThreadStateRunning, 1)
}
}
}
- 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()
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.
InSyscall int64
}
-type ThreadIDArg struct {
- ThreadID uint64
+type SchedCtxArg struct {
+ ThreadID uint64 `json:"thread,omitempty"`
+ ProcID uint64 `json:"proc,omitempty"`
}