From 13ba4b433de6131c2e2116e3ae927f809e8d2d54 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Fri, 29 Apr 2022 09:35:42 -0700 Subject: [PATCH] Clean up cpuio profiling (#14838) Don't start regular cpu profile as well. Use bed madmin const. --- cmd/utils.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cmd/utils.go b/cmd/utils.go index d2c53af5f..544c20d99 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -320,8 +320,7 @@ func startProfiler(profilerType string) (minioProfiler, error) { defer os.RemoveAll(dirPath) return ioutil.ReadFile(fn) } - // TODO(klauspost): Replace with madmin.ProfilerCPUIO on next update. - case "cpuio": + case madmin.ProfilerCPUIO: // at 10k or more goroutines fgprof is likely to become // unable to maintain its sampling rate and to significantly // degrade the performance of your application @@ -339,10 +338,6 @@ func startProfiler(profilerType string) (minioProfiler, error) { return nil, err } stop := fgprof.Start(f, fgprof.FormatPprof) - err = pprof.StartCPUProfile(f) - if err != nil { - return nil, err - } prof.stopFn = func() ([]byte, error) { err := stop() if err != nil {