| 75 | |
| 76 | |
| 77 | void TimerList::PrintStats(ofstream& fout) const |
| 78 | { |
| 79 | if (! TimerList::Used()) |
| 80 | return; |
| 81 | |
| 82 | // Approximate the exclusive times of each function. |
| 83 | // The ab_search_*() functions are recursively nested, |
| 84 | // so subtract out the one below. |
| 85 | // The other ones are subtracted out based on knowledge |
| 86 | // of the functions. |
| 87 | |
| 88 | TimerGroup ABGroup; |
| 89 | ABGroup = timerGroups[0]; |
| 90 | ABGroup.Differentiate(); |
| 91 | for (unsigned g = 1; g < TIMER_NO_SIZE; g++) |
| 92 | ABGroup -= timerGroups[g]; |
| 93 | |
| 94 | Timer ABTotal; |
| 95 | ABGroup.SetNames("AB"); |
| 96 | ABGroup.Sum(ABTotal); |
| 97 | ABTotal.SetName("Sum"); |
| 98 | |
| 99 | Timer sumTotal = ABTotal; |
| 100 | for (unsigned g = 1; g < TIMER_NO_SIZE; g++) |
| 101 | { |
| 102 | Timer t; |
| 103 | timerGroups[g].Sum(t); |
| 104 | sumTotal += t; |
| 105 | } |
| 106 | |
| 107 | fout << timerGroups[0].Header(); |
| 108 | fout << ABGroup.SumLine(sumTotal); |
| 109 | for (unsigned g = 1; g < TIMER_NO_SIZE; g++) |
| 110 | fout << timerGroups[g].SumLine(sumTotal); |
| 111 | fout << timerGroups[0].DashLine(); |
| 112 | fout << sumTotal.SumLine(sumTotal) << endl; |
| 113 | |
| 114 | if (ABGroup.Used()) |
| 115 | { |
| 116 | fout << ABGroup.Header(); |
| 117 | fout << ABGroup.TimerLines(ABTotal); |
| 118 | fout << ABGroup.DashLine(); |
| 119 | fout << ABTotal.SumLine(ABTotal) << endl; |
| 120 | } |
| 121 | |
| 122 | #ifdef DDS_TIMING_DETAILS |
| 123 | fout << timerGroups[0].DetailHeader(); |
| 124 | for (unsigned g = 0; g < TIMER_NO_SIZE; g++) |
| 125 | fout << timerGroups[g].DetailLines(); |
| 126 | fout << endl; |
| 127 | #endif |
| 128 | } |
| 129 |
nothing calls this directly
no test coverage detected