BeeOnRope
BeeOnRope

Reputation: 64905

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?

Upvotes: 4

Views: 404

Answers (1)

BeeOnRope
BeeOnRope

Reputation: 64905

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.

Upvotes: 5

Related Questions