Changeset 30581 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Jul 2, 2010 4:02:57 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 63305
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/TMAll.cpp
r29250 r30581 167 167 PVM pVM = pVCpu->CTX_SUFF(pVM); 168 168 169 #ifndef VBOX_WITHOUT_NS_ACCOUNTING 170 pVCpu->tm.s.u64NsTsStartExecuting = RTTimeNanoTS(); 171 #endif 169 172 if (pVM->tm.s.fTSCTiedToExecution) 170 173 tmCpuTickResume(pVM, pVCpu); … … 188 191 if (pVM->tm.s.fTSCTiedToExecution) 189 192 tmCpuTickPause(pVM, pVCpu); 193 194 #ifndef VBOX_WITHOUT_NS_ACCOUNTING 195 uint32_t uGen = ASMAtomicIncU32(&pVCpu->tm.s.uTimesGen); Assert(uGen & 1); 196 uint64_t u64NsTs = RTTimeNanoTS(); 197 pVCpu->tm.s.cNsExecuting += u64NsTs - pVCpu->tm.s.u64NsTsStartExecuting; 198 pVCpu->tm.s.cNsTotal = u64NsTs - pVCpu->tm.s.u64NsTsStartTotal; 199 pVCpu->tm.s.cNsOther = pVCpu->tm.s.cNsTotal - pVCpu->tm.s.cNsExecuting - pVCpu->tm.s.cNsHalted; 200 ASMAtomicWriteU32(&pVCpu->tm.s.uTimesGen, (uGen | 1) + 1); 201 #endif 190 202 } 191 203 … … 204 216 { 205 217 PVM pVM = pVCpu->CTX_SUFF(pVM); 218 219 #ifndef VBOX_WITHOUT_NS_ACCOUNTING 220 pVCpu->tm.s.u64NsTsStartHalting = RTTimeNanoTS(); 221 #endif 206 222 207 223 if ( pVM->tm.s.fTSCTiedToExecution … … 228 244 && !pVM->tm.s.fTSCNotTiedToHalt) 229 245 tmCpuTickPause(pVM, pVCpu); 246 247 #ifndef VBOX_WITHOUT_NS_ACCOUNTING 248 uint32_t uGen = ASMAtomicIncU32(&pVCpu->tm.s.uTimesGen); Assert(uGen & 1); 249 uint64_t u64NsTs = RTTimeNanoTS(); 250 pVCpu->tm.s.cNsHalted += u64NsTs - pVCpu->tm.s.u64NsTsStartHalting; 251 pVCpu->tm.s.cNsTotal = u64NsTs - pVCpu->tm.s.u64NsTsStartTotal; 252 pVCpu->tm.s.cNsOther = pVCpu->tm.s.cNsTotal - pVCpu->tm.s.cNsExecuting - pVCpu->tm.s.cNsHalted; 253 ASMAtomicWriteU32(&pVCpu->tm.s.uTimesGen, (uGen | 1) + 1); 254 #endif 230 255 } 231 256
Note:
See TracChangeset
for help on using the changeset viewer.