]> Cypherpunks repositories - gostls13.git/commit
cmd/trace: implement /trace?focustask=<taskid> mode
authorHana Kim <hakim@google.com>
Thu, 29 Mar 2018 21:58:07 +0000 (17:58 -0400)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Wed, 4 Apr 2018 18:14:40 +0000 (18:14 +0000)
commitc4874aa2a207e8c9a3c79a9411a54cce4808aa9e
treeb9d98591cba2627c34939146266c704f9e898ec6
parent4946d9e87b7340b7846fa2e5f4aea28c4d5f6ab4
cmd/trace: implement /trace?focustask=<taskid> mode

This mode is similar to the default traceview mode where the execution
trace is presented in P-oriented way. Each row represents a P, and each
slice represents the time interval of a goroutine's execution on the P.

The difference is that, in this mode, only the execution of goroutines
involved in the specified task is highlighted, and other goroutine
execution or events are greyed out. So, users can focus on how a task is
executed while considering other affecting conditions such as other
goroutines, network events, or process scheduling.

Example: https://user-images.githubusercontent.com/4999471/38116793-a6f995f0-337f-11e8-8de9-88eec2f2c497.png

Here, for a while the program remained idle after the first burst of
activity related to the task because all other goroutines were also
being blocked or waiting for events, or no incoming network traffic
(indicated by the lack of any network activity). This is a bit hard to
discover when the usual task-oriented view (/trace?taskid=<taskid>)
mode.

Also, it simplifies the traceview generation mode logic.
  /trace ---> 0
  /trace?goid ---> modeGoroutineOriented
  /trace?taskid ---> modeGoroutineOriented|modeTaskOriented
  /trace?focustask ---> modeTaskOriented

Change-Id: Idcc0ae31b708ddfd19766f4e26ee7efdafecd3a5
Reviewed-on: https://go-review.googlesource.com/103555
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
src/cmd/trace/trace.go