[go] cmd/link: don't disable memory profiling when pprof.WriteHeapProfile is used

1 view
Skip to first unread message

Cherry Mui (Gerrit)

unread,
2:36 PM (7 hours ago) 2:36 PM
to goph...@pubsubhelper.golang.org, Than McIntosh, Austin Clements, Go LUCI, golang-co...@googlegroups.com
Attention needed from Austin Clements and Than McIntosh

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Austin Clements
  • Than McIntosh
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I075c8d45c95c81825a1822f032e23107aea4303c
Gerrit-Change-Number: 596538
Gerrit-PatchSet: 1
Gerrit-Owner: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Than McIntosh <th...@google.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Than McIntosh <th...@google.com>
Gerrit-Comment-Date: Wed, 03 Jul 2024 18:36:28 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
unsatisfied_requirement
satisfied_requirement
open
diffy

Than McIntosh (Gerrit)

unread,
6:24 PM (3 hours ago) 6:24 PM
to Cherry Mui, goph...@pubsubhelper.golang.org, Than McIntosh, Go LUCI, Austin Clements, golang-co...@googlegroups.com
Attention needed from Austin Clements and Cherry Mui

Than McIntosh voted and added 1 comment

Votes added by Than McIntosh

Code-Review+2

1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Than McIntosh . resolved

LGTM

Open in Gerrit

Related details

Attention is currently required from:
  • Austin Clements
  • Cherry Mui
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I075c8d45c95c81825a1822f032e23107aea4303c
Gerrit-Change-Number: 596538
Gerrit-PatchSet: 1
Gerrit-Owner: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Than McIntosh <th...@google.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Cherry Mui <cher...@google.com>
Gerrit-Comment-Date: Wed, 03 Jul 2024 22:24:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Cherry Mui (Gerrit)

unread,
6:43 PM (3 hours ago) 6:43 PM
to goph...@pubsubhelper.golang.org, Than McIntosh, Go LUCI, Austin Clements, golang-co...@googlegroups.com
Attention needed from Austin Clements

Cherry Mui added 1 comment

Patchset-level comments
Cherry Mui . resolved

Thanks.

Open in Gerrit

Related details

Attention is currently required from:
  • Austin Clements
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I075c8d45c95c81825a1822f032e23107aea4303c
Gerrit-Change-Number: 596538
Gerrit-PatchSet: 1
Gerrit-Owner: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Than McIntosh <th...@google.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Comment-Date: Wed, 03 Jul 2024 22:43:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
open
diffy

Cherry Mui (Gerrit)

unread,
6:43 PM (3 hours ago) 6:43 PM
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Than McIntosh, Go LUCI, Austin Clements, golang-co...@googlegroups.com

Cherry Mui submitted the change

Change information

Commit message:
cmd/link: don't disable memory profiling when pprof.WriteHeapProfile is used

We have an optimization that if the memory profile is not consumed
anywhere, we set the memory profiling rate to 0 to disable the
"background" low-rate profiling. We detect whether the memory
profile is used by checking whether the runtime.MemProfile function
is reachable at link time. Previously, all APIs that access the
memory profile go through runtime.MemProfile. But the code was
refactored in CL 572396, and now the legacy entry point
WriteHeapProfile uses pprof_memProfileInternal without going
through runtime.MemProfile. In fact, even with the recommended
runtime/pprof.Profile API (pprof.Lookup or pprof.Profiles),
runtime.MemProfile is only (happen to be) reachable through
countHeap.

Change the linker to check runtime.memProfileInternal instead,
which is on all code paths that retrieve the memory profile. Add
a test case for WriteHeapProfile, so we cover all entry points.

Fixes #68136.
Change-Id: I075c8d45c95c81825a1822f032e23107aea4303c
Reviewed-by: Than McIntosh <th...@google.com>
Files:
  • M src/cmd/link/internal/ld/ld_test.go
  • M src/cmd/link/internal/ld/lib.go
  • M src/runtime/mprof.go
  • M src/runtime/pprof/pprof.go
Change size: S
Delta: 4 files changed, 41 insertions(+), 5 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Than McIntosh
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I075c8d45c95c81825a1822f032e23107aea4303c
Gerrit-Change-Number: 596538
Gerrit-PatchSet: 2
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages