diff --git a/internal/controller/config.go b/internal/controller/config.go index 43cf31775..2f840ce48 100644 --- a/internal/controller/config.go +++ b/internal/controller/config.go @@ -72,7 +72,7 @@ func (cfg *Config) Validate() error { return fmt.Errorf("invalid sampling frequency: %d", cfg.SamplesPerSecond) } - if cfg.MapScaleFactor > 8 { + if cfg.MapScaleFactor > MaxArgMapScaleFactor { return fmt.Errorf( "eBPF map scaling factor %d exceeds limit (max: %d)", cfg.MapScaleFactor, MaxArgMapScaleFactor, @@ -105,6 +105,10 @@ func (cfg *Config) Validate() error { "should be in the range [0..1]. 0 disables off-cpu profiling") } + if cfg.MaxRPCMsgSize <= 0 { + return fmt.Errorf("invalid max-rpc-msg-size: got %d, must be greater than 0", cfg.MaxRPCMsgSize) + } + if !cfg.NoKernelVersionCheck { major, minor, patch, err := tracer.GetCurrentKernelVersion() if err != nil {