Skip to content

Commit f2251e2

Browse files
aaupovDanielCChen
authored andcommitted
[BOLT] Support perf2bolt-N in the driver
Check invoked tool with `starts_with`. Addresses the issue where `perf2bolt` invoked using a distro symlink `perf2bolt-16` fails to run in perf2bolt mode and runs in llvm-bolt mode instead. The issue is mentioned in https://vondra.me/posts/playing-with-bolt-and-postgres/ Test Plan: ``` ln -sf perf2bolt perf2bolt-20 perf2bolt-20 clang -p perf.data -o fdata.clang -w yaml.clang ... PERF2BOLT: wrote 188593 objects and 0 memory objects to fdata.clang ``` Reviewers: ayermolo, rafaelauler, dcci, maksfb Reviewed By: maksfb Pull Request: llvm#111072
1 parent a391ff6 commit f2251e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bolt/tools/driver/llvm-bolt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ int main(int argc, char **argv) {
202202

203203
ToolName = argv[0];
204204

205-
if (llvm::sys::path::filename(ToolName) == "perf2bolt")
205+
if (llvm::sys::path::filename(ToolName).starts_with("perf2bolt"))
206206
perf2boltMode(argc, argv);
207-
else if (llvm::sys::path::filename(ToolName) == "llvm-boltdiff")
207+
else if (llvm::sys::path::filename(ToolName).starts_with("llvm-boltdiff"))
208208
boltDiffMode(argc, argv);
209209
else
210210
boltMode(argc, argv);

0 commit comments

Comments
 (0)