Skip to content

Commit 8afac47

Browse files
authored
Increase trace_event buffer size if GPU profiling is enabled (#3130)
1 parent b06f9d9 commit 8afac47

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,4 @@ require (
177177
sigs.k8s.io/yaml v1.4.0 // indirect
178178
)
179179

180-
replace go.opentelemetry.io/ebpf-profiler => github.com/parca-dev/opentelemetry-ebpf-profiler v0.0.0-20260115180451-d79ff27bb66a
180+
replace go.opentelemetry.io/ebpf-profiler => github.com/parca-dev/opentelemetry-ebpf-profiler v0.0.0-20260120173907-dbdd569b8667

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ github.com/opencontainers/selinux v1.13.0/go.mod h1:XxWTed+A/s5NNq4GmYScVy+9jzXh
299299
github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0=
300300
github.com/parca-dev/oomprof v0.1.6 h1:potfd09aphNKqsIF54ZsiddTvksVMjQiaKnczFOsVGM=
301301
github.com/parca-dev/oomprof v0.1.6/go.mod h1:iqI6XrmiNWOa8m2vEIKo+GtQrqbWCMLFpBWuk8RuAPs=
302-
github.com/parca-dev/opentelemetry-ebpf-profiler v0.0.0-20260115180451-d79ff27bb66a h1:sHdTnHKnIgO/BHpzP61h78oAPZV0/uwZTloM0pZi2yU=
303-
github.com/parca-dev/opentelemetry-ebpf-profiler v0.0.0-20260115180451-d79ff27bb66a/go.mod h1:yVpeERcH/++ahci/FAPA8l4TL+y0JY3T6z4xu/r3+HM=
302+
github.com/parca-dev/opentelemetry-ebpf-profiler v0.0.0-20260120173907-dbdd569b8667 h1:x7EC4K8Zl4WF1f71shBoGPFut1iTLj526I+yfeOWDlo=
303+
github.com/parca-dev/opentelemetry-ebpf-profiler v0.0.0-20260120173907-dbdd569b8667/go.mod h1:yVpeERcH/++ahci/FAPA8l4TL+y0JY3T6z4xu/r3+HM=
304304
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0=
305305
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y=
306306
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=

main.go

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -429,21 +429,27 @@ func mainWithExitCode() flags.ExitCode {
429429
}
430430

431431
// Load the eBPF code and map definitions
432+
traceBufferMultiplier := 1
433+
if f.InstrumentCudaLaunch {
434+
// GPU profiling generates high trace volume, increase buffer
435+
traceBufferMultiplier = 50
436+
}
432437
trc, err := tracer.NewTracer(mainCtx, &tracer.Config{
433-
VerboseMode: f.BPF.VerboseLogging,
434-
Reporter: rep,
435-
Intervals: intervals,
436-
IncludeTracers: includeTracers,
437-
SamplesPerSecond: f.Profiling.CPUSamplingFrequency,
438-
MapScaleFactor: f.BPF.MapScaleFactor,
439-
FilterErrorFrames: !f.Profiling.EnableErrorFrames,
440-
KernelVersionCheck: !f.Hidden.IgnoreUnsafeKernelVersion,
441-
BPFVerifierLogLevel: f.BPF.VerifierLogLevel,
442-
ProbabilisticInterval: f.Profiling.ProbabilisticInterval,
443-
ProbabilisticThreshold: f.Profiling.ProbabilisticThreshold,
444-
OffCPUThreshold: uint32(f.OffCPUThreshold * math.MaxUint32),
445-
IncludeEnvVars: includeEnvVars,
446-
InstrumentCudaLaunch: f.InstrumentCudaLaunch,
438+
VerboseMode: f.BPF.VerboseLogging,
439+
Reporter: rep,
440+
Intervals: intervals,
441+
IncludeTracers: includeTracers,
442+
SamplesPerSecond: f.Profiling.CPUSamplingFrequency,
443+
MapScaleFactor: f.BPF.MapScaleFactor,
444+
FilterErrorFrames: !f.Profiling.EnableErrorFrames,
445+
KernelVersionCheck: !f.Hidden.IgnoreUnsafeKernelVersion,
446+
BPFVerifierLogLevel: f.BPF.VerifierLogLevel,
447+
ProbabilisticInterval: f.Profiling.ProbabilisticInterval,
448+
ProbabilisticThreshold: f.Profiling.ProbabilisticThreshold,
449+
OffCPUThreshold: uint32(f.OffCPUThreshold * math.MaxUint32),
450+
IncludeEnvVars: includeEnvVars,
451+
InstrumentCudaLaunch: f.InstrumentCudaLaunch,
452+
TraceBufferSizeMultiplier: traceBufferMultiplier,
447453
})
448454
metrics.SetReporter(parcaReporter)
449455
if err != nil {

reporter/parca_reporter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,8 @@ func (r *ParcaReporter) reportDataToBackend(ctx context.Context, buf *bytes.Buff
10671067
return err
10681068
}
10691069

1070+
log.Infof("[reporter] sending %d samples (%d bytes) to server", record.NumRows(), buf.Len())
1071+
10701072
client, err := r.client.Write(ctx)
10711073
if err != nil {
10721074
return err

0 commit comments

Comments
 (0)