mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Enable collection of go traces during benchmarks.
PiperOrigin-RevId: 601548685
This commit is contained in:
committed by
gVisor bot
parent
d788c40b19
commit
8d37113049
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user