]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: add CPU samples to execution trace
authorRhys Hiltner <rhys@justin.tv>
Mon, 18 Apr 2022 19:32:37 +0000 (12:32 -0700)
committerMichael Knyszek <mknyszek@google.com>
Tue, 3 May 2022 20:49:46 +0000 (20:49 +0000)
commit2c0a9884e0dc930c1a3596bc1decf183c8fdcf77
tree33fedac2be0e9e3b8de4cb652d833a84b7889328
parent52bd1c4d6cc691aa60c71513695dba03062deb59
runtime: add CPU samples to execution trace

When the CPU profiler and execution tracer are both active, report the
CPU profile samples in the execution trace data stream.

Include only samples that arrive on the threads known to the runtime,
but include them even when running g0 (such as near the scheduler) or if
there's no P (such as near syscalls).

Render them in "go tool trace" as instantaneous events.

For #16895

Change-Id: I0aa501a7b450c971e510961c0290838729033f7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/400795
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Rhys Hiltner <rhys@justin.tv>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/trace/trace.go
src/internal/trace/order.go
src/internal/trace/parser.go
src/runtime/cpuprof.go
src/runtime/proc.go
src/runtime/trace.go
src/runtime/trace/trace.go
src/runtime/trace/trace_test.go