Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EBPF] gpu config func rename #30812

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/system-probe/modules/gpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/gpu/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion pkg/gpu/consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions pkg/gpu/probe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -46,7 +46,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

Expand Down Expand Up @@ -99,7 +99,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

Expand Down
Loading