VirtualBox

Changeset 53356 in vbox for trunk/src


Ignore:
Timestamp:
Nov 20, 2014 11:32:43 AM (10 years ago)
Author:
vboxsync
Message:

tstGIP-2: use reference CPU for determining the relative CpuHz deviation; determine the overall CpuHz deviation

File:
1 edited

Legend:

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

    r53355 r53356  
    6363    int ch;
    6464    uint64_t uCpuHzRef = 0;
     65    uint64_t uCpuHzOverallDeviation = 0;
    6566    RTGETOPTUNION ValueUnion;
    6667    RTGETOPTSTATE GetState;
     
    137138                        {
    138139                            int64_t iCpuHzDeviation = pCpu->u64CpuHz - uCpuHzRef;
    139                             if (RT_ABS(iCpuHzDeviation) > 999999999)
     140                            uint64_t uCpuHzDeviation = RT_ABS(iCpuHzDeviation);
     141                            if (uCpuHzDeviation > 999999999)
    140142                                RTStrPrintf(szCpuHzDeviation, sizeof(szCpuHzDeviation), "%17s  ", "?");
    141143                            else
    142144                            {
    143                                 uint32_t uPct = (uint32_t)(RT_ABS(iCpuHzDeviation) * 100000 / pCpu->u64CpuHz + 5);
     145                                uCpuHzOverallDeviation += uCpuHzDeviation;
     146                                uint32_t uPct = (uint32_t)(uCpuHzDeviation * 100000 / uCpuHzRef + 5);
    144147                                RTStrPrintf(szCpuHzDeviation, sizeof(szCpuHzDeviation), "%10RI64%3d.%02d%%  ",
    145148                                            iCpuHzDeviation, uPct / 1000, (uPct % 1000) / 10);
     
    213216                if (g_pSUPGlobalInfoPage->aCPUs[iCpu].idApic == UINT16_MAX)
    214217                    RTPrintf("tstGIP-2: offline: %lld\n", g_pSUPGlobalInfoPage->aCPUs[iCpu].i64TSCDelta);
     218           
     219            if (uCpuHzRef)
     220            {
     221                uint32_t uPct = (uint32_t)(uCpuHzOverallDeviation * 100000 / cIterations / g_pSUPGlobalInfoPage->cCpus / uCpuHzRef + 5);
     222                RTPrintf("tstGIP-2: Overall CpuHz deviation: %d.%02d%%\n", uPct / 1000, (uPct % 1000) / 10);
     223            }
    215224        }
    216225        else
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