aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHana Kim <hakim@google.com>2018-01-26 10:28:10 -0500
committerHyang-Ah Hana Kim <hyangah@gmail.com>2018-02-21 20:14:30 +0000
commit3e1ac1b01746cca385281cdaef8a4c3c35a2efac (patch)
tree2252decb89741bce038d23b88e70d301755ff8dd /src
parentf42418b25da382382a35730eff68fd27d049c581 (diff)
downloadgo-3e1ac1b01746cca385281cdaef8a4c3c35a2efac.tar.xz
cmd/trace: include P info in goroutine slices
The task-oriented trace view presents the execution trace organized based on goroutines. Often, which P a goroutine was running on is useful, so this CL includes the P ids in the goroutine execution slices. R=go1.11 Change-Id: I96539bf8215e5c1cd8cc997a90204f57347c48c8 Reviewed-on: https://go-review.googlesource.com/90221 Reviewed-by: Heschi Kreinick <heschi@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/trace/trace.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/trace/trace.go b/src/cmd/trace/trace.go
index 2832b90b82..6fa459c7c2 100644
--- a/src/cmd/trace/trace.go
+++ b/src/cmd/trace/trace.go
@@ -726,8 +726,17 @@ func (ctx *traceContext) emitSlice(ev *trace.Event, name string) *ViewerEvent {
Stack: ctx.stack(ev.Stk),
EndStack: ctx.stack(ev.Link.Stk),
}
+
// grey out non-overlapping events if the event is not a global event (ev.G == 0)
if ctx.mode == taskTraceview && ev.G != 0 {
+ // include P information.
+ if t := ev.Type; t == trace.EvGoStart || t == trace.EvGoStartLabel {
+ type Arg struct {
+ P int
+ }
+ sl.Arg = &Arg{P: ev.P}
+ }
+ // grey out non-overlapping events.
overlapping := false
for _, task := range ctx.tasks {
if _, overlapped := task.overlappingDuration(ev); overlapped {