runtime: speed up StartTrace with lots of blocked goroutines
runtime: speed up StartTrace with lots of blocked goroutines

In StartTrace we emit EvGoCreate for all existing goroutines.
This includes stack unwind to obtain current stack.
Real Go programs can contain hundreds of thousands of blocked goroutines.
For such programs StartTrace can take up to a second (few ms per goroutine).

Obtain current stack ID once and use it for all EvGoCreate events.

This speeds up StartTrace with 10K blocked goroutines from 20ms to 4 ms
(win for StartTrace called from net/http/pprof hander will be bigger
as stack is deeper).

Change-Id: I9e5ff9468331a840f8fdcdd56c5018c2cfde61fc
Reviewed-on: https://go-review.googlesource.com/25573
Run-TryBot: Dmitry Vyukov <05e8181be3150e47da8fe2e1f18d381c75496ff4@google.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <d7e82c3c07f92613bcbf9a1e88f6b96c13caa3b0@gmail.com>

golang/go,cloudflare/go,derekmarcotte/go,christopher-henderson/Go,akutz/go,derekmarcotte/go,derekmarcotte/go,nawawi/go,golang/go,ImJasonH/go,goodlang/good,suncycheng/go,linux-on-ibm-z/go,josharian/go,vsekhar/elastic-go,goodlang/good,linux-on-ibm-z/go,vsekhar/elastic-go,codestation/go,codestation/go,linux-on-ibm-z/go,nawawi/go,akutz/go,Cofyc/go,akutz/go,suncycheng/go,ImJasonH/go,Cofyc/go,josharian/go,codestation/go,cloudflare/go,josharian/go,ImJasonH/go,cloudflare/go,nawawi/go,Cofyc/go,goodlang/good,CAFxX/go,Cofyc/go,ImJasonH/go,vsekhar/elastic-go,linux-on-ibm-z/go,golang/go,derekmarcotte/go,cloudflare/go,nawawi/go,polyverse-security/go,vsekhar/elastic-go,CAFxX/go,golang/go,akutz/go,suncycheng/go,linux-on-ibm-z/go,Cofyc/go,momchil-velikov/go,nawawi/go,golang/go,golang/go,codestation/go,cloudflare/go,momchil-velikov/go,linux-on-ibm-z/go,nawawi/go,CAFxX/go,josharian/go,Cofyc/go,josharian/go,CAFxX/go,josharian/go,golang/go,cloudflare/go,vsekhar/elastic-go,vsekhar/elastic-go,suncycheng/go,ImJasonH/go,polyverse-security/go,goodlang/good,derekmarcotte/go,cloudflare/go,akutz/go,goodlang/good,momchil-velikov/go,momchil-velikov/go,derekmarcotte/go,goodlang/good,akutz/go,polyverse-security/go,derekmarcotte/go,codestation/go,akutz/go,suncycheng/go,polyverse-security/go,ImJasonH/go,polyverse-security/go,Cofyc/go,CAFxX/go,josharian/go,derekmarcotte/go,polyverse-security/go,golang/go,codestation/go,suncycheng/go,ImJasonH/go,momchil-velikov/go,CAFxX/go,Cofyc/go,suncycheng/go,akutz/go,nawawi/go,cloudflare/go,polyverse-security/go,goodlang/good,momchil-velikov/go,suncycheng/go,codestation/go,linux-on-ibm-z/go,vsekhar/elastic-go,momchil-velikov/go,ImJasonH/go,nawawi/go,linux-on-ibm-z/go,vsekhar/elastic-go,momchil-velikov/go,polyverse-security/go,CAFxX/go,goodlang/good,CAFxX/go,codestation/go,josharian/go