mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
internal/debug: simplify stacks handler
This commit is contained in:
parent
d5868b684b
commit
205b26bf13
1 changed files with 1 additions and 6 deletions
|
|
@ -21,6 +21,7 @@
|
|||
package debug
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
|
|
@ -33,8 +34,6 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"bufio"
|
||||
"bytes"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
)
|
||||
|
||||
|
|
@ -193,11 +192,7 @@ func (*HandlerT) WriteMemProfile(file string) error {
|
|||
// Stacks returns a printed representation of the stacks of all goroutines.
|
||||
func (*HandlerT) Stacks() string {
|
||||
var b bytes.Buffer
|
||||
b.Grow(1024 * 1024)
|
||||
w := bufio.NewWriter(&b)
|
||||
pprof.Lookup("goroutine").WriteTo(w, 2)
|
||||
w.Flush()
|
||||
|
||||
return b.String()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue