runtime: replace system goroutine whitelist with symbol test

Currently isSystemGoroutine has a hard-coded list of known entry
points into system goroutines. This list is annoying to maintain. For
example, it's missing the ensureSigM goroutine.

Replace it with a check that simply looks for any goroutine with
runtime function as its entry point, with a few exceptions. This also
matches the definition recently added to the trace viewer (CL 81315).

Change-Id: Iaed723d4a6e8c2ffb7c0c48fbac1688b00b30f01
Reviewed-on: https://go-review.googlesource.com/81655
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Austin Clements 2017-12-01 16:13:08 -05:00
parent a8a050819b
commit 44286b17c5
5 changed files with 25 additions and 20 deletions

View file

@ -312,6 +312,8 @@ func (ctxt *Link) pclntab() {
// funcID uint32
funcID := objabi.FuncID_normal
switch s.Name {
case "runtime.main":
funcID = objabi.FuncID_runtime_main
case "runtime.goexit":
funcID = objabi.FuncID_goexit
case "runtime.jmpdefer":
@ -330,12 +332,6 @@ func (ctxt *Link) pclntab() {
funcID = objabi.FuncID_sigpanic
case "runtime.runfinq":
funcID = objabi.FuncID_runfinq
case "runtime.bgsweep":
funcID = objabi.FuncID_bgsweep
case "runtime.forcegchelper":
funcID = objabi.FuncID_forcegchelper
case "runtime.timerproc":
funcID = objabi.FuncID_timerproc
case "runtime.gcBgMarkWorker":
funcID = objabi.FuncID_gcBgMarkWorker
case "runtime.systemstack_switch":