Changeset 70018 in vbox
- Timestamp:
- Dec 8, 2017 12:07:41 PM (7 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
-
VMMR3/TM.cpp (modified) (5 diffs)
-
include/TMInternal.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/TM.cpp
r69952 r70018 148 148 #include <iprt/asm-math.h> 149 149 #include <iprt/assert.h> 150 #include <iprt/file.h> 150 151 #include <iprt/thread.h> 151 152 #include <iprt/time.h> … … 347 348 "CatchUpPrecentage8|CatchUpPrecentage9|" 348 349 "UTCOffset|" 350 "UTCTouchFileOnJump|" 349 351 "WarpDrivePercentage|" 350 352 "HostHzMax|" … … 354 356 "HostHzFudgeFactorCatchUp200|" 355 357 "HostHzFudgeFactorCatchUp400|" 356 "TimerMillies", 358 "TimerMillies" 359 , 357 360 "", 358 361 "TM", 0); … … 538 541 return VMSetError(pVM, rc, RT_SRC_POS, 539 542 N_("Configuration error: Failed to querying 64-bit integer value \"UTCOffset\"")); 543 544 /** @cfgm{/TM/UTCTouchFileOnJump, string, none} 545 * File to be written to everytime the host time jumps. */ 546 rc = CFGMR3QueryStringAlloc(pCfgHandle, "UTCTouchFileOnJump", &pVM->tm.s.pszUtcTouchFileOnJump); 547 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 548 pVM->tm.s.pszUtcTouchFileOnJump = NULL; 549 else if (RT_FAILURE(rc)) 550 return VMSetError(pVM, rc, RT_SRC_POS, 551 N_("Configuration error: Failed to querying string value \"UTCTouchFileOnJump\"")); 540 552 541 553 /* … … 2837 2849 int64_t cNsDelta = RTTimeSpecGetNano(pTime) - nsPrev; 2838 2850 if ((uint64_t)RT_ABS(cNsDelta) > RT_NS_1HOUR / 2) 2839 LogRel(("TMR3UtcNow: nsNow=%'RI64 nsPrev=%'RI64 -> cNsDelta=%'RI64 (offLag=%'RI64 offVirtualSync=%'RU64 offVirtualSyncGivenUp=%'RU64)\n", 2840 RTTimeSpecGetNano(pTime), nsPrev, cNsDelta, offLag, offVirtualSync, offVirtualSyncGivenUp)); 2851 { 2852 RTTIMESPEC NowAgain; 2853 RTTimeNow(&NowAgain); 2854 LogRel(("TMR3UtcNow: nsNow=%'RI64 nsPrev=%'RI64 -> cNsDelta=%'RI64 (offLag=%'RI64 offVirtualSync=%'RU64 offVirtualSyncGivenUp=%'RU64, NowAgain=%'RI64)\n", 2855 RTTimeSpecGetNano(pTime), nsPrev, cNsDelta, offLag, offVirtualSync, offVirtualSyncGivenUp, RTTimeSpecGetNano(&NowAgain))); 2856 if (pVM->tm.s.pszUtcTouchFileOnJump && nsPrev != 0) 2857 { 2858 RTFILE hFile; 2859 int rc = RTFileOpen(&hFile, pVM->tm.s.pszUtcTouchFileOnJump, 2860 RTFILE_O_WRITE | RTFILE_O_APPEND | RTFILE_O_OPEN_CREATE | RTFILE_O_DENY_NONE); 2861 if (RT_SUCCESS(rc)) 2862 { 2863 char szMsg[256]; 2864 size_t cch; 2865 cch = RTStrPrintf(szMsg, sizeof(szMsg), 2866 "TMR3UtcNow: nsNow=%'RI64 nsPrev=%'RI64 -> cNsDelta=%'RI64 (offLag=%'RI64 offVirtualSync=%'RU64 offVirtualSyncGivenUp=%'RU64, NowAgain=%'RI64)\n", 2867 RTTimeSpecGetNano(pTime), nsPrev, cNsDelta, offLag, offVirtualSync, offVirtualSyncGivenUp, RTTimeSpecGetNano(&NowAgain)); 2868 RTFileWrite(hFile, szMsg, cch, NULL); 2869 RTFileClose(hFile); 2870 } 2871 } 2872 } 2841 2873 2842 2874 return pTime; -
trunk/src/VBox/VMM/include/TMInternal.h
r69950 r70018 495 495 /** The last value TMR3UtcNow returned. */ 496 496 int64_t volatile nsLastUtcNow; 497 /** File to touch on UTC jump. */ 498 R3PTRTYPE(char *) pszUtcTouchFileOnJump; 499 /** Just to avoid dealing with 32-bit alignment trouble. */ 500 R3PTRTYPE(char *) pszAlignment2b; 497 501 498 502 /** Timer queues for the different clock types - R3 Ptr */
Note:
See TracChangeset
for help on using the changeset viewer.

