aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime2.go
diff options
context:
space:
mode:
authorMichael Knyszek <mknyszek@google.com>2022-10-19 14:51:15 -0400
committerMichael Knyszek <mknyszek@google.com>2022-11-18 03:45:30 +0000
commite4435cb8448514d2413f9d9aa3ee40738d26fd67 (patch)
treea4ada76626bb11adbe2b48ddd88ace8cb8304816 /src/runtime/runtime2.go
parent0613418c9865bb3fb04e26822f3d4f4a317a2540 (diff)
downloadgo-e4435cb8448514d2413f9d9aa3ee40738d26fd67.tar.xz
runtime: add page tracer
This change adds a new GODEBUG flag called pagetrace that writes a low-overhead trace of how pages of memory are managed by the Go runtime. The page tracer is kept behind a GOEXPERIMENT flag due to a potential security risk for setuid binaries. Change-Id: I6f4a2447d02693c25214400846a5d2832ad6e5c0 Reviewed-on: https://go-review.googlesource.com/c/go/+/444157 Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r--src/runtime/runtime2.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index ceb6ff66e2..9381d1e3f7 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -754,6 +754,11 @@ type p struct {
// scheduler ASAP (regardless of what G is running on it).
preempt bool
+ // pageTraceBuf is a buffer for writing out page allocation/free/scavenge traces.
+ //
+ // Used only if GOEXPERIMENT=pagetrace.
+ pageTraceBuf pageTraceBuf
+
// Padding is no longer needed. False sharing is now not a worry because p is large enough
// that its size class is an integer multiple of the cache line size (for any of our architectures).
}