/////////////////////////////////////////////////////////////////////
| 118 | |
| 119 | ////////////////////////////////////////////////////////////////////////// |
| 120 | void CLoadingProfilerSystem::OutputLoadingTimeStats(ILog* pLog, int nMode) |
| 121 | { |
| 122 | nLoadingProfileMode = nMode; |
| 123 | |
| 124 | PodArray<SLoadingTimeContainer> arrNoStack; |
| 125 | CreateNoStackList(arrNoStack); |
| 126 | |
| 127 | if (nLoadingProfileMode > 0) |
| 128 | { |
| 129 | // loading mem stats per func |
| 130 | pLog->Log("------ Level loading memory allocations (MB) by function ------------"); |
| 131 | pLog->Log(" ||Self | Total | Calls | Function (%d MB lost)||", nLoadingProfilerNotTrackedAllocations); |
| 132 | pLog->Log("---------------------------------------------------------------------"); |
| 133 | |
| 134 | qsort(arrNoStack.GetElements(), arrNoStack.Count(), sizeof(arrNoStack[0]), SLoadingTimeContainer::Cmp_SLoadingTimeContainer_MemUsage); |
| 135 | |
| 136 | for (int i = 0; i < arrNoStack.Count(); i++) |
| 137 | { |
| 138 | const SLoadingTimeContainer* pTimeContainer = &arrNoStack[i]; |
| 139 | pLog->Log("|%6.1f | %6.1f | %6d | %s|", |
| 140 | pTimeContainer->m_dSelfMemUsage, pTimeContainer->m_dTotalMemUsage, (int)pTimeContainer->m_nCounter, pTimeContainer->m_pFuncName); |
| 141 | } |
| 142 | |
| 143 | pLog->Log("---------------------------------------------------------------------"); |
| 144 | } |
| 145 | |
| 146 | if (nLoadingProfileMode > 0) |
| 147 | { |
| 148 | // loading time stats per func |
| 149 | pLog->Log("----------- Level loading time (sec) by function --------------------"); |
| 150 | pLog->Log(" ||Self | Total | Calls | Function||"); |
| 151 | pLog->Log("---------------------------------------------------------------------"); |
| 152 | |
| 153 | qsort(arrNoStack.GetElements(), arrNoStack.Count(), sizeof(arrNoStack[0]), SLoadingTimeContainer::Cmp_SLoadingTimeContainer_Time); |
| 154 | |
| 155 | for (int i = 0; i < arrNoStack.Count(); i++) |
| 156 | { |
| 157 | const SLoadingTimeContainer* pTimeContainer = &arrNoStack[i]; |
| 158 | pLog->Log("|%6.1f | %6.1f | %6d | %s|", |
| 159 | pTimeContainer->m_dSelfTime, pTimeContainer->m_dTotalTime, (int)pTimeContainer->m_nCounter, pTimeContainer->m_pFuncName); |
| 160 | } |
| 161 | |
| 162 | if (nLoadingProfileMode == 1) |
| 163 | pLog->Log("----- ( Use sys_ProfileLevelLoading 2 for more detailed stats ) -----"); |
| 164 | else |
| 165 | pLog->Log("---------------------------------------------------------------------"); |
| 166 | } |
| 167 | |
| 168 | if (nLoadingProfileMode > 0) |
| 169 | { |
| 170 | // file info |
| 171 | pLog->Log("----------------------------- Level file information by function --------------------------------"); |
| 172 | pLog->Log("|| Self | Total |Bandwith| Calls | Function||"); |
| 173 | pLog->Log("|| Seeks |FileOpen|FileRead| Seeks |FileOpen|FileRead| Kb/s | | ||"); |
| 174 | |
| 175 | qsort(arrNoStack.GetElements(), arrNoStack.Count(), sizeof(arrNoStack[0]), SLoadingTimeContainer::Cmp_SLoadingTimeContainer_Time); |
| 176 | |
| 177 | for (int i = 0; i < arrNoStack.Count(); i++) |
nothing calls this directly
no test coverage detected