Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
hot-func-list of sample pgo is the equivalent of topn for instr pgo. Sample pgo diverged from instr pgo here in the sense we use hot-func-list to print a hot function list where "hot" is defined by the dyn-instr percentile based threshold. So simply adding topn might be confusing, as using topn alone for sample pgo won't print the hot function list, unlike instr pgo.
if you want to grow or trim the hot function list, you could use the threshold cutoff switches. Ideally we should unify the switches for both instr pgo and sample pgo.
llvm/tools/llvm-profdata/llvm-profdata.cpp | ||
---|---|---|
2352–2353 | nit: TopN |
My usage of topn was to be able to compare and analyze a fixed number of functions rather than defining different cut-off values to get similar effects across many different binaries. That being said, this was all running in a script so I could've also had the script do this pruning instead of llvm-profdata.
Unifying switches was the main reason I added this to prof-data, since topn being documented but being a complete no-op in sample profile threw me off.
topn alone would still not do anything with your change. perhaps when topn is on, the hot func list should be printed. llvm-profdata has many switches that are only applicable to either instr. pgo or sample pgo (showcs for ipgo, show-prof-sym-list for spgo, etc..)
llvm/tools/llvm-profdata/llvm-profdata.cpp | ||
---|---|---|
2453–2454 | ShowHotFuncList || TopN would make it more consistent between instr pgo and sample pgo. |
lgtm with a nit, thanks.
llvm/test/tools/llvm-profdata/sample-topn.test | ||
---|---|---|
1 ↗ | (On Diff #374989) | I think it's better to merge the tests into sample-hot-func-list.test. This is improving hot func list and the tests also use the same inputs. |
nit: TopN