BucketHeader prints the header of a goroutine signature.
(b *stack.Bucket, pf pathFormat, multipleBuckets bool)
| 160 | |
| 161 | // BucketHeader prints the header of a goroutine signature. |
| 162 | func (p *Palette) BucketHeader(b *stack.Bucket, pf pathFormat, multipleBuckets bool) string { |
| 163 | extra := "" |
| 164 | if s := b.SleepString(); s != "" { |
| 165 | extra += " [" + s + "]" |
| 166 | } |
| 167 | if b.Locked { |
| 168 | extra += " [locked]" |
| 169 | } |
| 170 | if c := pf.createdByString(&b.Signature); c != "" { |
| 171 | extra += p.CreatedBy + " [Created by " + c + "]" |
| 172 | } |
| 173 | return fmt.Sprintf( |
| 174 | "%s%d: %s%s%s\n", |
| 175 | p.routineColor(b.First, multipleBuckets), len(b.IDs), |
| 176 | b.State, extra, |
| 177 | p.EOLReset) |
| 178 | } |
| 179 | |
| 180 | // GoroutineHeader prints the header of a goroutine. |
| 181 | func (p *Palette) GoroutineHeader(g *stack.Goroutine, pf pathFormat, multipleGoroutines bool) string { |