diff options
Diffstat (limited to 'libgo/go/runtime/extern.go')
-rw-r--r-- | libgo/go/runtime/extern.go | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/libgo/go/runtime/extern.go b/libgo/go/runtime/extern.go index 6301d0173b2..eca54a75145 100644 --- a/libgo/go/runtime/extern.go +++ b/libgo/go/runtime/extern.go @@ -27,6 +27,13 @@ It is a comma-separated list of name=val pairs setting these named variables: allocfreetrace: setting allocfreetrace=1 causes every allocation to be profiled and a stack trace printed on each object's allocation and free. + cgocheck: setting cgocheck=0 disables all checks for packages + using cgo to incorrectly pass Go pointers to non-Go code. + Setting cgocheck=1 (the default) enables relatively cheap + checks that may miss some errors. Setting cgocheck=2 enables + expensive checks that should not miss any errors, but will + cause your program to run slower. + efence: setting efence=1 causes the allocator to run in a mode where each object is allocated on a unique page and addresses are never recycled. @@ -59,7 +66,7 @@ It is a comma-separated list of name=val pairs setting these named variables: length of the pause. Setting gctrace=2 emits the same summary but also repeats each collection. The format of this line is subject to change. Currently, it is: - gc # @#s #%: #+...+# ms clock, #+...+# ms cpu, #->#-># MB, # MB goal, # P + gc # @#s #%: #+#+# ms clock, #+#/#/#+# ms cpu, #->#-># MB, # MB goal, # P where the fields are as follows: gc # the GC number, incremented at each GC @#s time in seconds since program start @@ -68,9 +75,9 @@ It is a comma-separated list of name=val pairs setting these named variables: #->#-># MB heap size at GC start, at GC end, and live heap # MB goal goal heap size # P number of processors used - The phases are stop-the-world (STW) sweep termination, scan, - synchronize Ps, mark, and STW mark termination. The CPU times - for mark are broken down in to assist time (GC performed in + The phases are stop-the-world (STW) sweep termination, concurrent + mark and scan, and STW mark termination. The CPU times + for mark/scan are broken down in to assist time (GC performed in line with allocation), background GC time, and idle GC time. If the line ends with "(forced)", this GC was forced by a runtime.GC() call and all phases are STW. @@ -96,6 +103,9 @@ It is a comma-separated list of name=val pairs setting these named variables: schedtrace: setting schedtrace=X causes the scheduler to emit a single line to standard error every X milliseconds, summarizing the scheduler state. +The net and net/http packages also refer to debugging variables in GODEBUG. +See the documentation for those packages for details. + The GOMAXPROCS variable limits the number of operating system threads that can execute user-level Go code simultaneously. There is no limit to the number of threads that can be blocked in system calls on behalf of Go code; those do not count against @@ -104,15 +114,24 @@ the limit. The GOTRACEBACK variable controls the amount of output generated when a Go program fails due to an unrecovered panic or an unexpected runtime condition. -By default, a failure prints a stack trace for every extant goroutine, eliding functions -internal to the run-time system, and then exits with exit code 2. -If GOTRACEBACK=0, the per-goroutine stack traces are omitted entirely. -If GOTRACEBACK=1, the default behavior is used. -If GOTRACEBACK=2, the per-goroutine stack traces include run-time functions. -If GOTRACEBACK=crash, the per-goroutine stack traces include run-time functions, -and if possible the program crashes in an operating-specific manner instead of -exiting. For example, on Unix systems, the program raises SIGABRT to trigger a -core dump. +By default, a failure prints a stack trace for the current goroutine, +eliding functions internal to the run-time system, and then exits with exit code 2. +The failure prints stack traces for all goroutines if there is no current goroutine +or the failure is internal to the run-time. +GOTRACEBACK=none omits the goroutine stack traces entirely. +GOTRACEBACK=single (the default) behaves as described above. +GOTRACEBACK=all adds stack traces for all user-created goroutines. +GOTRACEBACK=system is like ``all'' but adds stack frames for run-time functions +and shows goroutines created internally by the run-time. +GOTRACEBACK=crash is like ``system'' but crashes in an operating system-specific +manner instead of exiting. For example, on Unix systems, the crash raises +SIGABRT to trigger a core dump. +For historical reasons, the GOTRACEBACK settings 0, 1, and 2 are synonyms for +none, all, and system, respectively. +The runtime/debug package's SetTraceback function allows increasing the +amount of output at run time, but it cannot reduce the amount below that +specified by the environment variable. +See https://golang.org/pkg/runtime/debug/#SetTraceback. The GOARCH, GOOS, GOPATH, and GOROOT environment variables complete the set of Go environment variables. They influence the building of Go programs |