diff --git a/cmd/system-probe/modules/gpu.go b/cmd/system-probe/modules/gpu.go index 27f3f0cc87890b..279084eeec3392 100644 --- a/cmd/system-probe/modules/gpu.go +++ b/cmd/system-probe/modules/gpu.go @@ -33,7 +33,7 @@ var GPUMonitoring = module.Factory{ ConfigNamespaces: gpuMonitoringConfigNamespaces, Fn: func(_ *sysconfigtypes.Config, deps module.FactoryDependencies) (module.Module, error) { - c := gpuconfig.NewConfig() + c := gpuconfig.New() probeDeps := gpu.ProbeDependencies{ Telemetry: deps.Telemetry, //if the config parameter doesn't exist or is empty string, the default value is used as defined in go-nvml library diff --git a/pkg/gpu/config/config.go b/pkg/gpu/config/config.go index e9920e62a6e30a..aa239a129d24e5 100644 --- a/pkg/gpu/config/config.go +++ b/pkg/gpu/config/config.go @@ -58,8 +58,8 @@ type Config struct { NVMLLibraryPath string } -// NewConfig generates a new configuration for the GPU monitoring probe. -func NewConfig() *Config { +// New generates a new configuration for the GPU monitoring probe. +func New() *Config { spCfg := pkgconfigsetup.SystemProbe() return &Config{ Config: *ebpf.NewConfig(), diff --git a/pkg/gpu/consumer_test.go b/pkg/gpu/consumer_test.go index ef90d146249535..6530f2bb497384 100644 --- a/pkg/gpu/consumer_test.go +++ b/pkg/gpu/consumer_test.go @@ -21,7 +21,7 @@ import ( func TestConsumerCanStartAndStop(t *testing.T) { handler := ddebpf.NewRingBufferHandler(consumerChannelSize) - cfg := config.NewConfig() + cfg := config.New() ctx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot()) require.NoError(t, err) consumer := newCudaEventConsumer(ctx, handler, cfg) diff --git a/pkg/gpu/probe_test.go b/pkg/gpu/probe_test.go index 54f638110821bd..adf7a8a9e55346 100644 --- a/pkg/gpu/probe_test.go +++ b/pkg/gpu/probe_test.go @@ -24,7 +24,7 @@ func TestProbeCanLoad(t *testing.T) { t.Skipf("minimum kernel version not met, %v", err) } - cfg := config.NewConfig() + cfg := config.New() cfg.InitialProcessSync = false nvmlMock := testutil.GetBasicNvmlMock() probe, err := NewProbe(cfg, ProbeDependencies{NvmlLib: nvmlMock}) @@ -47,7 +47,7 @@ func TestProbeCanReceiveEvents(t *testing.T) { require.NoError(t, procMon.Initialize(false)) t.Cleanup(procMon.Stop) - cfg := config.NewConfig() + cfg := config.New() cfg.InitialProcessSync = false cfg.BPFDebug = true @@ -101,7 +101,7 @@ func TestProbeCanGenerateStats(t *testing.T) { require.NoError(t, procMon.Initialize(false)) t.Cleanup(procMon.Stop) - cfg := config.NewConfig() + cfg := config.New() cfg.InitialProcessSync = false cfg.BPFDebug = true