facebookarchive / BOLT

Binary Optimization and Layout Tool - A linux command-line utility used for optimizing performance of binaries
2.51k stars 177 forks source link

How do I run BOLT on a benchmark of HHVM? #300

Open ZahraHeydari95 opened 2 years ago

ZahraHeydari95 commented 2 years ago

Hello I want to run a benchmark with HHVM. On the other hand, I want to apply BOLT to it as well. But I don't know what to do.

hhvm perf.php --wordpress --hhvm=/path/to/hhvm

According to the BOLT instructions, I have to replace the execution binary in all three steps. But this binary (HHVM) has a series of inputs according to the above command. As a result, the following questions arise for me:

1) How to add -Wl, -q to hhvm binary?

2) How to get a profile on the above command which is for running the benchmark?

3) How do I use ./perf2bolt in the command though wordpress--? Because it considers --wordpress as its own input and gives an error?

4) How do I still use ./llvm-bolt despite --wordpress? Because it still takes its own input and gives an error?

please guide me.

CcWeapon commented 1 year ago

q1: How to add -Wl, -q to hhvm binary? You should have the source code and project of the hhvm, the compile option -Wl, or something that will be added to the build framework of the project. It is similar to Android.bp in AOSP or MakeFIle. q2: How to get a profile on the above command which is for running the benchmark? Use the compiled binary file to perform instrumentation and obtain the profile file. For follow-up questions, you can refer to the official documents.