- Timestamp:
- Nov 19, 2014 2:05:55 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp
r53269 r53351 53 53 { "--hex", 'h', RTGETOPT_REQ_NOTHING }, 54 54 { "--decimal", 'd', RTGETOPT_REQ_NOTHING }, 55 { "--spin", 's', RTGETOPT_REQ_NOTHING } 55 { "--spin", 's', RTGETOPT_REQ_NOTHING }, 56 { "--reference", 'r', RTGETOPT_REQ_UINT64 }, /* reference value of CpuHz, display the 57 * CpuHz deviation in a separate column. */ 56 58 }; 57 59 … … 60 62 bool fSpin = false; 61 63 int ch; 64 uint64_t uCpuHzRef = 0; 62 65 RTGETOPTUNION ValueUnion; 63 66 RTGETOPTSTATE GetState; … … 81 84 case 's': 82 85 fSpin = true; 86 break; 87 88 case 'r': 89 uCpuHzRef = ValueUnion.u64; 83 90 break; 84 91 … … 107 114 g_pSUPGlobalInfoPage->u32Version); 108 115 RTPrintf(fHex 109 ? "tstGIP-2: it: u64NanoTS delta u64TSC UpIntTSC H TransId CpuHz TSC Interval History...\n" 110 : "tstGIP-2: it: u64NanoTS delta u64TSC UpIntTSC H TransId CpuHz TSC Interval History...\n"); 116 ? "tstGIP-2: it: u64NanoTS delta u64TSC UpIntTSC H TransId CpuHz %sTSC Interval History...\n" 117 : "tstGIP-2: it: u64NanoTS delta u64TSC UpIntTSC H TransId CpuHz %sTSC Interval History...\n", 118 uCpuHzRef ? " CpuHzDev " : ""); 111 119 static SUPGIPCPU s_aaCPUs[2][256]; 112 120 for (uint32_t i = 0; i < cIterations; i++) … … 122 130 && g_pSUPGlobalInfoPage->aCPUs[iCpu].u64CpuHz != _4G + 1) 123 131 { 132 char szCpuHzDeviation[32]; 124 133 PSUPGIPCPU pPrevCpu = &s_aaCPUs[!(i & 1)][iCpu]; 125 134 PSUPGIPCPU pCpu = &s_aaCPUs[i & 1][iCpu]; 135 if (uCpuHzRef) 136 { 137 int64_t iCpuHzDeviation = pCpu->u64CpuHz - uCpuHzRef; 138 if (RT_ABS(iCpuHzDeviation) > 999999999) 139 RTStrPrintf(szCpuHzDeviation, sizeof(szCpuHzDeviation), "%10s ", "?"); 140 else 141 RTStrPrintf(szCpuHzDeviation, sizeof(szCpuHzDeviation), "%10RI64 ", iCpuHzDeviation); 142 } 143 else 144 szCpuHzDeviation[0] = '\0'; 126 145 RTPrintf(fHex 127 ? "tstGIP-2: %4d/%d: %016llx %09llx %016llx %08x %d %08x %15llu % 08x %08x %08x %08x %08x %08x %08x %08x (%d)\n"128 : "tstGIP-2: %4d/%d: %016llu %09llu %016llu %010u %d %010u %15llu % 08x %08x %08x %08x %08x %08x %08x %08x (%d)\n",146 ? "tstGIP-2: %4d/%d: %016llx %09llx %016llx %08x %d %08x %15llu %s%08x %08x %08x %08x %08x %08x %08x %08x (%d)\n" 147 : "tstGIP-2: %4d/%d: %016llu %09llu %016llu %010u %d %010u %15llu %s%08x %08x %08x %08x %08x %08x %08x %08x (%d)\n", 129 148 i, iCpu, 130 149 pCpu->u64NanoTS, … … 135 154 pCpu->u32TransactionId, 136 155 pCpu->u64CpuHz, 156 szCpuHzDeviation, 137 157 pCpu->au32TSCHistory[0], 138 158 pCpu->au32TSCHistory[1],
Note:
See TracChangeset
for help on using the changeset viewer.