mirror of
https://github.com/safing/portbase
synced 2025-09-01 18:19:57 +00:00
Switch debug output to different format
This commit is contained in:
parent
7e9c2f49f0
commit
e2d0b39ecb
1 changed files with 5 additions and 5 deletions
10
run/main.go
10
run/main.go
|
@ -62,7 +62,7 @@ signalLoop:
|
|||
case sig := <-signalCh:
|
||||
// only print and continue to wait if SIGUSR1
|
||||
if sig == sigUSR1 {
|
||||
_ = pprof.Lookup("goroutine").WriteTo(os.Stderr, 2)
|
||||
_ = pprof.Lookup("goroutine").WriteTo(os.Stderr, 1)
|
||||
continue signalLoop
|
||||
}
|
||||
|
||||
|
@ -80,18 +80,18 @@ signalLoop:
|
|||
if printStackOnExit {
|
||||
fmt.Println("=== PRINTING TRACES ===")
|
||||
fmt.Println("=== GOROUTINES ===")
|
||||
_ = pprof.Lookup("goroutine").WriteTo(os.Stdout, 2)
|
||||
_ = pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)
|
||||
fmt.Println("=== BLOCKING ===")
|
||||
_ = pprof.Lookup("block").WriteTo(os.Stdout, 2)
|
||||
_ = pprof.Lookup("block").WriteTo(os.Stdout, 1)
|
||||
fmt.Println("=== MUTEXES ===")
|
||||
_ = pprof.Lookup("mutex").WriteTo(os.Stdout, 2)
|
||||
_ = pprof.Lookup("mutex").WriteTo(os.Stdout, 1)
|
||||
fmt.Println("=== END TRACES ===")
|
||||
}
|
||||
|
||||
go func() {
|
||||
time.Sleep(60 * time.Second)
|
||||
fmt.Fprintln(os.Stderr, "===== TAKING TOO LONG FOR SHUTDOWN - PRINTING STACK TRACES =====")
|
||||
_ = pprof.Lookup("goroutine").WriteTo(os.Stderr, 2)
|
||||
_ = pprof.Lookup("goroutine").WriteTo(os.Stderr, 1)
|
||||
os.Exit(1)
|
||||
}()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue