aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mbarrier.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-02-09 13:58:48 -0500
committerRuss Cox <rsc@golang.org>2017-02-23 19:47:23 +0000
commitb788fd80e68addd181983ca589d28bc1075f4a36 (patch)
tree9a6ab7105b9bea137ac7f23e36fe3b6f2138acfd /src/runtime/mbarrier.go
parent9230ee20f3893814cbfb5e0bdc1a117b092eae35 (diff)
downloadgo-b788fd80e68addd181983ca589d28bc1075f4a36.tar.gz
go-b788fd80e68addd181983ca589d28bc1075f4a36.zip
runtime: new profile buffer implementation supporting label pointers
The existing CPU profiling buffer is a slice of uintptr, but we want to start including profiling label data in the profiles, and those labels need to be pointers in order to let them describe rich information. This CL implements a new profBuf type that holds both a slice of uint64 for data and a slice of unsafe.Pointer for profiling labels (aka tags). Making the runtime use these buffers will happen in followup CLs. Change-Id: I9ff16b532d8edaf4ce0cbba1098229a561834efc Reviewed-on: https://go-review.googlesource.com/36713 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/mbarrier.go')
-rw-r--r--src/runtime/mbarrier.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/mbarrier.go b/src/runtime/mbarrier.go
index 5848b43eb0..a437d83880 100644
--- a/src/runtime/mbarrier.go
+++ b/src/runtime/mbarrier.go
@@ -149,6 +149,11 @@ func gcmarkwb_m(slot *uintptr, ptr uintptr) {
// combine the read and the write. Checking inheap is
// insufficient since we need to track changes to
// roots outside the heap.
+ //
+ // Note: profbuf.go omits a barrier during signal handler
+ // profile logging; that's safe only because this deletion barrier exists.
+ // If we remove the deletion barrier, we'll have to work out
+ // a new way to handle the profile logging.
if slot1 := uintptr(unsafe.Pointer(slot)); slot1 >= minPhysPageSize {
if optr := *slot; optr != 0 {
shade(optr)