Make the profiler easier to use (#5068)

This commit is contained in:
dorman
2024-10-29 08:34:59 -07:00
committed by GitHub
parent a814b5deaf
commit 9f4659884d
+6
View File
@@ -114,6 +114,12 @@ var globalProfilers []profiler
func enableProfilers(outputFolder string, profilers []string) error {
now := time.Now().Format("2006-01-02T15-04-05")
if _, e := os.Stat(outputFolder); e != nil {
if e := os.MkdirAll(outputFolder, 0o700); e != nil {
return e
}
}
for _, profilerName := range profilers {
outputFile := path.Join(outputFolder, profilerName+"."+now)
f, e := os.Create(outputFile)