summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/config.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2019-03-11 11:46:18 -0700
committerShentubot <shentubot@google.com>2019-03-11 11:47:30 -0700
commitbc9b979b9412ad5852872c1a9bee462f73d2455e (patch)
treeca7fda751568879d4ef08aee53d3a8298e1faf55 /runsc/boot/config.go
parent71d53382bfb3a6f05e90e31df8f39d22c0131040 (diff)
Add profiling commands to runsc
Example: runsc debug --root=<dir> \ --profile-heap=/tmp/heap.prof \ --profile-cpu=/tmp/cpu.prod --profile-delay=30 \ <container ID> PiperOrigin-RevId: 237848456 Change-Id: Icff3f20c1b157a84d0922599eaea327320dad773
Diffstat (limited to 'runsc/boot/config.go')
-rw-r--r--runsc/boot/config.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/runsc/boot/config.go b/runsc/boot/config.go
index 400203c99..626fcabdd 100644
--- a/runsc/boot/config.go
+++ b/runsc/boot/config.go
@@ -202,6 +202,9 @@ type Config struct {
// SIGUSR2(12) to troubleshoot hangs. -1 disables it.
PanicSignal int
+ // ProfileEnable is set to prepare the sandbox to be profiled.
+ ProfileEnable bool
+
// TestOnlyAllowRunAsCurrentUserWithoutChroot should only be used in
// tests. It allows runsc to start the sandbox process as the current
// user, and without chrooting the sandbox process. This can be
@@ -228,6 +231,7 @@ func (c *Config) ToFlags() []string {
"--strace-log-size=" + strconv.Itoa(int(c.StraceLogSize)),
"--watchdog-action=" + c.WatchdogAction.String(),
"--panic-signal=" + strconv.Itoa(c.PanicSignal),
+ "--profile=" + strconv.FormatBool(c.ProfileEnable),
}
if c.TestOnlyAllowRunAsCurrentUserWithoutChroot {
// Only include if set since it is never to be used by users.