Changeset 56994 in vbox for trunk/src/VBox/Main/testcase
- Timestamp:
- Jul 18, 2015 11:15:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/tstCollector.cpp
r51965 r56994 51 51 52 52 #define N_CALLS(n, fn) \ 53 do {\ 53 54 for (int call = 0; call < n; ++call) \ 54 55 rc = collector->fn; \ 55 56 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 { \ 59 62 nCalls = 0; \ 60 63 start = RTTimeMilliTS(); \ 61 64 do { \ 62 rc = collector->fn ; \65 rc = collector->fn args; \ 63 66 if (RT_FAILURE(rc)) \ 64 67 break; \ … … 66 69 } while (RTTimeMilliTS() - start < RUN_TIME_MS); \ 67 70 if (RT_FAILURE(rc)) \ 68 { \69 71 RTPrintf("tstCollector: "#fn" -> %Rrc\n", rc); \ 70 } \71 72 else \ 72 RTPrintf("%70s -- %u calls per second\n", #fn, nCalls) 73 RTPrintf("%70s -- %u calls per second\n", #fn, nCalls); \ 74 } while (0) 73 75 74 76 void measurePerformance(pm::CollectorHAL *collector, const char *pszName, int cVMs) … … 106 108 unsigned int nCalls; 107 109 /* Pre-collect */ 108 CALLS_PER_SECOND(preCollect (hints, 0));110 CALLS_PER_SECOND(preCollect, (hints, 0)); 109 111 /* Host CPU load */ 110 CALLS_PER_SECOND(getRawHostCpuLoad (&tmp64, &tmp64, &tmp64));112 CALLS_PER_SECOND(getRawHostCpuLoad, (&tmp64, &tmp64, &tmp64)); 111 113 /* 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)); 113 115 /* Host CPU speed */ 114 CALLS_PER_SECOND(getHostCpuMHz (&tmp));116 CALLS_PER_SECOND(getHostCpuMHz, (&tmp)); 115 117 /* Host RAM usage */ 116 CALLS_PER_SECOND(getHostMemoryUsage (&tmp, &tmp, &tmp));118 CALLS_PER_SECOND(getHostMemoryUsage, (&tmp, &tmp, &tmp)); 117 119 /* Process RAM usage */ 118 CALLS_PER_SECOND(getProcessMemoryUsage (processes[nCalls%cVMs], &tmp));120 CALLS_PER_SECOND(getProcessMemoryUsage, (processes[nCalls % cVMs], &tmp)); 119 121 120 122 start = RTTimeNanoTS();
Note:
See TracChangeset
for help on using the changeset viewer.