aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/runtime.c
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2013-08-14 00:30:55 +0400
committerDmitriy Vyukov <dvyukov@google.com>2013-08-14 00:30:55 +0400
commit4f2e382c9fb646e6f34bb0d7c4fa1a0a963a3b54 (patch)
treea02df15c853a20184b79a0da43759e07664f1bb4 /src/pkg/runtime/runtime.c
parent2642c6e24dd3d935d01270a0fa0a89de3d3dae69 (diff)
downloadgo-4f2e382c9fb646e6f34bb0d7c4fa1a0a963a3b54.tar.xz
runtime: dump scheduler state if GODEBUG=schedtrace is set
The schedtrace value sets dump period in milliseconds. In default mode the trace looks as follows: SCHED 0ms: gomaxprocs=4 idleprocs=0 threads=3 idlethreads=0 runqueue=0 [1 0 0 0] SCHED 1001ms: gomaxprocs=4 idleprocs=3 threads=6 idlethreads=3 runqueue=0 [0 0 0 0] SCHED 2008ms: gomaxprocs=4 idleprocs=1 threads=6 idlethreads=1 runqueue=0 [0 1 0 0] If GODEBUG=scheddetail=1 is set as well, then the detailed trace is printed: SCHED 0ms: gomaxprocs=4 idleprocs=0 threads=3 idlethreads=0 runqueue=0 singleproc=0 gcwaiting=1 mlocked=0 nmspinning=0 stopwait=0 sysmonwait=0 P0: status=3 tick=1 m=0 runqsize=1/128 gfreecnt=0 P1: status=3 tick=0 m=-1 runqsize=0/128 gfreecnt=0 P2: status=3 tick=0 m=-1 runqsize=0/128 gfreecnt=0 P3: status=3 tick=0 m=-1 runqsize=0/128 gfreecnt=0 M2: p=-1 curg=-1 mallocing=0 throwing=0 gcing=0 locks=1 dying=0 helpgc=0 spinning=0 lockedg=-1 M1: p=-1 curg=-1 mallocing=0 throwing=0 gcing=0 locks=1 dying=0 helpgc=0 spinning=0 lockedg=-1 M0: p=0 curg=1 mallocing=0 throwing=0 gcing=0 locks=1 dying=0 helpgc=0 spinning=0 lockedg=1 G1: status=2() m=0 lockedm=0 G2: status=1() m=-1 lockedm=-1 R=golang-dev, raggi, rsc CC=golang-dev https://golang.org/cl/11435044
Diffstat (limited to 'src/pkg/runtime/runtime.c')
-rw-r--r--src/pkg/runtime/runtime.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c
index 39bd9332e1..ab9fed805f 100644
--- a/src/pkg/runtime/runtime.c
+++ b/src/pkg/runtime/runtime.c
@@ -388,6 +388,8 @@ static struct {
int32* value;
} dbgvar[] = {
{"gctrace", &runtime·debug.gctrace},
+ {"schedtrace", &runtime·debug.schedtrace},
+ {"scheddetail", &runtime·debug.scheddetail},
};
void