aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/trace
diff options
context:
space:
mode:
authorHana (Hyang-Ah) Kim <hyangah@gmail.com>2020-04-10 14:56:59 -0400
committerHyang-Ah Hana Kim <hyangah@gmail.com>2020-04-13 17:18:58 +0000
commit28a55d01236d27390e20bb35093c2a590ca42e47 (patch)
tree7fbff40c9b493560f941621ff915398ac6738358 /src/cmd/trace
parent1e820a3432029355402aeeaf769b9a4e46eb46aa (diff)
downloadgo-28a55d01236d27390e20bb35093c2a590ca42e47.tar.gz
go-28a55d01236d27390e20bb35093c2a590ca42e47.zip
cmd/trace: use the focustask mode for user task/region trace views
The taskid mode is based on the goroutine-oriented trace view, which displays each goroutine as a separate row. This is good when inspecting the interaction and timeline among related goroutines, and the user region information (associated with each goroutine) in detail, but when many goroutines are involved, this mode does not scale. The focustask mode is based on the default trace view with the user task hierarchy at the top. Each row is a P and there are only a handful number of Ps in most cases, so browsers can handle this mode more gracefully. But, I had difficulty in displaying the user region information (because a goroutine can start/stop/ migrate across Ps, and visualizing the stack of regions nicely was complicated). It may be doable, but it's a work. This CL surfaces the hidden focustask mode. Moreover, use it as the default user task view mode. The taskid mode can be still accessible through 'goroutine view' links. Unlike taskid-based user annotation view that extends goroutine-based trace view, the focustask view Change-Id: Ib691a5e1dd14695fa70a0ae67bff62817025e8c3 Reviewed-on: https://go-review.googlesource.com/c/go/+/227921 Reviewed-by: Michael Matloob <matloob@golang.org> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/trace')
-rw-r--r--src/cmd/trace/annotations.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/trace/annotations.go b/src/cmd/trace/annotations.go
index d991588a72..817ed0d4a2 100644
--- a/src/cmd/trace/annotations.go
+++ b/src/cmd/trace/annotations.go
@@ -1062,7 +1062,10 @@ Search log text: <form onsubmit="window.location.search+='&logtext='+window.logt
<td class="when">{{$el.WhenString}}</td>
<td class="elapsed">{{$el.Duration}}</td>
<td></td>
- <td><a href="/trace?taskid={{$el.ID}}#{{asMillisecond $el.Start}}:{{asMillisecond $el.End}}">Task {{$el.ID}}</a> ({{if .Complete}}complete{{else}}incomplete{{end}})</td>
+ <td>
+<a href="/trace?focustask={{$el.ID}}#{{asMillisecond $el.Start}}:{{asMillisecond $el.End}}">Task {{$el.ID}}</a>
+<a href="/trace?taskid={{$el.ID}}#{{asMillisecond $el.Start}}:{{asMillisecond $el.End}}">(goroutine view)</a>
+({{if .Complete}}complete{{else}}incomplete{{end}})</td>
</tr>
{{range $el.Events}}
<tr>
@@ -1249,7 +1252,7 @@ function reloadTable(key, value) {
{{range .Data}}
<tr>
<td> <a href="/trace?goid={{.G}}">{{.G}}</a> </td>
- <td> {{if .TaskID}}<a href="/trace?taskid={{.TaskID}}">{{.TaskID}}</a>{{end}} </td>
+ <td> {{if .TaskID}}<a href="/trace?focustask={{.TaskID}}">{{.TaskID}}</a>{{end}} </td>
<td> {{prettyDuration .TotalTime}} </td>
<td>
<div class="stacked-bar-graph">