VirtualBox

Ignore:
Timestamp:
Jul 23, 2015 1:18:58 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101781
Message:

testcase/tstGIP-2: Allow continuous comparison of computed GIP TSC frequency with a supplied reference value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp

    r56293 r57060  
    8484    bool fHex = true;
    8585    bool fSpin = false;
     86    bool fCompat = true;
    8687    int ch;
    8788    uint64_t uCpuHzRef = 0;
    8889    uint64_t uCpuHzOverallDeviation = 0;
     90    uint32_t cCpuHzNotCompat = 0;
    8991    int64_t  iCpuHzMaxDeviation = 0;
    90     int32_t cCpuHzOverallDevCnt = 0;
     92    int32_t  cCpuHzOverallDevCnt = 0;
    9193    RTGETOPTUNION ValueUnion;
    9294    RTGETOPTSTATE GetState;
     
    143145                     ? "tstGIP-2:     it: u64NanoTS        delta     u64TSC           UpIntTSC H  TransId      CpuHz      %sTSC Interval History...\n"
    144146                     : "tstGIP-2:     it: u64NanoTS        delta     u64TSC             UpIntTSC H    TransId      CpuHz      %sTSC Interval History...\n",
    145                      uCpuHzRef ? "  CpuHz deviation  " : "");
     147                     uCpuHzRef ? "  CpuHz deviation  Compat  " : "");
    146148            static SUPGIPCPU s_aaCPUs[2][256];
    147149            for (uint32_t i = 0; i < cIterations; i++)
     
    175177                                    cCpuHzOverallDevCnt++;
    176178                                }
     179                                bool fCurHzCompat = SUPIsTscFreqCompatibleEx(uCpuHzRef, pCpu->u64CpuHz, false /* fRelax */);
    177180                                uint32_t uPct = (uint32_t)(uCpuHzDeviation * 100000 / uCpuHzRef + 5);
    178                                 RTStrPrintf(szCpuHzDeviation, sizeof(szCpuHzDeviation), "%10RI64%3d.%02d%%  ",
    179                                             iCpuHzDeviation, uPct / 1000, (uPct % 1000) / 10);
     181                                RTStrPrintf(szCpuHzDeviation, sizeof(szCpuHzDeviation), "%10RI64%3d.%02d%%  %RTbool   ",
     182                                            iCpuHzDeviation, uPct / 1000, (uPct % 1000) / 10, fCurHzCompat);
     183                                if (!fCurHzCompat)
     184                                    ++cCpuHzNotCompat;
     185                                fCompat &= fCurHzCompat;
    180186                            }
    181187                        }
     
    262268                RTPrintf("tstGIP-2: Maximum CpuHz deviation: %d.%02d%% (%RI64 ticks)\n",
    263269                         uMaxPct / 1000, (uMaxPct % 1000) / 10, iCpuHzMaxDeviation);
     270
     271                RTPrintf("tstGIP-2: CpuHz compatibility: %RTbool (incompatible %u of %u times w/ %RU64 Hz)\n", fCompat,
     272                         cCpuHzNotCompat, cIterations * g_pSUPGlobalInfoPage->cCpus, uCpuHzRef);
    264273            }
    265274        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette