Changeset 11180 in vbox for trunk/src/VBox/Main/linux
- Timestamp:
- Aug 6, 2008 3:34:11 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 34200
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/linux/PerformanceLinux.cpp
r10938 r11180 34 34 { 35 35 public: 36 virtual int getHostCpuMHz( unsigned long*mhz);37 virtual int getHostMemoryUsage( unsigned long *total, unsigned long *used, unsigned long*available);38 virtual int getProcessMemoryUsage(RTPROCESS process, unsigned long*used);36 virtual int getHostCpuMHz(ULONG *mhz); 37 virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available); 38 virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used); 39 39 40 40 virtual int getRawHostCpuLoad(uint64_t *user, uint64_t *kernel, uint64_t *idle); 41 41 virtual int getRawProcessCpuLoad(RTPROCESS process, uint64_t *user, uint64_t *kernel, uint64_t *total); 42 42 private: 43 int getRawProcessStats(RTPROCESS process, uint64_t *cpuUser, uint64_t *cpuKernel, unsigned long*memPagesUsed);43 int getRawProcessStats(RTPROCESS process, uint64_t *cpuUser, uint64_t *cpuKernel, ULONG *memPagesUsed); 44 44 }; 45 45 … … 57 57 { 58 58 int rc = VINF_SUCCESS; 59 unsigned longu32user, u32nice, u32kernel, u32idle;59 ULONG u32user, u32nice, u32kernel, u32idle; 60 60 FILE *f = fopen("/proc/stat", "r"); 61 61 … … 86 86 if (RT_SUCCESS(rc)) 87 87 { 88 unsigned longulTmp;88 ULONG ulTmp; 89 89 *total = (uint64_t)uHostUser + uHostKernel + uHostIdle; 90 90 rc = getRawProcessStats(process, user, kernel, &ulTmp); … … 94 94 } 95 95 96 int CollectorLinux::getHostCpuMHz( unsigned long*mhz)96 int CollectorLinux::getHostCpuMHz(ULONG *mhz) 97 97 { 98 98 return E_NOTIMPL; 99 99 } 100 100 101 int CollectorLinux::getHostMemoryUsage( unsigned long *total, unsigned long *used, unsigned long*available)101 int CollectorLinux::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available) 102 102 { 103 103 int rc = VINF_SUCCESS; 104 unsigned longbuffers, cached;104 ULONG buffers, cached; 105 105 FILE *f = fopen("/proc/meminfo", "r"); 106 106 … … 126 126 } 127 127 128 int CollectorLinux::getProcessMemoryUsage(RTPROCESS process, unsigned long*used)128 int CollectorLinux::getProcessMemoryUsage(RTPROCESS process, ULONG *used) 129 129 { 130 130 uint64_t u64Tmp; 131 unsigned longnPagesUsed;131 ULONG nPagesUsed; 132 132 int rc = getRawProcessStats(process, &u64Tmp, &u64Tmp, &nPagesUsed); 133 133 if (RT_SUCCESS(rc)) … … 139 139 } 140 140 141 int CollectorLinux::getRawProcessStats(RTPROCESS process, uint64_t *cpuUser, uint64_t *cpuKernel, unsigned long*memPagesUsed)141 int CollectorLinux::getRawProcessStats(RTPROCESS process, uint64_t *cpuUser, uint64_t *cpuKernel, ULONG *memPagesUsed) 142 142 { 143 143 int rc = VINF_SUCCESS; … … 148 148 uint64_t u64Tmp; 149 149 unsigned uTmp; 150 unsigned longulTmp, u32user, u32kernel;150 ULONG ulTmp, u32user, u32kernel; 151 151 char buf[80]; /* @todo: this should be tied to max allowed proc name. */ 152 152
Note:
See TracChangeset
for help on using the changeset viewer.