Skip to content

Commit 0426a9d

Browse files
committed
Fix offcpu profiling
1 parent da69316 commit 0426a9d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,13 @@ func mainWithExitCode() flags.ExitCode {
378378
}
379379
log.Info("Attached tracer program")
380380

381+
if f.OffCPUThreshold > 0 {
382+
if err := trc.StartOffCPUProfiling(); err != nil {
383+
return flags.Failure("Failed to start off-cpu profiling: %v", err)
384+
}
385+
log.Printf("Enabled off-cpu profiling")
386+
}
387+
381388
if f.Profiling.ProbabilisticThreshold < tracer.ProbabilisticThresholdMax {
382389
trc.StartProbabilisticProfiling(mainCtx)
383390
log.Printf("Enabled probabilistic profiling")

0 commit comments

Comments
 (0)