- Timestamp:
- Aug 19, 2008 6:50:33 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Performance.cpp
r11481 r11498 25 25 * @todo list: 26 26 * 27 * 1) Solaris backend 28 * 2) Linux backend 29 * 3) Detection of erroneous metric names 30 * 4) Min/max ranges for metrics 31 * 5) Darwin backend 32 * 6) [OS/2 backend] 27 * 1) Detection of erroneous metric names 28 * 2) Wildcards in metric names 29 * 3) Darwin backend 30 * 4) [OS/2 backend] 33 31 */ 34 32 … … 39 37 #include <iprt/string.h> 40 38 #include <iprt/mem.h> 39 #include <iprt/mp.h> 41 40 42 41 #include "Logging.h" … … 93 92 { 94 93 return E_NOTIMPL; 94 } 95 96 /* Generic implementations */ 97 98 int CollectorHAL::getHostCpuMHz(ULONG *mhz) 99 { 100 RTCPUID nProcessors = RTMpGetCount(); 101 102 if (nProcessors == 0) 103 return VERR_NOT_IMPLEMENTED; 104 105 uint64_t uTotalMHz = 0; 106 107 for (RTCPUID i = 0; i < nProcessors; ++i) 108 uTotalMHz += RTMpGetCurFrequency(RTMpCpuIdFromSetIndex(i)); 109 110 *mhz = (ULONG)(uTotalMHz / nProcessors); 111 return VINF_SUCCESS; 95 112 } 96 113 -
trunk/src/VBox/Main/include/Performance.h
r11377 r11498 67 67 public: 68 68 virtual int getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle); 69 virtual int getHostCpuMHz(ULONG *mhz) = 0;69 virtual int getHostCpuMHz(ULONG *mhz); 70 70 virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available) = 0; 71 71 virtual int getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel); -
trunk/src/VBox/Main/linux/PerformanceLinux.cpp
r11483 r11498 25 25 #include <iprt/alloc.h> 26 26 #include <iprt/err.h> 27 #include <iprt/mp.h>28 27 #include <iprt/param.h> 29 28 #include <iprt/string.h> … … 35 34 { 36 35 public: 37 virtual int getHostCpuMHz(ULONG *mhz);38 36 virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available); 39 37 virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used); … … 93 91 94 92 return rc; 95 }96 97 int CollectorLinux::getHostCpuMHz(ULONG *mhz)98 {99 RTCPUID nProcessors = RTMpGetCount();100 uint64_t uTotalMHz = 0;101 102 for (RTCPUID i = 0; i < nProcessors; ++i)103 uTotalMHz += RTMpGetCurFrequency(RTMpCpuIdFromSetIndex(i));104 105 *mhz = (ULONG)(uTotalMHz / nProcessors);106 return VINF_SUCCESS;107 93 } 108 94
Note:
See TracChangeset
for help on using the changeset viewer.