This commit is contained in:
jiazhizhong
2022-03-10 17:09:03 +08:00
commit 1279635d7f
97 changed files with 10632 additions and 0 deletions

20
pkg/pprof/pprof_posix.go Normal file
View File

@@ -0,0 +1,20 @@
// +build !windows
package pprof
import (
"os"
"os/signal"
"syscall"
)
func listenSignal() {
signChan := make(chan os.Signal, 1)
signal.Notify(signChan, syscall.SIGUSR1)
for {
<-signChan
profile()
memprofile()
cpuprofile()
}
}