Changeset 19970 in vbox
- Timestamp:
- May 24, 2009 4:22:00 PM (16 years ago)
- Location:
- trunk/src/VBox/Runtime/testcase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemption.cpp
r19966 r19970 98 98 if (ASMGetFlags() & X86_EFL_IF) 99 99 { 100 uint64_t u64StartTS = RTTimeSystemNanoTS(); 100 uint64_t u64StartSysTS = RTTimeSystemNanoTS(); 101 uint64_t u64StartTS = RTTimeNanoTS(); 101 102 uint64_t cLoops = 0; 103 uint64_t cNanosSysElapsed; 102 104 uint64_t cNanosElapsed; 103 105 bool fPending; 104 106 do 105 107 { 106 fPending = RTThreadPreemptIsPending(NIL_RTTHREAD); 107 cNanosElapsed = RTTimeSystemNanoTS() - u64StartTS; 108 fPending = RTThreadPreemptIsPending(NIL_RTTHREAD); 109 cNanosElapsed = RTTimeNanoTS() - u64StartTS; 110 cNanosSysElapsed = RTTimeSystemNanoTS() - u64StartSysTS; 108 111 cLoops++; 109 112 } while ( !fPending 110 && cNanosElapsed < UINT64_C(2)*1000U*1000U*1000U 111 && cLoops < 100U*_1M); 113 && cNanosElapsed < UINT64_C(2)*1000U*1000U*1000U 114 && cNanosSysElapsed < UINT64_C(2)*1000U*1000U*1000U 115 && cLoops < 100U*_1M); 112 116 if (!fPending) 113 RTStrPrintf(pszErr, cchErr, "!Preempt not pending after %'llu loops / %'llu ns ",114 cLoops, cNanosElapsed );117 RTStrPrintf(pszErr, cchErr, "!Preempt not pending after %'llu loops / %'llu ns / %'llu ns (sys)", 118 cLoops, cNanosElapsed, cNanosSysElapsed); 115 119 else if (cLoops == 1) 116 RTStrPrintf(pszErr, cchErr, "!cLoops= 0\n");120 RTStrPrintf(pszErr, cchErr, "!cLoops=1\n"); 117 121 else 118 RTStrPrintf(pszErr, cchErr, "RTThreadPreemptIsPending returned true after %'llu loops / %'llu ns ",119 cLoops, cNanosElapsed );122 RTStrPrintf(pszErr, cchErr, "RTThreadPreemptIsPending returned true after %'llu loops / %'llu ns / %'llu ns (sys)", 123 cLoops, cNanosElapsed, cNanosSysElapsed); 120 124 } 121 125 else -
trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemptionDriver.cpp
r19940 r19970 145 145 return RTTestSummaryAndDestroy(hTest); 146 146 if (Req.szMsg[0] == '!') 147 { 147 { 148 148 RTTestIFailed("%s", &Req.szMsg[1]); 149 149 return RTTestSummaryAndDestroy(hTest); … … 163 163 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstR0ThreadPreemption", sizeof("tstR0ThreadPreemption") - 1, 164 164 TSTR0THREADPREMEPTION_IS_PENDING, 0, &Req.Hdr), VINF_SUCCESS); 165 if ( strcmp(Req.szMsg, "cLoops= 0\n")165 if ( strcmp(Req.szMsg, "cLoops=1\n") 166 166 || i >= 64) 167 167 { … … 177 177 178 178 /* 179 * Stay in ring-0 until preemption is pending.179 * Test nested RTThreadPreemptDisable calls. 180 180 */ 181 181 RTTestSub(hTest, "Nested");
Note:
See TracChangeset
for help on using the changeset viewer.