mirror of
https://github.com/golang/go
synced 2024-11-16 22:14:45 -07:00
cmd/trace: display goroutines (with PC=0) with clearer description
This commit is contained in:
parent
8d57f4dcef
commit
60a040aa2f
@ -64,6 +64,11 @@ func httpGoroutines(w http.ResponseWriter, r *http.Request) {
|
||||
var glist []gtype
|
||||
for k, v := range gss {
|
||||
v.ID = k
|
||||
// If goroutine didn't run during the trace (no sampled PC),
|
||||
// the v.ID and v.Name will be zero value.
|
||||
if v.ID == 0 && v.Name == "" {
|
||||
v.Name = "(Inactive, no stack trace sampled)"
|
||||
}
|
||||
glist = append(glist, v)
|
||||
}
|
||||
sort.Slice(glist, func(i, j int) bool { return glist[i].ExecTime > glist[j].ExecTime })
|
||||
|
Loading…
Reference in New Issue
Block a user