You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmd/trace: add almost full support for v2 traces in the trace viewer
This change refactors the cmd/trace package and adds most of the support
for v2 traces.
The following features of note are missing in this CL and will be
implemented in follow-up CLs:
- The focustask filter for the trace viewer
- The taskid filter for the trace viewer
- The goid filter for the trace viewer
- Pprof profiles
- The MMU graph
- The goroutine analysis pages
- The task analysis pages
- The region analysis pages
This CL makes one notable change to the trace CLI: it makes the -d flag
accept an integer to set the debug mode. For old traces -d != 0 works
just like -d. For new traces -d=1 means the high-level events and -d=2
means the low-level events.
Thanks to Felix Geisendörfer ([email protected]) for
doing a lot of work on this CL; I picked this up from him and got a
massive headstart as a result.
For #60773.
For #63960.
Change-Id: I3626e22473227c5980134a85f1bb6a845f567b1b
Reviewed-on: https://go-review.googlesource.com/c/go/+/542218
Reviewed-by: Michael Pratt <[email protected]>
Auto-Submit: Michael Knyszek <[email protected]>
TryBot-Bypass: Michael Knyszek <[email protected]>
This view displays a timeline for each of the GOMAXPROCS logical
231
-
processors, showing which goroutine (if any) was running on that
232
-
logical processor at each moment.
233
-
234
-
Each goroutine has an identifying number (e.g. G123), main function,
235
-
and color.
236
-
237
-
A colored bar represents an uninterrupted span of execution.
238
-
239
-
Execution of a goroutine may migrate from one logical processor to another,
240
-
causing a single colored bar to be horizontally continuous but
241
-
vertically displaced.
242
-
</p>
243
-
<p>
244
-
Clicking on a span reveals information about it, such as its
245
-
duration, its causal predecessors and successors, and the stack trace
246
-
at the final moment when it yielded the logical processor, for example
247
-
because it made a system call or tried to acquire a mutex.
248
-
249
-
Directly underneath each bar, a smaller bar or more commonly a fine
250
-
vertical line indicates an event occurring during its execution.
251
-
Some of these are related to garbage collection; most indicate that
252
-
a goroutine yielded its logical processor but then immediately resumed execution
253
-
on the same logical processor. Clicking on the event displays the stack trace
254
-
at the moment it occurred.
255
-
</p>
256
-
<p>
257
-
The causal relationships between spans of goroutine execution
258
-
can be displayed by clicking the Flow Events button at the top.
259
-
</p>
260
-
<p>
261
-
At the top ("STATS"), there are three additional timelines that
262
-
display statistical information.
263
-
264
-
"Goroutines" is a time series of the count of existing goroutines;
265
-
clicking on it displays their breakdown by state at that moment:
266
-
running, runnable, or waiting.
267
-
268
-
"Heap" is a time series of the amount of heap memory allocated (in orange)
269
-
and (in green) the allocation limit at which the next GC cycle will begin.
270
-
271
-
"Threads" shows the number of kernel threads in existence: there is
272
-
always one kernel thread per logical processor, and additional threads
273
-
are created for calls to non-Go code such as a system call or a
274
-
function written in C.
275
-
</p>
276
-
<p>
277
-
Above the event trace for the first logical processor are
278
-
traces for various runtime-internal events.
279
-
280
-
The "GC" bar shows when the garbage collector is running, and in which stage.
281
-
Garbage collection may temporarily affect all the logical processors
282
-
and the other metrics.
283
-
284
-
The "Network", "Timers", and "Syscalls" traces indicate events in
285
-
the runtime that cause goroutines to wake up.
286
-
</p>
287
-
<p>
288
-
The visualization allows you to navigate events at scales ranging from several
289
-
seconds to a handful of nanoseconds.
290
-
291
-
Consult the documentation for the Chromium <a href='https://www.chromium.org/developers/how-tos/trace-event-profiling-tool/'>Trace Event Profiling Tool<a/>
0 commit comments