Enable collection of go traces during benchmarks.

PiperOrigin-RevId: 601548685
This commit is contained in:
Lucas Manning
2024-01-25 13:33:56 -08:00
committed by gVisor bot
parent d788c40b19
commit 8d37113049
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -56,6 +56,7 @@ var (
pprofCPU = flag.Bool("pprof-cpu", false, "enables CPU profiling with runsc debug")
pprofHeap = flag.Bool("pprof-heap", false, "enables heap profiling with runsc debug")
pprofMutex = flag.Bool("pprof-mutex", false, "enables mutex profiling with runsc debug")
trace = flag.Bool("go-trace", false, "enables collecting a go trace with runsc debug")
// This matches the string "native.cgroupdriver=systemd" (including optional
// whitespace), which can be found in a docker daemon configuration file's
+3
View File
@@ -92,6 +92,9 @@ func (p *profile) createProcess(c *Container) error {
outputPath := filepath.Join(p.BasePath, fmt.Sprintf("%s.pprof", profileArg))
args = append(args, fmt.Sprintf("--profile-%s=%s", profileArg, outputPath))
}
if *trace {
args = append(args, fmt.Sprintf("--trace=%s", filepath.Join(p.BasePath, "sentry.trace")))
}
args = append(args, fmt.Sprintf("--duration=%s", p.Duration)) // Or until container exits.
args = append(args, fmt.Sprintf("--delay=%s", p.Duration)) // Ditto.
args = append(args, c.ID())