llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.61k stars 11.82k forks source link

[warning] invalid (possibly stale) profile #84625

Open lyf-g opened 7 months ago

lyf-g commented 7 months ago

When I use BOLT for optimization, it shows the following warning. My profile data I just collected with perf.

BOLT-WARNING: debug info will be stripped from the binary. Use -update-debug-sections to keep it. BOLT-WARNING: split function detected on input : main.cold/1. The support is limited in relocation mode. BOLT-WARNING: Ignored 0 functions due to cold fragments. BOLT-WARNING: 2989 (89.6% of all profiled) functions have invalid (possibly stale) profile. Use -report-stale to see the list. BOLT-WARNING: 80175242 out of 80498905 samples in the binary (99.6%) belong to functions with invalid (possibly stale) profile. [tracer] 5472 functions was moved (functions reordered) by BOLT [tracer(time)] llvm-bolt took 47.449857 seconds to execute

llvmbot commented 7 months ago

@llvm/issue-subscribers-bolt

Author: lyf-Issac (lyf-g)

When I use BOLT for optimization, it shows the following warning. My profile data I just collected with perf. BOLT-WARNING: debug info will be stripped from the binary. Use -update-debug-sections to keep it. BOLT-WARNING: split function detected on input : main.cold/1. The support is limited in relocation mode. BOLT-WARNING: Ignored 0 functions due to cold fragments. BOLT-WARNING: 2989 (89.6% of all profiled) functions have invalid (possibly stale) profile. Use -report-stale to see the list. BOLT-WARNING: 80175242 out of 80498905 samples in the binary (99.6%) belong to functions with invalid (possibly stale) profile. [tracer] 5472 functions was moved (functions reordered) by BOLT [tracer(time)] llvm-bolt took 47.449857 seconds to execute
aaupov commented 7 months ago

This warning suggests that the profiled binary is not the same as optimized binary. Please double check your profiling setup.

lyf-g commented 7 months ago

I used perf2bolt and BOLT as soon as I collected the information using perf, but the problem still occurred. Could it be because of version compatibility issues?