As disscused in https://bugs.llvm.org/show_bug.cgi?id=43219,
i believe it may be somewhat useful to show some aggregates
over all the sea of statistics provided.
Example:
Average Wait times (based on the timeline view):
[0]: Executions
[1]: Average time spent waiting in a scheduler's queue
[2]: Average time spent waiting in a scheduler's queue while ready
[3]: Average time elapsed from WB until retire stage
[0] [1] [2] [3]
0. 3 1.0 1.0 4.7 vmulps %xmm0, %xmm1, %xmm2
1. 3 2.7 0.0 2.3 vhaddps %xmm2, %xmm2, %xmm3
2. 3 6.0 0.0 0.0 vhaddps %xmm3, %xmm3, %xmm4
3 3.2 0.3 2.3 <total>I.e. we average the averages.
You can still use the old signature for this method (see the explanation below):
We know that we are printing the special <total> entry if SourceIndex == Source.size().
You can use that knowledge in two places:
You can do it where you currently added the FIXME comment.
if (!ShouldNumber) { // override Executions for the purpose of changing colors. Executions = Timeline.size() / Source.size(); }Basically you don't need CumulativeExecutions as it can be inferred from the context. That should also fix the issue with the coloring of the output.