Currently encountering some problems in the use of bolt.
In --enable-bat mode,
In no-lbr mode, when bolt2perf is performed for the second time, BOLT-WARNING: sizes differ for function, I collected the logs, and warnings will appear for all “*.org.0” symbols.
If use lbr mode, although no alarm will appear, the if (FDEI->first != Address) branch will be entered.
1094 auto FDEI = CFIRdWrt->getFDEs().lower_bound(Address);
1095 if (FDEI != CFIRdWrt->getFDEs().end()) {
1096 const dwarf::FDE &FDE = *FDEI->second;
1097 if (FDEI->first != Address) {
....
1114 } else if (FDE.getAddressRange() != SymbolSize) {
1115 if (SymbolSize) {
1116 // Function addresses match but sizes differ.
1117 errs() << "BOLT-WARNING: sizes differ for function " << UniqueName
....
Since this problem has not been reproduced in a simple demo, I cannot provide a reproduction example yet. I would like to ask if there are any troubleshooting directions or possible reasons?
You can safely ignore these warnings. In case you are curious, the reason you see them is that we don’t reset FDEs for “*.org.*” functions. Those functions will normally contain just a jump to an optimized function without “.org.*” suffix.
This doesn’t seem to be consistent with what I’ve observed. In the no-lbr mode, the size of the FDE is different from the size in the symbol table, so I can see this warning, and in the lbr mode, the FDE of the *.ori symbol address cannot be found.
Most likely you are getting different profile coverage with different methods of profile collection. Hard to tell exactly without looking at the binaries.
Sorry, my previous information was wrong. It has nothing to do with whether it is lbr.
The reason for the difference is:
Using bolt-14, use the option --enable-bat to optimize the binary bolted_binary1
Used bolt-17 perf2bolt to convert perf data from bolted_binary1
No warning will appear for such steps, but if bolt-17 is used in both steps 1 and 2, a warning will appear.
Is that because bolt-14 does not set the dwarf table for *.org, and the dwarf table of bolted_binary1 does not have the FDE of *.org.0, so the branch entered when step 2 is executed is 1097 if (FDEI->first != Address ) {.
For bolt-17, the dwarf table is set and the original size is retained, and the size set in the symbol table is 5, leaving only one jump statement.
Now it seems that such logs only appear in bolt-17, so another question is, if it can be ignored, why is it still displayed in the form of a warning by default?
Passing BOLTed binaries back to BOLT is something we didn’t expect to be a common practice. Of course with the BAT mode it is expected to happen. It’s a bug.