summaryrefslogtreecommitdiff
path: root/src/cmd/8l
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-04-01 13:30:10 -0400
committerRuss Cox <rsc@golang.org>2014-04-01 13:30:10 -0400
commit0e00206e5a0cda367ba0d98286aa25d533f1c589 (patch)
treeecd0f8ff570f14b6cd9c25b7bafe1e6cb00745b3 /src/cmd/8l
parent1fa29d50005b434eb7baa82aaa24b3a050829889 (diff)
downloadgo-0e00206e5a0cda367ba0d98286aa25d533f1c589.tar.gz
runtime: adjust GODEBUG=allocfreetrace=1 and GODEBUG=gcdead=1
GODEBUG=allocfreetrace=1: The allocfreetrace=1 mode prints a stack trace for each block allocated and freed, and also a stack trace for each garbage collection. It was implemented by reusing the heap profiling support: if allocfreetrace=1 then the heap profile was effectively running at 1 sample per 1 byte allocated (always sample). The stack being shown at allocation was the stack gathered for profiling, meaning it was derived only from the program counters and did not include information about function arguments or frame pointers. The stack being shown at free was the allocation stack, not the free stack. If you are generating this log, you can find the allocation stack yourself, but it can be useful to see exactly the sequence that led to freeing the block: was it the garbage collector or an explicit free? Now that the garbage collector runs on an m0 stack, the stack trace for the garbage collector was never interesting. Fix all these problems: 1. Decouple allocfreetrace=1 from heap profiling. 2. Print the standard goroutine stack traces instead of a custom format. 3. Print the stack trace at time of allocation for an allocation, and print the stack trace at time of free (not the allocation trace again) for a free. 4. Print all goroutine stacks at garbage collection. Having all the stacks means that you can see the exact point at which each goroutine was preempted, which is often useful for identifying liveness-related errors. GODEBUG=gcdead=1: This mode overwrites dead pointers with a poison value. Detect the poison value as an invalid pointer during collection, the same way that small integers are invalid pointers. LGTM=khr R=khr CC=golang-codereviews https://codereview.appspot.com/81670043
Diffstat (limited to 'src/cmd/8l')
0 files changed, 0 insertions, 0 deletions