Skip to content

Commit

Permalink
Merge pull request #50 from yousong/feature/yousong-signalutils
Browse files Browse the repository at this point in the history
signalutils: add platform specific SetDumpStackSignal()
  • Loading branch information
yunion-ci-robot committed Feb 27, 2020
2 parents f129027 + 50b9e1c commit b0738bd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions util/signalutils/dumpstack_others.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// +build !windows

package signalutils

import (
"syscall"

"yunion.io/x/log"
"yunion.io/x/pkg/utils"
)

func SetDumpStackSignal() {
RegisterSignal(func() {
utils.DumpAllGoroutineStack(log.Logger().Out)
}, syscall.SIGUSR1)
}
4 changes: 4 additions & 0 deletions util/signalutils/dumpstack_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package signalutils

func SetDumpStackSignal() {
}

0 comments on commit b0738bd

Please sign in to comment.