Skip to content

Commit a29ff0c

Browse files
committed
Test frame cache
1 parent c233b1b commit a29ff0c

File tree

5 files changed

+28
-18
lines changed

5 files changed

+28
-18
lines changed

config/cli_flags.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,14 @@ func parseCLIArgs(osArgs []string) (*Arguments, error) {
395395
Destination: &args.CollectContext,
396396
Sources: cli.EnvVars("DD_HOST_PROFILING_COLLECT_CONTEXT"),
397397
},
398+
&cli.IntFlag{
399+
Name: "frame-cache-size",
400+
Value: -1,
401+
Hidden: true,
402+
Usage: "Size of the frame cache.",
403+
Destination: &args.FrameCacheSize,
404+
Sources: cli.EnvVars("DD_HOST_PROFILING_FRAME_CACHE_SIZE"),
405+
},
398406
},
399407
Action: func(_ context.Context, cmd *cli.Command) error {
400408
args.cmd = cmd

config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,5 @@ type Config struct {
8383
EnableSplitByService bool
8484
SplitServiceSuffix string
8585
CollectContext bool
86+
FrameCacheSize int64
8687
}

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ require (
138138
github.com/yusufpapurcu/wmi v1.2.4 // indirect
139139
go.opencensus.io v0.24.0 // indirect
140140
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
141-
go.opentelemetry.io/collector/component v1.46.0 // indirect
141+
go.opentelemetry.io/collector/component v1.46.1-0.20251120204106-2e9c82787618 // indirect
142142
go.opentelemetry.io/collector/consumer v1.46.0 // indirect
143-
go.opentelemetry.io/collector/consumer/xconsumer v0.140.0 // indirect
143+
go.opentelemetry.io/collector/consumer/xconsumer v0.140.1-0.20251120204106-2e9c82787618 // indirect
144144
go.opentelemetry.io/collector/featuregate v1.46.0 // indirect
145-
go.opentelemetry.io/collector/pdata v1.46.0 // indirect
146-
go.opentelemetry.io/collector/pdata/pprofile v0.140.0 // indirect
145+
go.opentelemetry.io/collector/pdata v1.46.1-0.20251120204106-2e9c82787618 // indirect
146+
go.opentelemetry.io/collector/pdata/pprofile v0.140.1-0.20251120204106-2e9c82787618 // indirect
147147
go.opentelemetry.io/collector/semconv v0.125.0 // indirect
148148
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
149149
go.opentelemetry.io/otel v1.38.0 // indirect
@@ -180,4 +180,4 @@ require (
180180
// To update the Datadog/opentelemetry-ebpf-profiler dependency on latest commit on datadog branch, change the following line to:
181181
// replace go.opentelemetry.io/ebpf-profiler => github.com/DataDog/opentelemetry-ebpf-profiler datadog
182182
// and run `go mod tidy`
183-
replace go.opentelemetry.io/ebpf-profiler => github.com/DataDog/opentelemetry-ebpf-profiler v0.0.0-20251119095038-750fb336791a
183+
replace go.opentelemetry.io/ebpf-profiler => github.com/DataDog/opentelemetry-ebpf-profiler v0.0.0-20251124232356-613cd24ae764

go.sum

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ github.com/DataDog/gostackparse v0.7.0 h1:i7dLkXHvYzHV308hnkvVGDL3BR4FWl7IsXNPz/
4242
github.com/DataDog/gostackparse v0.7.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM=
4343
github.com/DataDog/jsonapi v0.12.0 h1:N4e9RpmUflcV5hzceltSz8XUpM3PMtQr5C9Bhv0g87s=
4444
github.com/DataDog/jsonapi v0.12.0/go.mod h1:FUSGF3bwMARlVfXEoFo9R/CVlYYy9BGL4C/Prf6Ke3M=
45-
github.com/DataDog/opentelemetry-ebpf-profiler v0.0.0-20251119095038-750fb336791a h1:C2u81b7GBx6/oHR7gVINAKmrkTHrgIb03b9Ffr6ZFHM=
46-
github.com/DataDog/opentelemetry-ebpf-profiler v0.0.0-20251119095038-750fb336791a/go.mod h1:bYhWgro0or2UhzNw7Y8KgdIWhZEmSS0IH74h1Dg+xPU=
45+
github.com/DataDog/opentelemetry-ebpf-profiler v0.0.0-20251124232356-613cd24ae764 h1:aTr+4UALcc3mh+XLtv2L51BtLd3570KID3lGPiuD5Og=
46+
github.com/DataDog/opentelemetry-ebpf-profiler v0.0.0-20251124232356-613cd24ae764/go.mod h1:cXttcsQ0wbppB5zJOylJ5EfcfAX68zF8nGyKj7ga8X8=
4747
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.27.0 h1:5US5SqqhfkZkg/E64uvn7YmeTwnudJHtlPEH/LOT99w=
4848
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.27.0/go.mod h1:VRo4D6rj92AExpVBlq3Gcuol9Nm1bber12KyxRjKGWw=
4949
github.com/DataDog/sketches-go v1.4.7 h1:eHs5/0i2Sdf20Zkj0udVFWuCrXGRFig2Dcfm5rtcTxc=
@@ -366,24 +366,24 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
366366
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
367367
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
368368
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
369-
go.opentelemetry.io/collector/component v1.46.0 h1:m+BF5sT4wQ3AiPcMBVgYPhxTZNGYGDkgMcKFivEznSo=
370-
go.opentelemetry.io/collector/component v1.46.0/go.mod h1:Zp+JaUgGrPvt4JNzJU1MD7KcZhauab9W0pCykgGPSN0=
369+
go.opentelemetry.io/collector/component v1.46.1-0.20251120204106-2e9c82787618 h1:xIx6z5BadxNXT/1ZOeQNS8fcGkBBoS9gAPXlWOnfsJY=
370+
go.opentelemetry.io/collector/component v1.46.1-0.20251120204106-2e9c82787618/go.mod h1:Zp+JaUgGrPvt4JNzJU1MD7KcZhauab9W0pCykgGPSN0=
371371
go.opentelemetry.io/collector/component/componentstatus v0.125.0 h1:zlxGQZYd9kknRZSjRpOYW5SBjl0a5zYFYRPbreobXoU=
372372
go.opentelemetry.io/collector/component/componentstatus v0.125.0/go.mod h1:bHXc2W8bqqo9adOvCgvhcO7pYzJOSpyV4cuQ1wiIl04=
373373
go.opentelemetry.io/collector/component/componenttest v0.140.0 h1:/g7yETZ7Flq4v9qSmN9jux0LecMPJDwr8HtvhOgN6H4=
374374
go.opentelemetry.io/collector/component/componenttest v0.140.0/go.mod h1:40PZd6rjqHH5UCqxB6nAvnHtDTwZaSWf1En1u1mbA8k=
375375
go.opentelemetry.io/collector/consumer v1.46.0 h1:yG5zCCgbB2d0KobuYNZWdg8fy/HV2cA/ls0fYzVKBQ4=
376376
go.opentelemetry.io/collector/consumer v1.46.0/go.mod h1:3hjV46vdz8zExuTKlxRge3VdeVUr0PJETqIMewKThNc=
377-
go.opentelemetry.io/collector/consumer/consumertest v0.140.0 h1:t+XjKtQv37k/t/Tkj4D3ocgIHs40gPWl1CHClbBM+A8=
378-
go.opentelemetry.io/collector/consumer/consumertest v0.140.0/go.mod h1:LvDaKM5A7hUg7LWZBqk69sE0q5GrdM8BmLqX6kCP3WQ=
379-
go.opentelemetry.io/collector/consumer/xconsumer v0.140.0 h1:VTTybtJLbGN6aGw1bB7Wn8gS7vrbgnDu6JVvgztczj8=
380-
go.opentelemetry.io/collector/consumer/xconsumer v0.140.0/go.mod h1:CtwSgAXVisCEJ+ElKeDa0yDo/Oie7l1vWAx1elFyWZc=
377+
go.opentelemetry.io/collector/consumer/consumertest v0.140.1-0.20251120204106-2e9c82787618 h1:bondxHiwLGmSrJ3WiUaUwx5bvaUwP1b6/AvMUPqDoV0=
378+
go.opentelemetry.io/collector/consumer/consumertest v0.140.1-0.20251120204106-2e9c82787618/go.mod h1:LvDaKM5A7hUg7LWZBqk69sE0q5GrdM8BmLqX6kCP3WQ=
379+
go.opentelemetry.io/collector/consumer/xconsumer v0.140.1-0.20251120204106-2e9c82787618 h1:F5We4BryZ1N3/pDdEqefIIZQzKPT7GaoOkTTGpfkd5w=
380+
go.opentelemetry.io/collector/consumer/xconsumer v0.140.1-0.20251120204106-2e9c82787618/go.mod h1:CtwSgAXVisCEJ+ElKeDa0yDo/Oie7l1vWAx1elFyWZc=
381381
go.opentelemetry.io/collector/featuregate v1.46.0 h1:z3JlymFdWW6aDo9cYAJ6bCqT+OI2DlurJ9P8HqfuKWQ=
382382
go.opentelemetry.io/collector/featuregate v1.46.0/go.mod h1:d0tiRzVYrytB6LkcYgz2ESFTv7OktRPQe0QEQcPt1L4=
383-
go.opentelemetry.io/collector/pdata v1.46.0 h1:XzhnIWNtc/gbOyFiewRvybR4s3phKHrWxL3yc/wVLDo=
384-
go.opentelemetry.io/collector/pdata v1.46.0/go.mod h1:D2e3BWCUC/bUg29WNzCDVN7Ab0Gzk7hGXZL2pnrDOn0=
385-
go.opentelemetry.io/collector/pdata/pprofile v0.140.0 h1:b9TZ6UnyzsT/ERQw2VKGi/NYLtKSmjG7cgQuc9wZt5s=
386-
go.opentelemetry.io/collector/pdata/pprofile v0.140.0/go.mod h1:/2s/YBWGbu+r8MuKu5zas08iSqe+3P6xnbRpfE2DWAA=
383+
go.opentelemetry.io/collector/pdata v1.46.1-0.20251120204106-2e9c82787618 h1:w4Sd8D+T6wdekkBJlfjAsa7wpXDUmb3wQicikJ8vI9M=
384+
go.opentelemetry.io/collector/pdata v1.46.1-0.20251120204106-2e9c82787618/go.mod h1:AqZXTFkj01IxuiHZ1/I7UcGqaljvF5xiUXNYGxRqVp8=
385+
go.opentelemetry.io/collector/pdata/pprofile v0.140.1-0.20251120204106-2e9c82787618 h1:EPM+f1DSlHtcTT32N2tfIwXY58N5lOChdYNEEgBk5uA=
386+
go.opentelemetry.io/collector/pdata/pprofile v0.140.1-0.20251120204106-2e9c82787618/go.mod h1:01EwjIBpIcmJva7IoXPmHPmACGzsGxFi9xhZhY7W4q8=
387387
go.opentelemetry.io/collector/pdata/testdata v0.125.0 h1:due1Hl0EEVRVwfCkiamRy5E8lS6yalv0lo8Zl/SJtGw=
388388
go.opentelemetry.io/collector/pdata/testdata v0.125.0/go.mod h1:1GpEWlgdMrd+fWsBk37ZC2YmOP5YU3gFQ4rWuCu9g24=
389389
go.opentelemetry.io/collector/pipeline v1.46.0 h1:VFID9aOmX5eeZSj29lgMdX7qg5nLKiXnkKOJXIAu47c=

runner/runner.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ func Run(mainCtx context.Context, c *config.Config) ExitCode {
289289

290290
// Load the eBPF code and map definitions
291291
trc, err := tracer.NewTracer(mainCtx, &tracer.Config{
292-
ExecutableReporter: rep,
293292
TraceReporter: rep,
293+
ExecutableReporter: rep,
294294
Intervals: intervals,
295295
IncludeTracers: includeTracers,
296296
FilterErrorFrames: !c.SendErrorFrames,
@@ -303,6 +303,7 @@ func Run(mainCtx context.Context, c *config.Config) ExitCode {
303303
ProbabilisticInterval: c.ProbabilisticInterval,
304304
ProbabilisticThreshold: uint(c.ProbabilisticThreshold),
305305
IncludeEnvVars: includeEnvVars,
306+
FrameCacheSize: int(c.FrameCacheSize),
306307
})
307308
if err != nil {
308309
return failure("Failed to load eBPF tracer: %v", err)

0 commit comments

Comments
 (0)