VirtualBox

Changeset 93302 in vbox for trunk


Ignore:
Timestamp:
Jan 18, 2022 11:25:24 AM (3 years ago)
Author:
vboxsync
Message:

ValKit: VC++ 19.2 update 11 build adjustments (uint64_t -> double conversions). bugref:8489

Location:
trunk/src/VBox/ValidationKit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testboxscript/TestBoxHelper.cpp

    r93115 r93302  
    146146                        uint64_t cNsInterval = nsNow - nsStat;
    147147                        uint64_t cbInterval  = cbWritten - cbStatWritten;
    148                         uint64_t cbIntervalPerSec = cbInterval ? (uint64_t)(cbInterval / (cNsInterval / (double)RT_NS_1SEC)) : 0;
     148                        uint64_t cbIntervalPerSec = !cbInterval ? 0
     149                                                  : (uint64_t)((double)cbInterval / ((double)cNsInterval / (double)RT_NS_1SEC));
    149150
    150151                        RTPrintf("%s: %'9RTfoff MiB out of %'9RTfoff are free after writing %'9RU64 MiB (%'5RU64 MiB/s)\n",
     
    173174            /* Issue a summary statements. */
    174175            uint64_t cNsElapsed = RTTimeNanoTS() - nsStart;
    175             uint64_t cbPerSec   = cbWritten ? (uint64_t)(cbWritten / (cNsElapsed / (double)RT_NS_1SEC)) : 0;
     176            uint64_t cbPerSec   = cbWritten ? (uint64_t)((double)cbWritten / ((double)cNsElapsed / (double)RT_NS_1SEC)) : 0;
    176177            RTPrintf("%s: Wrote %'RU64 MiB in %'RU64 s, avg %'RU64 MiB/s.\n",
    177178                     pszFilename, cbWritten / _1M, cNsElapsed / RT_NS_1SEC, cbPerSec / _1M);
  • trunk/src/VBox/ValidationKit/utils/cpu/cpu-alloc-all-mem.cpp

    r93115 r93302  
    153153                uPrintTS = uEndTS;
    154154
    155                 uint32_t cMBPerSec = (uint32_t)(cbTotal / ((double)cNsElapsed / RT_NS_1SEC) / _1M);
     155                uint32_t cMBPerSec = (uint32_t)((long double)cbTotal / ((long double)cNsElapsed / RT_NS_1SEC) / _1M);
    156156                RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "%'zu bytes in %'llu ns - %'u MB/s\n",
    157157                             cbTotal, cNsElapsed, cMBPerSec);
     
    189189    RTTestValue(hTest, "amount", cbTotal, RTTESTUNIT_BYTES);
    190190    RTTestValue(hTest, "time",   cNsElapsed, RTTESTUNIT_NS);
    191     uint32_t cMBPerSec = (uint32_t)(cbTotal / ((double)cNsElapsed / RT_NS_1SEC) / _1M);
     191    uint32_t cMBPerSec = (uint32_t)((long double)cbTotal / ((long double)cNsElapsed / RT_NS_1SEC) / _1M);
    192192    RTTestValue(hTest, "speed",  cMBPerSec, RTTESTUNIT_MEGABYTES_PER_SEC);
    193193    RTTestSubDone(hTest);
  • trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp

    r93115 r93302  
    45084508        RTTestIValueF(ns / iIteration, \
    45094509                      RTTESTUNIT_NS_PER_OCCURRENCE, a_szOperation "/seq/%RU32 latency", cbBlock); \
    4510         RTTestIValueF((uint64_t)((uint64_t)iIteration * cbBlock / ((double)ns / RT_NS_1SEC)), \
     4510        RTTestIValueF((uint64_t)((double)(iIteration * cbBlock) / ((double)ns / RT_NS_1SEC)), \
    45114511                      RTTESTUNIT_BYTES_PER_SEC,     a_szOperation "/seq/%RU32 throughput", cbBlock); \
    45124512        RTTestIValueF(iIteration, \
     
    61066106                RTTestIValueF(ns / iIteration, \
    61076107                              RTTESTUNIT_NS_PER_OCCURRENCE, a_szOperation " latency"); \
    6108                 RTTestIValueF((uint64_t)((uint64_t)iIteration * cbFile / ((double)ns / RT_NS_1SEC)), \
     6108                RTTestIValueF((uint64_t)((double)(iIteration * cbFile) / ((double)ns / RT_NS_1SEC)), \
    61096109                              RTTESTUNIT_BYTES_PER_SEC,     a_szOperation " throughput"); \
    61106110                RTTestIValueF((uint64_t)iIteration * cbFile, \
  • trunk/src/VBox/ValidationKit/utils/network/NetPerf.cpp

    r93115 r93302  
    489489        RTTestIValue("Sends",               pSendStats->cTx,              RTTESTUNIT_PACKETS);
    490490        RTTestIValue("Send Interval",       pSendStats->cNsElapsed,       RTTESTUNIT_NS);
    491         RTTestIValue("Send Throughput",     (uint64_t)(cbPacket * pSendStats->cTx / rdSecElapsed), RTTESTUNIT_BYTES_PER_SEC);
    492         RTTestIValue("Send Rate",           (uint64_t)(pSendStats->cTx / rdSecElapsed),  RTTESTUNIT_PACKETS_PER_SEC);
    493         RTTestIValue("Send Latency",        (uint64_t)(rdSecElapsed / pSendStats->cTx * 1000000000.0), RTTESTUNIT_NS_PER_PACKET);
     491        RTTestIValue("Send Throughput",     (uint64_t)((double)(cbPacket * pSendStats->cTx) / rdSecElapsed), RTTESTUNIT_BYTES_PER_SEC);
     492        RTTestIValue("Send Rate",           (uint64_t)((double)pSendStats->cTx / rdSecElapsed),  RTTESTUNIT_PACKETS_PER_SEC);
     493        RTTestIValue("Send Latency",        (uint64_t)(rdSecElapsed / (double)pSendStats->cTx * 1000000000.0), RTTESTUNIT_NS_PER_PACKET);
    494494    }
    495495
     
    499499        RTTestIValue("Receives",            pRecvStats->cRx,              RTTESTUNIT_PACKETS);
    500500        RTTestIValue("Receive Interval",    pRecvStats->cNsElapsed,       RTTESTUNIT_NS);
    501         RTTestIValue("Receive Throughput",  (uint64_t)(cbPacket * pRecvStats->cRx / rdSecElapsed), RTTESTUNIT_BYTES_PER_SEC);
    502         RTTestIValue("Receive Rate",        (uint64_t)(pRecvStats->cRx / rdSecElapsed),  RTTESTUNIT_PACKETS_PER_SEC);
    503         RTTestIValue("Receive Latency",     (uint64_t)(rdSecElapsed / pRecvStats->cRx * 1000000000.0), RTTESTUNIT_NS_PER_PACKET);
     501        RTTestIValue("Receive Throughput",  (uint64_t)((double)(cbPacket * pRecvStats->cRx) / rdSecElapsed), RTTESTUNIT_BYTES_PER_SEC);
     502        RTTestIValue("Receive Rate",        (uint64_t)((double)pRecvStats->cRx / rdSecElapsed),  RTTESTUNIT_PACKETS_PER_SEC);
     503        RTTestIValue("Receive Latency",     (uint64_t)(rdSecElapsed / (double)pRecvStats->cRx * 1000000000.0), RTTESTUNIT_NS_PER_PACKET);
    504504    }
    505505}
     
    755755    RTTestIValue("Interval",            pStats->cNsElapsed,      RTTESTUNIT_NS);
    756756    RTTestIValue("Packet size",         cbPacket,                RTTESTUNIT_BYTES);
    757     RTTestIValue("Average rate",        (uint64_t)(pStats->cEchos / rdSecElapsed),  RTTESTUNIT_PACKETS_PER_SEC);
    758     RTTestIValue("Average throughput",  (uint64_t)(cbPacket * pStats->cEchos / rdSecElapsed), RTTESTUNIT_BYTES_PER_SEC);
    759     RTTestIValue("Average latency",     (uint64_t)(rdSecElapsed / pStats->cEchos * 1000000000.0), RTTESTUNIT_NS_PER_ROUND_TRIP);
     757    RTTestIValue("Average rate",        (uint64_t)((double)pStats->cEchos / rdSecElapsed),  RTTESTUNIT_PACKETS_PER_SEC);
     758    RTTestIValue("Average throughput",  (uint64_t)((double)(cbPacket * pStats->cEchos) / rdSecElapsed), RTTESTUNIT_BYTES_PER_SEC);
     759    RTTestIValue("Average latency",     (uint64_t)(rdSecElapsed / (double)pStats->cEchos * 1000000000.0), RTTESTUNIT_NS_PER_ROUND_TRIP);
    760760    RTTestISubDone();
    761761}
  • trunk/src/VBox/ValidationKit/utils/nt/nttimesources.cpp

    r93115 r93302  
    212212        /* Recalc to micro seconds. */
    213213        uint64_t u64MicroSecMs  = (uint64_t)cMsTicks * 1000;
    214         uint64_t u64MicroSecTsc = u64TscHz ? (long double)cTscTicks /       u64TscHz * 1000000 : u64MicroSecMs;
     214        uint64_t u64MicroSecTsc = u64TscHz ? (long double)cTscTicks / (long double)u64TscHz       * 1000000 : u64MicroSecMs;
     215        uint64_t u64MicroSecPrf =   (long double)cPrfTicks.QuadPart / (long double)PrfHz.QuadPart * 1000000;
    215216        uint64_t u64MicroSecInt = cIntTicks.QuadPart / 10; /* 100ns units*/
    216         uint64_t u64MicroSecPrf =   (long double)cPrfTicks.QuadPart / PrfHz.QuadPart * 1000000;
    217217
    218218        /* check how much they differ using the millisecond tick count as the standard candle. */
  • trunk/src/VBox/ValidationKit/utils/storage/IoPerf.cpp

    r93115 r93302  
    816816
    817817        /* Get average bandwidth for the job. */
    818         RTTestIValueF((uint64_t)(pJob->cbTestSet / ((double)nsJobRuntime / RT_NS_1SEC)),
     818        RTTestIValueF((uint64_t)((double)pJob->cbTestSet / ((double)nsJobRuntime / RT_NS_1SEC)),
    819819                       RTTESTUNIT_BYTES_PER_SEC, "%s/Job/%RU32/AvgBandwidth", pszTest, pJob->idJob);
    820820
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