diff options
author | Fabricio Voznika <fvoznika@google.com> | 2018-06-20 13:30:39 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-20 13:31:31 -0700 |
commit | 4ad7315b6759afa81f492ec119080deb9a224101 (patch) | |
tree | 0f1e4c51b199301023f0269855013e020cc54ea2 /runsc/boot/debug.go | |
parent | 5aa7615ec93335a922361728881ab1224a6e9266 (diff) |
Add 'runsc debug' command
It prints sandbox stacks to the log to help debug stuckness. I expect
that many more options will be added in the future.
PiperOrigin-RevId: 201405931
Change-Id: I87e560800cd5a5a7b210dc25a5661363c8c3a16e
Diffstat (limited to 'runsc/boot/debug.go')
-rw-r--r-- | runsc/boot/debug.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/runsc/boot/debug.go b/runsc/boot/debug.go new file mode 100644 index 000000000..971962c91 --- /dev/null +++ b/runsc/boot/debug.go @@ -0,0 +1,29 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package boot + +import ( + "gvisor.googlesource.com/gvisor/pkg/log" +) + +type debug struct { +} + +// Stacks collects all sandbox stacks and copies them to 'stacks'. +func (*debug) Stacks(_ *struct{}, stacks *string) error { + buf := log.Stacks(true) + *stacks = string(buf) + return nil +} |