Add a mode in which profile read errors are not immediately treated as
fatal. In this mode, merging makes forward progress and reports failure
only if no inputs can be read.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
- Don't record a read failure when a soft error is encountered within mergeRecordsFromWriter.
llvm/tools/llvm-profdata/llvm-profdata.cpp | ||
---|---|---|
279 ↗ | (On Diff #218007) | How bad will it be if we decide to always print the warning here, not just for the first time? |
This is a behavior change and I think it should be guarded with an option. The default of the option should be set to 'FailOnAnyWhenMerge' instead of 'FailOnAllWhenMerge'.
Need to add an option to preserve the old error reporting behavior. I'll get back to this on Tuesday.
llvm/tools/llvm-profdata/llvm-profdata.cpp | ||
---|---|---|
279 ↗ | (On Diff #218007) | I agree that reporting of soft errors during merging is not as helpful as it should be. We should come up with a better solution. Istm that warning on all soft errors here could be very annoying (e.g. if there are lots of counter overflows). |
@davidxl Are you recommending that the old behavior (fail the merge if any profiles are malformed) should remain the default? I think that's reasonable (it raises the alarm about toolchain bugs), just wanted to double-check.
yes, the old behavior should be the default. It raises the awareness of the problem (and merge errors are usually rare in reality).
Right, that's a good point. I wonder if it's worth introducing a separate mode, then, if it's not the recommended way to run the tool in production? Perhaps this should be set aside.
A separate mode is fine. Buffering the errors and reporting them later is also useful (allowing more context info to be emitted).
llvm/docs/CommandGuide/llvm-profdata.rst | ||
---|---|---|
127 ↗ | (On Diff #218512) | The enums can be named with descriptive strings, but can the command line be simplified? --failure-mode=any|all |