diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-17 16:54:25 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-17 16:54:25 +0000 |
commit | 5fd1e54195e3f287e6c199656de1eaa481f015f0 (patch) | |
tree | 99f8a824655109bd2cd36ab0a8502e2fd713101a /libgo/runtime/mgc0.c | |
parent | c258c00465c6188b1df0518a241b2c7f84d572f1 (diff) | |
download | gcc-5fd1e54195e3f287e6c199656de1eaa481f015f0.tar.gz |
runtime: copy rdebug code from Go 1.7 runtime
While we're at it, update the runtime/debug package, and start running
its testsuite by default. I'm not sure why runtime/debug was not
previously updated to 1.7. Doing that led me to fix some minor aspects
of runtime.Stack and the C function runtime/debug.readGCStats.
Reviewed-on: https://go-review.googlesource.com/31251
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241261 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/runtime/mgc0.c')
-rw-r--r-- | libgo/runtime/mgc0.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libgo/runtime/mgc0.c b/libgo/runtime/mgc0.c index 0b96696ee42..84353c771ab 100644 --- a/libgo/runtime/mgc0.c +++ b/libgo/runtime/mgc0.c @@ -2392,14 +2392,16 @@ runtime_debug_readGCStats(Slice *pauses) // pause_ns[(numgc-1)%nelem(pause_ns)], and then backward // from there to go back farther in time. We deliver the times // most recent first (in p[0]). - for(i=0; i<n; i++) + for(i=0; i<n; i++) { p[i] = pmstats->pause_ns[(pmstats->numgc-1-i)%nelem(pmstats->pause_ns)]; + p[n+i] = pmstats->pause_end[(pmstats->numgc-1-i)%nelem(pmstats->pause_ns)]; + } - p[n] = pmstats->last_gc; - p[n+1] = pmstats->numgc; - p[n+2] = pmstats->pause_total_ns; + p[n+n] = pmstats->last_gc; + p[n+n+1] = pmstats->numgc; + p[n+n+2] = pmstats->pause_total_ns; runtime_unlock(&runtime_mheap); - pauses->__count = n+3; + pauses->__count = n+n+3; } int32 |