cmd/pk-mount: in debug mode, dump stacks on SIGQUIT

Change-Id: I70737247bf29063a7061c330960b7657213266cb
This commit is contained in:
Brad Fitzpatrick 2018-04-27 11:24:04 -07:00
parent f636f75b75
commit c5c5270dd0
1 changed files with 5 additions and 0 deletions

View File

@ -256,6 +256,11 @@ func awaitQuitKey(done chan<- bool) {
return
}
if buf[0] == 'q' {
if *debug {
stacks := make([]byte, 1<<20)
stacks = stacks[:runtime.Stack(stacks, true)]
os.Stderr.Write(stacks)
}
done <- true
return
}