Merge "Set GODEBUG=asyncpreemptoff=1 for soong_build."
This commit is contained in:
commit
1a1ec4b59c
1 changed files with 18 additions and 1 deletions
|
@ -124,10 +124,27 @@ var (
|
||||||
// better to not to touch that while Blueprint and Soong are separate
|
// better to not to touch that while Blueprint and Soong are separate
|
||||||
// NOTE: The spaces at EOL are important because otherwise Ninja would
|
// NOTE: The spaces at EOL are important because otherwise Ninja would
|
||||||
// omit all spaces between the different options.
|
// omit all spaces between the different options.
|
||||||
|
|
||||||
|
// GODEBUG=asyncpreemptoff=1 disables the preemption of goroutines. This
|
||||||
|
// is useful because the preemption happens by sending SIGURG to the OS
|
||||||
|
// thread hosting the goroutine in question and each signal results in
|
||||||
|
// work that needs to be done by Delve; it uses ptrace to debug the Go
|
||||||
|
// process and the tracer process must deal with every signal (it is not
|
||||||
|
// possible to selectively ignore SIGURG). This makes debugging slower,
|
||||||
|
// sometimes by an order of magnitude depending on luck.
|
||||||
|
//
|
||||||
|
// According to measurements, this does not result in any performance loss
|
||||||
|
// (or gain), but if it becomes necessary for some reason, it should be
|
||||||
|
// possible to set asyncpreemptoff=1 only if debugging is enabled by
|
||||||
|
// plumbing that information through PrimaryBuilderInvocation just like
|
||||||
|
// --delve_path and --delve_listen.
|
||||||
|
//
|
||||||
|
// The original reason for adding async preemption to Go is here:
|
||||||
|
// https://github.com/golang/proposal/blob/master/design/24543-non-cooperative-preemption.md
|
||||||
Command: `cd "$$(dirname "$builder")" && ` +
|
Command: `cd "$$(dirname "$builder")" && ` +
|
||||||
`BUILDER="$$PWD/$$(basename "$builder")" && ` +
|
`BUILDER="$$PWD/$$(basename "$builder")" && ` +
|
||||||
`cd / && ` +
|
`cd / && ` +
|
||||||
`env -i "$$BUILDER" ` +
|
`env -i GODEBUG=asyncpreemptoff=1 "$$BUILDER" ` +
|
||||||
` --top "$$TOP" ` +
|
` --top "$$TOP" ` +
|
||||||
` --soong_out "$soongOutDir" ` +
|
` --soong_out "$soongOutDir" ` +
|
||||||
` --out "$outDir" ` +
|
` --out "$outDir" ` +
|
||||||
|
|
Loading…
Reference in a new issue