From 4b536a550f1a9edd7be5c777dfb5eb906320eb89 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Fri, 28 Jun 2013 18:37:06 +0400 Subject: runtime: introduce GODEBUG env var Currently it replaces GOGCTRACE env var (GODEBUG=gctrace=1). The plan is to extend it with other type of debug tracing, e.g. GODEBUG=gctrace=1,schedtrace=100. R=rsc CC=bradfitz, daniel.morsing, gobot, golang-dev https://golang.org/cl/10026045 --- src/pkg/runtime/runtime.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/pkg/runtime/runtime.c') diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c index d62408118b..f59a3f4e80 100644 --- a/src/pkg/runtime/runtime.c +++ b/src/pkg/runtime/runtime.c @@ -365,3 +365,34 @@ runtime∕pprof·runtime_cyclesPerSecond(int64 res) res = runtime·tickspersecond(); FLUSH(&res); } + +DebugVars runtime·debug; + +static struct { + int8* name; + int32* value; +} dbgvar[] = { + {"gctrace", &runtime·debug.gctrace}, +}; + +void +runtime·parsedebugvars(void) +{ + byte *p; + int32 i, n; + + p = runtime·getenv("GODEBUG"); + if(p == nil) + return; + for(;;) { + for(i=0; i