]> Cypherpunks repositories - gostls13.git/commit
runtime: fix missing pprof labels
authorFelix Geisendörfer <felix.geisendoerfer@datadoghq.com>
Mon, 20 Sep 2021 14:09:47 +0000 (16:09 +0200)
committerMichael Pratt <mpratt@google.com>
Tue, 2 Nov 2021 15:15:09 +0000 (15:15 +0000)
commitda7173a2ed637c803b8ff59d0c948e7c7d056c50
treecf43b024f8f2a587b6351a409e8410cefd30c837
parent4d7bf41bebc7ad4f71150b8b57fca12aff6da144
runtime: fix missing pprof labels

Use gp.m.curg instead of the gp when recording cpu profiler stack
traces. This ensures profiler labels are captured when systemstack or similar
is executing on behalf of the current goroutine.

After this there are still rare cases of samples containing the labelHog
function, so more work might be needed. This patch should fix ~99% of the
problem.

Fixes #48577.

Change-Id: I27132110e3d09721ec3b3ef417122bc70d8f3279
Reviewed-on: https://go-review.googlesource.com/c/go/+/351751
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Michael Knyszek <mknyszek@google.com>
src/runtime/cpuprof.go
src/runtime/pprof/pprof_test.go
src/runtime/proc.go