diff options
author | Fabricio Voznika <fvoznika@google.com> | 2019-03-11 11:46:18 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-03-11 11:47:30 -0700 |
commit | bc9b979b9412ad5852872c1a9bee462f73d2455e (patch) | |
tree | ca7fda751568879d4ef08aee53d3a8298e1faf55 /runsc/main.go | |
parent | 71d53382bfb3a6f05e90e31df8f39d22c0131040 (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/main.go')
-rw-r--r-- | runsc/main.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/runsc/main.go b/runsc/main.go index 4f89312b3..82c37ec11 100644 --- a/runsc/main.go +++ b/runsc/main.go @@ -63,6 +63,7 @@ var ( overlay = flag.Bool("overlay", false, "wrap filesystem mounts with writable overlay. All modifications are stored in memory inside the sandbox.") watchdogAction = flag.String("watchdog-action", "log", "sets what action the watchdog takes when triggered: log (default), panic.") panicSignal = flag.Int("panic-signal", -1, "register signal handling that panics. Usually set to SIGUSR2(12) to troubleshoot hangs. -1 disables it.") + profile = flag.Bool("profile", false, "prepares the sandbox to use Golang profiler. Note that enabling profiler loosens the seccomp protection added to the sandbox (DO NOT USE IN PRODUCTION).") testOnlyAllowRunAsCurrentUserWithoutChroot = flag.Bool("TESTONLY-unsafe-nonroot", false, "TEST ONLY; do not ever use! This skips many security measures that isolate the host from the sandbox.") ) @@ -146,6 +147,7 @@ func main() { StraceLogSize: *straceLogSize, WatchdogAction: wa, PanicSignal: *panicSignal, + ProfileEnable: *profile, TestOnlyAllowRunAsCurrentUserWithoutChroot: *testOnlyAllowRunAsCurrentUserWithoutChroot, } if len(*straceSyscalls) != 0 { |