Changeset 44467 in vbox
- Timestamp:
- Jan 30, 2013 2:47:00 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/darwin/PerformanceDarwin.cpp
r44466 r44467 25 25 #include <iprt/err.h> 26 26 #include <iprt/log.h> 27 #include <iprt/mp.h>28 27 #include <iprt/param.h> 29 28 #include <iprt/system.h> … … 99 98 } 100 99 101 int nCpus = RTMpGetOnlineCount(); 102 Assert(nCpus); 103 if (nCpus) 104 { 105 *user = ((uint64_t)info.cpu_ticks[CPU_STATE_USER] 106 + info.cpu_ticks[CPU_STATE_NICE]) / nCpus; 107 *kernel = ((uint64_t)info.cpu_ticks[CPU_STATE_SYSTEM]) / nCpus; 108 *idle = ((uint64_t)info.cpu_ticks[CPU_STATE_IDLE]) / nCpus; 109 } 110 else 111 { 112 /* It is rather unsual to have no CPUs, but the show must go on. */ 113 *user = (uint64_t)info.cpu_ticks[CPU_STATE_USER] 114 + info.cpu_ticks[CPU_STATE_NICE]; 115 *kernel = (uint64_t)info.cpu_ticks[CPU_STATE_SYSTEM]; 116 *idle = (uint64_t)info.cpu_ticks[CPU_STATE_IDLE]; 117 } 118 100 *user = (uint64_t)info.cpu_ticks[CPU_STATE_USER] 101 + info.cpu_ticks[CPU_STATE_NICE]; 102 *kernel = (uint64_t)info.cpu_ticks[CPU_STATE_SYSTEM]; 103 *idle = (uint64_t)info.cpu_ticks[CPU_STATE_IDLE]; 119 104 return VINF_SUCCESS; 120 105 }
Note:
See TracChangeset
for help on using the changeset viewer.