Changeset 44475 in vbox for trunk/src/VBox/Main/src-server/darwin/PerformanceDarwin.cpp
- Timestamp:
- Jan 30, 2013 6:59:04 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/darwin/PerformanceDarwin.cpp
r44467 r44475 25 25 #include <iprt/err.h> 26 26 #include <iprt/log.h> 27 #include <iprt/mp.h> 27 28 #include <iprt/param.h> 28 29 #include <iprt/system.h> … … 66 67 private: 67 68 ULONG totalRAM; 69 uint32_t nCpus; 68 70 }; 69 71 … … 81 83 else 82 84 totalRAM = (ULONG)(cb / 1024); 85 nCpus = RTMpGetOnlineCount(); 86 Assert(nCpus); 87 if (nCpus == 0) 88 { 89 /* It is rather unsual to have no CPUs, but the show must go on. */ 90 nCpus = 1; 91 } 83 92 } 84 93 … … 143 152 if (RT_SUCCESS(rc)) 144 153 { 145 *user = tinfo.pti_total_user; 146 *kernel = tinfo.pti_total_system; 154 /* 155 * Adjust user and kernel values so 100% is when ALL cores are fully 156 * utilized (see @bugref{6345}). 157 */ 158 *user = tinfo.pti_total_user / nCpus; 159 *kernel = tinfo.pti_total_system / nCpus; 147 160 *total = mach_absolute_time(); 148 161 }
Note:
See TracChangeset
for help on using the changeset viewer.