File tree Expand file tree Collapse file tree 3 files changed +5
-17
lines changed
Expand file tree Collapse file tree 3 files changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ func (p *cacheProfiler) Profile(cacheProfile *CacheProfile) error {
402402 cacheProfile .Reset ()
403403 p .profilersMu .RLock ()
404404 for profilerType , profiler := range p .profilers {
405- profileVal := profileValuePool .Get ().(* ProfileValue )
405+ profileVal := ProfileValuePool .Get ().(* ProfileValue )
406406 err2 := profiler .Profile (profileVal )
407407 err = multierr .Append (err , err2 )
408408 if err2 == nil {
@@ -470,9 +470,5 @@ func (p *cacheProfiler) Profile(cacheProfile *CacheProfile) error {
470470 }
471471 }
472472 p .profilersMu .RUnlock ()
473- if len (multierr .Errors (err )) == len (p .profilers ) {
474- return err
475- }
476-
477- return nil
473+ return err
478474}
Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ func (p *hardwareProfiler) Profile(hwProfile *HardwareProfile) error {
204204 hwProfile .Reset ()
205205 p .profilersMu .RLock ()
206206 for profilerType , profiler := range p .profilers {
207- profileVal := profileValuePool .Get ().(* ProfileValue )
207+ profileVal := ProfileValuePool .Get ().(* ProfileValue )
208208 err2 := profiler .Profile (profileVal )
209209 err = multierr .Append (err , err2 )
210210 if err2 == nil {
@@ -238,10 +238,6 @@ func (p *hardwareProfiler) Profile(hwProfile *HardwareProfile) error {
238238 }
239239 }
240240 }
241- if len (multierr .Errors (err )) == len (p .profilers ) {
242- return err
243- }
244241 p .profilersMu .RUnlock ()
245-
246- return nil
242+ return err
247243}
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ func (p *softwareProfiler) Profile(swProfile *SoftwareProfile) error {
183183 swProfile .Reset ()
184184 p .profilersMu .RLock ()
185185 for profilerType , profiler := range p .profilers {
186- profileVal := profileValuePool .Get ().(* ProfileValue )
186+ profileVal := ProfileValuePool .Get ().(* ProfileValue )
187187 err2 := profiler .Profile (profileVal )
188188 err = multierr .Append (err , err2 )
189189 if err2 == nil {
@@ -217,9 +217,5 @@ func (p *softwareProfiler) Profile(swProfile *SoftwareProfile) error {
217217 }
218218 }
219219 p .profilersMu .RUnlock ()
220- if len (multierr .Errors (err )) == len (p .profilers ) {
221- return err
222- }
223-
224220 return nil
225221}
You can’t perform that action at this time.
0 commit comments