Commit aff33660f5 for golang
commit aff33660f57b7eb2ab80a91b2224b5c2c87882b3
Author: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com>
Date: Fri Dec 4 07:30:37 2026 +0100
runtime/pprof: rename procmem sample type from memory_space to procmem_space
Match the renamed procmem profile type so the sample type name is
consistent with the profile name and unambiguous in pprof output and
external tooling.
For #83336
Change-Id: I0664e0afe6c5e82a3b97fe51fa651aa594dc1dfc
Reviewed-on: https://go-review.googlesource.com/c/go/+/869982
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Nick Ripley <nick.ripley@datadoghq.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
diff --git a/src/runtime/pprof/memory.go b/src/runtime/pprof/memory.go
index fbd491c936..4056b5ae8d 100644
--- a/src/runtime/pprof/memory.go
+++ b/src/runtime/pprof/memory.go
@@ -100,7 +100,7 @@ func writeProcmemProto(w io.Writer, p []profilerecord.MemProfileRecord, rate int
b := newProfileBuilder(w)
b.pbValueType(tagProfile_PeriodType, "space", "bytes")
b.pb.int64Opt(tagProfile_Period, 1)
- b.pbValueType(tagProfile_SampleType, "memory_space", "bytes")
+ b.pbValueType(tagProfile_SampleType, "procmem_space", "bytes")
type heapWeights struct {
live, dead int64
diff --git a/src/runtime/pprof/memory_test.go b/src/runtime/pprof/memory_test.go
index 1cc2199396..761a297f1c 100644
--- a/src/runtime/pprof/memory_test.go
+++ b/src/runtime/pprof/memory_test.go
@@ -81,8 +81,8 @@ func TestProcmemProfileStructure(t *testing.T) {
if len(p.SampleType) != 1 {
t.Fatalf("got %d sample types, want 1", len(p.SampleType))
}
- if st := p.SampleType[0]; st.Type != "memory_space" || st.Unit != "bytes" {
- t.Fatalf("sample type = {%q, %q}, want {memory_space, bytes}", st.Type, st.Unit)
+ if st := p.SampleType[0]; st.Type != "procmem_space" || st.Unit != "bytes" {
+ t.Fatalf("sample type = {%q, %q}, want {procmem_space, bytes}", st.Type, st.Unit)
}
if pt := p.PeriodType; pt.Type != "space" || pt.Unit != "bytes" {
t.Fatalf("period type = {%q, %q}, want {space, bytes}", pt.Type, pt.Unit)