diff --git a/cache_profiler.go b/cache_profiler.go index c7330f1..e3f79af 100644 --- a/cache_profiler.go +++ b/cache_profiler.go @@ -402,7 +402,7 @@ func (p *cacheProfiler) Profile(cacheProfile *CacheProfile) error { cacheProfile.Reset() p.profilersMu.RLock() for profilerType, profiler := range p.profilers { - profileVal := profileValuePool.Get().(*ProfileValue) + profileVal := ProfileValuePool.Get().(*ProfileValue) err2 := profiler.Profile(profileVal) err = multierr.Append(err, err2) if err2 == nil { @@ -470,9 +470,5 @@ func (p *cacheProfiler) Profile(cacheProfile *CacheProfile) error { } } p.profilersMu.RUnlock() - if len(multierr.Errors(err)) == len(p.profilers) { - return err - } - - return nil + return err } diff --git a/hardware_profiler.go b/hardware_profiler.go index 4a9123f..c862be3 100644 --- a/hardware_profiler.go +++ b/hardware_profiler.go @@ -204,7 +204,7 @@ func (p *hardwareProfiler) Profile(hwProfile *HardwareProfile) error { hwProfile.Reset() p.profilersMu.RLock() for profilerType, profiler := range p.profilers { - profileVal := profileValuePool.Get().(*ProfileValue) + profileVal := ProfileValuePool.Get().(*ProfileValue) err2 := profiler.Profile(profileVal) err = multierr.Append(err, err2) if err2 == nil { @@ -238,10 +238,6 @@ func (p *hardwareProfiler) Profile(hwProfile *HardwareProfile) error { } } } - if len(multierr.Errors(err)) == len(p.profilers) { - return err - } p.profilersMu.RUnlock() - - return nil + return err } diff --git a/software_profiler.go b/software_profiler.go index cf4f6aa..af88d03 100644 --- a/software_profiler.go +++ b/software_profiler.go @@ -183,7 +183,7 @@ func (p *softwareProfiler) Profile(swProfile *SoftwareProfile) error { swProfile.Reset() p.profilersMu.RLock() for profilerType, profiler := range p.profilers { - profileVal := profileValuePool.Get().(*ProfileValue) + profileVal := ProfileValuePool.Get().(*ProfileValue) err2 := profiler.Profile(profileVal) err = multierr.Append(err, err2) if err2 == nil { @@ -217,9 +217,5 @@ func (p *softwareProfiler) Profile(swProfile *SoftwareProfile) error { } } p.profilersMu.RUnlock() - if len(multierr.Errors(err)) == len(p.profilers) { - return err - } - return nil }