diff --git a/sweet/cmd/sweet/run.go b/sweet/cmd/sweet/run.go index 92ba5c9..2d222c8 100644 --- a/sweet/cmd/sweet/run.go +++ b/sweet/cmd/sweet/run.go @@ -427,31 +427,33 @@ func (c *runCmd) preparePGO(configs []*common.Config, benchmarks []*benchmark) ( // Merge all the profiles and add new PGO configs. newConfigs := configs - var successfullyMergedBenchmarks []*benchmark for i := range configs { origConfig := configs[i] profileConfig := profileConfigs[i] pgoConfig := origConfig.Copy() pgoConfig.Name += ".pgo" pgoConfig.PGOFiles = make(map[string]string) + noMergeError := true for _, b := range successfullyExecutedBenchmarks { p, err := mergeCPUProfiles(profileRunCfg.runProfilesDir(b, profileConfig)) if err != nil { log.Error(fmt.Errorf("error merging profiles for %s/%s: %w", b.name, profileConfig.Name, err)) + noMergeError = false } else { - successfullyMergedBenchmarks = append(successfullyMergedBenchmarks, b) pgoConfig.PGOFiles[b.name] = p } } - newConfigs = append(newConfigs, pgoConfig) + if noMergeError { + newConfigs = append(newConfigs, pgoConfig) + } } if len(successfullyExecutedBenchmarks) == 0 { return nil, nil, fmt.Errorf("failed to merge profiles for any benchmarks, see logs for more details") } - return newConfigs, successfullyMergedBenchmarks, nil + return newConfigs, successfullyExecutedBenchmarks, nil } var cpuProfileRe = regexp.MustCompile(`-cpu\.prof$`)