VirtualBox

Changeset 56994 in vbox for trunk/src/VBox/Main/testcase


Ignore:
Timestamp:
Jul 18, 2015 11:15:01 PM (10 years ago)
Author:
vboxsync
Message:

Main: Log and assert formatting fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/testcase/tstCollector.cpp

    r51965 r56994  
    5151
    5252#define N_CALLS(n, fn) \
     53  do {\
    5354    for (int call = 0; call < n; ++call) \
    5455        rc = collector->fn; \
    5556    if (RT_FAILURE(rc)) \
    56         RTPrintf("tstCollector: "#fn" -> %Rrc\n", rc)
    57 
    58 #define CALLS_PER_SECOND(fn) \
     57        RTPrintf("tstCollector: "#fn" -> %Rrc\n", rc); \
     58  } while (0)
     59
     60#define CALLS_PER_SECOND(fn, args) \
     61  do { \
    5962    nCalls = 0; \
    6063    start = RTTimeMilliTS(); \
    6164    do { \
    62         rc = collector->fn; \
     65        rc = collector->fn args; \
    6366        if (RT_FAILURE(rc)) \
    6467            break; \
     
    6669    } while (RTTimeMilliTS() - start < RUN_TIME_MS); \
    6770    if (RT_FAILURE(rc)) \
    68     { \
    6971        RTPrintf("tstCollector: "#fn" -> %Rrc\n", rc); \
    70     } \
    7172    else \
    72         RTPrintf("%70s -- %u calls per second\n", #fn, nCalls)
     73        RTPrintf("%70s -- %u calls per second\n", #fn, nCalls); \
     74  } while (0)
    7375
    7476void measurePerformance(pm::CollectorHAL *collector, const char *pszName, int cVMs)
     
    106108    unsigned int nCalls;
    107109    /* Pre-collect */
    108     CALLS_PER_SECOND(preCollect(hints, 0));
     110    CALLS_PER_SECOND(preCollect, (hints, 0));
    109111    /* Host CPU load */
    110     CALLS_PER_SECOND(getRawHostCpuLoad(&tmp64, &tmp64, &tmp64));
     112    CALLS_PER_SECOND(getRawHostCpuLoad, (&tmp64, &tmp64, &tmp64));
    111113    /* Process CPU load */
    112     CALLS_PER_SECOND(getRawProcessCpuLoad(processes[nCalls%cVMs], &tmp64, &tmp64, &tmp64));
     114    CALLS_PER_SECOND(getRawProcessCpuLoad, (processes[nCalls % cVMs], &tmp64, &tmp64, &tmp64));
    113115    /* Host CPU speed */
    114     CALLS_PER_SECOND(getHostCpuMHz(&tmp));
     116    CALLS_PER_SECOND(getHostCpuMHz, (&tmp));
    115117    /* Host RAM usage */
    116     CALLS_PER_SECOND(getHostMemoryUsage(&tmp, &tmp, &tmp));
     118    CALLS_PER_SECOND(getHostMemoryUsage, (&tmp, &tmp, &tmp));
    117119    /* Process RAM usage */
    118     CALLS_PER_SECOND(getProcessMemoryUsage(processes[nCalls%cVMs], &tmp));
     120    CALLS_PER_SECOND(getProcessMemoryUsage, (processes[nCalls % cVMs], &tmp));
    119121
    120122    start = RTTimeNanoTS();
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