Some small value summaries of warning are less important, add a threshold to control hiding them.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
I'm not sure if a universal threshold for filtering warning is a good way to deal with this. Maybe look at this from a different angle -- for some warnings, any instance is bad, for others, we can tolerate them. Hence, an alternative: for critical ones, we should always print out any non-zero value; for others, print them only under a "verbose" mode?
Updating D125255: [llvm-profgen] Support a threshold to control hiding warning summaries
Sounds good.
- add verbose mode to enable to print all of them.
- add a parameter to emitWarningSummary to customize value for critical warning, default value increase to 20%.
- IMP, warning of "inconsistent name from symbol table and dwarf info" should be critical. changed thres to 0.
llvm/tools/llvm-profgen/ErrorHandling.h | ||
---|---|---|
54 | fixed! | |
llvm/tools/llvm-profgen/PerfReader.cpp | ||
46 ↗ | (On Diff #428150) | Added validation in validateCommandLine, it can be 0 to print all the number between [0,1]. |
add a parameter to emitWarningSummary to customize value for critical warning, default value increase to 20%.
Do we even need a threshold for emitting critical ones? If it's critical, we should always emit them?
Sorry for the confusing, " customize value for critical warning" is wrong, I meant the parameter is used to treat warnings of different importance differently. For critical warning, the threshold is 0, then it's always emitted. For non-critical ones, developer can still set a threshold or use the default one, then emit it if it's above it.
Ok, maybe a verbose mode is enough for enabling all warnings. I can see that a threshold for non-critical warnings could be potentially useful, but also wondering if we could just keep things very simple here. The goal is not to give user a lot of control on what to print out, but to make sure 1) the default warning printing is meaningful to average users, 2) advanced users have a way to print everything.
Updating D125255: [llvm-profgen] Support a threshold to control hiding warning summaries
LGTM with a minor suggestion.
llvm/tools/llvm-profgen/ErrorHandling.h | ||
---|---|---|
53 | nit: IsCritical -> AlwaysEmit? |
Updating D125255: [llvm-profgen] Support a threshold to control hiding warning summaries
I think we also need to decide what should always be emitted. Now there's only one warning that is always emitted. I think we can benefit from another always emit warning that can tells us when profile/binary mismatch and/or the issues like the skylake PMU bug happens. Do we get any indicator now for these issues?
When simplifying, we still want to let user know very meaningful signal, but we don't want to present 10 signals to users, instead we want to give them a couple important signals, I think signal for profile/binary mismatch etc can be considered important?
It looks like we already have a verbose mode show-detailed-warning, maybe we can reuse that?
nit: IsCritical -> AlwaysEmit?