Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the llvm-bolt instrumentation mode result in less accurate BOLT profiles?

The BOLT binary optimizer recommends using perf to profile binaries for optimization. However, if "perf is not available" they have an llvm-bolt mode which can also profile the application:

If perf record is not available to you, you may collect profile by first instrumenting the binary with BOLT and then running it.

Evidently, this is presented as a "second choice" by the BOLT authors.

What is the downside of this mode in terms of instrumentation quality? Evidently it is slower to collect the instrumentation, but is less accurate or effective at producing as input to the subsequent BOLT optimize call which produces a final optimized binary?

like image 406
BeeOnRope Avatar asked Oct 21 '25 13:10

BeeOnRope


1 Answers

Per one of the BOLT authors in this LLVM Discourse post the instrumentation mode is fully accurate (more accurate than hardware counter instrumentation) and the primary downside for users is that it runs more slowly.

They point out that in some cases running more slowly could affect the collected profiles because the rest of the system may change its behavior in response, giving the example of a load balancer which sends an instrumented node less traffic.

like image 77
BeeOnRope Avatar answered Oct 27 '25 00:10

BeeOnRope