Skip to content

Commit

Permalink
cmd/trace: display goroutines (with PC=0) with clearer description
Browse files Browse the repository at this point in the history
  • Loading branch information
hitzhangjie committed Aug 25, 2022
1 parent 8d57f4d commit 60a040a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cmd/trace/goroutines.go
Expand Up @@ -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 })
Expand Down

0 comments on commit 60a040a

Please sign in to comment.