From af62485d95b5ddfc89ca84fd1166a6a04f2b70f2 Mon Sep 17 00:00:00 2001 From: Joey Riches Date: Tue, 22 Sep 2026 14:28:45 +0100 Subject: [PATCH] boulder/data: Use PID to save profiled data when using clang PGO This fixes occassional 'Unable to merge profile data file already exists' warnings when instrumenting with clang Note, we use %%pid here to escape '%p' from boulder attempting to parse it --- boulder/data/macros/actions/pgo.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/boulder/data/macros/actions/pgo.yaml b/boulder/data/macros/actions/pgo.yaml index 904e2945f..02d717687 100644 --- a/boulder/data/macros/actions/pgo.yaml +++ b/boulder/data/macros/actions/pgo.yaml @@ -103,10 +103,10 @@ flags : # PGO stage1 flags for ProfileStage1 (workload builds only) - pgostage1: llvm: - c : "-fprofile-generate=%(pgo_dir)/IR" - cxx : "-fprofile-generate=%(pgo_dir)/IR" - ld : "-fprofile-generate=%(pgo_dir)/IR" - rust : "-Cprofile-generate=%(pgo_dir)/IR -C link-arg=-fprofile-generate=/mason/build/x86_64-pgo/IR" + c : "-fprofile-generate=%(pgo_dir)/IR/%%p.profraw" + cxx : "-fprofile-generate=%(pgo_dir)/IR/%%p.profraw" + ld : "-fprofile-generate=%(pgo_dir)/IR/%%p.profraw" + rust : "-Cprofile-generate=%(pgo_dir)/IR/%%p.profraw -C link-arg=-fprofile-generate=%(pgo_dir)/%%p.profraw" gnu: c : "-fprofile-generate -fprofile-dir=%(pgo_dir)" cxx : "-fprofile-generate -fprofile-dir=%(pgo_dir)" @@ -115,9 +115,9 @@ flags : # PGO stage2 flags for ProfileStage2 (workload builds only) - pgostage2: llvm: - c : "-fprofile-use=%(pgo_dir)/ir.profdata -fcs-profile-generate=%(pgo_dir)/CS" - cxx : "-fprofile-use=%(pgo_dir)/ir.profdata -fcs-profile-generate=%(pgo_dir)/CS" - ld : "-fprofile-use=%(pgo_dir)/ir.profdata -fcs-profile-generate=%(pgo_dir)/CS" + c : "-fprofile-use=%(pgo_dir)/ir.profdata -fcs-profile-generate=%(pgo_dir)/CS/%%p.profraw" + cxx : "-fprofile-use=%(pgo_dir)/ir.profdata -fcs-profile-generate=%(pgo_dir)/CS/%%p.profraw" + ld : "-fprofile-use=%(pgo_dir)/ir.profdata -fcs-profile-generate=%(pgo_dir)/CS/%%p.profraw" # PGO final flags for ProfileUse (workload builds only) - pgouse: