Changeset 9469 in vbox for trunk/src/VBox/HostDrivers/Support/testcase
- Timestamp:
- Jun 6, 2008 12:15:22 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp
r8155 r9469 41 41 #include <iprt/thread.h> 42 42 #include <iprt/stream.h> 43 #include <iprt/runtime.h> 43 #include <iprt/initterm.h> 44 #include <iprt/getopt.h> 44 45 45 46 46 int main( void)47 int main(int argc, char **argv) 47 48 { 48 49 RTR3Init(); 50 51 /* 52 * Parse args 53 */ 54 static const RTOPTIONDEF g_aOptions[] = 55 { 56 { "--interations", 'i', RTGETOPT_REQ_INT32 } 57 }; 58 59 uint32_t cIterations = 40; 60 int ch; 61 int iArg = 1; 62 RTOPTIONUNION ValueUnion; 63 while ((ch = RTGetOpt(argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), &iArg, &ValueUnion))) 64 { 65 switch (ch) 66 { 67 case 'i': 68 cIterations = ValueUnion.u32; 69 break; 70 71 default: 72 if (ch < 0) 73 RTPrintf("tstGIP-2: %Rrc: %s\n", ch, ValueUnion.psz); 74 else 75 RTPrintf("tstGIP-2: syntax error: %s\n", ValueUnion.psz); 76 return 1; 77 } 78 } 79 if (iArg < argc) 80 { 81 RTPrintf("tstGIP-2: syntax error: %s\n", ValueUnion.psz); 82 return 1; 83 } 49 84 50 85 /* … … 58 93 { 59 94 RTPrintf("tstGIP-2: u32UpdateHz=%RU32 u32UpdateIntervalNS=%RU32 u64NanoTSLastUpdateHz=%RX64 u32Mode=%d (%s) u32Version=%#x\n" 60 "tstGIP-2: it: u64NanoTS u64TSC UpIntTSC H TransId CpuHz TSC Interval History...\n",95 "tstGIP-2: it: u64NanoTS u64TSC UpIntTSC H TransId CpuHz TSC Interval History...\n", 61 96 g_pSUPGlobalInfoPage->u32UpdateHz, 62 97 g_pSUPGlobalInfoPage->u32UpdateIntervalNS, 63 g_pSUPGlobalInfoPage->u64NanoTSLastUpdateHz, 98 g_pSUPGlobalInfoPage->u64NanoTSLastUpdateHz, 64 99 g_pSUPGlobalInfoPage->u32Mode, 65 100 g_pSUPGlobalInfoPage->u32Mode == SUPGIPMODE_SYNC_TSC ? "sync" … … 67 102 : "???", 68 103 g_pSUPGlobalInfoPage->u32Version); 69 for (int i = 0; i < 80; i++)104 for (int i = 0; i < cIterations; i++) 70 105 { 71 106 for (unsigned iCpu = 0; iCpu < RT_ELEMENTS(g_pSUPGlobalInfoPage->aCPUs); iCpu++) 72 if ( g_pSUPGlobalInfoPage->aCPUs[iCpu].u64CpuHz > 0 107 if ( g_pSUPGlobalInfoPage->aCPUs[iCpu].u64CpuHz > 0 73 108 && g_pSUPGlobalInfoPage->aCPUs[iCpu].u64CpuHz != _4G + 1) 74 RTPrintf("tstGIP-2: % 2d/%d: %016llx %016llx %08x %d %08x %15llu %08x %08x %08x %08x %08x %08x %08x %08x (%d)\n",109 RTPrintf("tstGIP-2: %4d/%d: %016llx %016llx %08x %d %08x %15llu %08x %08x %08x %08x %08x %08x %08x %08x (%d)\n", 75 110 i, iCpu, 76 111 g_pSUPGlobalInfoPage->aCPUs[iCpu].u64NanoTS, … … 87 122 g_pSUPGlobalInfoPage->aCPUs[iCpu].au32TSCHistory[5], 88 123 g_pSUPGlobalInfoPage->aCPUs[iCpu].au32TSCHistory[6], 89 g_pSUPGlobalInfoPage->aCPUs[iCpu].au32TSCHistory[7], 124 g_pSUPGlobalInfoPage->aCPUs[iCpu].au32TSCHistory[7], 90 125 g_pSUPGlobalInfoPage->aCPUs[iCpu].cErrors); 91 126 RTThreadSleep(9);
Note:
See TracChangeset
for help on using the changeset viewer.