From c5c5270dd0327ef883502d4e7361d29cb40a1fa0 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 27 Apr 2018 11:24:04 -0700 Subject: [PATCH] cmd/pk-mount: in debug mode, dump stacks on SIGQUIT Change-Id: I70737247bf29063a7061c330960b7657213266cb --- cmd/pk-mount/pkmount.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/pk-mount/pkmount.go b/cmd/pk-mount/pkmount.go index 7c3cc8c37..96b334927 100644 --- a/cmd/pk-mount/pkmount.go +++ b/cmd/pk-mount/pkmount.go @@ -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 }