Changeset 11180 in vbox for trunk/src/VBox
- Timestamp:
- Aug 6, 2008 3:34:11 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 34200
- Location:
- trunk/src/VBox/Main
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Performance.cpp
r10873 r11180 75 75 // Stubs for non-pure virtual methods 76 76 77 int CollectorHAL::getHostCpuLoad( unsigned long *user, unsigned long *kernel, unsigned long*idle)77 int CollectorHAL::getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle) 78 78 { 79 79 return E_NOTIMPL; 80 80 } 81 81 82 int CollectorHAL::getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long*kernel)82 int CollectorHAL::getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel) 83 83 { 84 84 return E_NOTIMPL; … … 114 114 }*/ 115 115 116 void HostCpuLoad::init( unsigned long period, unsigned longlength)116 void HostCpuLoad::init(ULONG period, ULONG length) 117 117 { 118 118 mPeriod = period; … … 125 125 void HostCpuLoad::collect() 126 126 { 127 unsigned longuser, kernel, idle;127 ULONG user, kernel, idle; 128 128 int rc = mHAL->getHostCpuLoad(&user, &kernel, &idle); 129 129 if (RT_SUCCESS(rc)) … … 159 159 else 160 160 { 161 mUser->put(( unsigned long)(PM_CPU_LOAD_MULTIPLIER * userDiff / totalDiff));162 mKernel->put(( unsigned long)(PM_CPU_LOAD_MULTIPLIER * kernelDiff / totalDiff));163 mIdle->put(( unsigned long)(PM_CPU_LOAD_MULTIPLIER * idleDiff / totalDiff));161 mUser->put((ULONG)(PM_CPU_LOAD_MULTIPLIER * userDiff / totalDiff)); 162 mKernel->put((ULONG)(PM_CPU_LOAD_MULTIPLIER * kernelDiff / totalDiff)); 163 mIdle->put((ULONG)(PM_CPU_LOAD_MULTIPLIER * idleDiff / totalDiff)); 164 164 } 165 165 … … 170 170 } 171 171 172 void HostCpuMhz::init( unsigned long period, unsigned longlength)172 void HostCpuMhz::init(ULONG period, ULONG length) 173 173 { 174 174 mPeriod = period; … … 179 179 void HostCpuMhz::collect() 180 180 { 181 unsigned longmhz;181 ULONG mhz; 182 182 int rc = mHAL->getHostCpuMHz(&mhz); 183 183 if (RT_SUCCESS(rc)) … … 185 185 } 186 186 187 void HostRamUsage::init( unsigned long period, unsigned longlength)187 void HostRamUsage::init(ULONG period, ULONG length) 188 188 { 189 189 mPeriod = period; … … 196 196 void HostRamUsage::collect() 197 197 { 198 unsigned longtotal, used, available;198 ULONG total, used, available; 199 199 int rc = mHAL->getHostMemoryUsage(&total, &used, &available); 200 200 if (RT_SUCCESS(rc)) … … 208 208 209 209 210 void MachineCpuLoad::init( unsigned long period, unsigned longlength)210 void MachineCpuLoad::init(ULONG period, ULONG length) 211 211 { 212 212 mPeriod = period; … … 218 218 void MachineCpuLoad::collect() 219 219 { 220 unsigned longuser, kernel;220 ULONG user, kernel; 221 221 int rc = mHAL->getProcessCpuLoad(mProcess, &user, &kernel); 222 222 if (RT_SUCCESS(rc)) … … 242 242 else 243 243 { 244 mUser->put(( unsigned long)(PM_CPU_LOAD_MULTIPLIER * (processUser - mProcessUserPrev) / (hostTotal - mHostTotalPrev)));245 mKernel->put(( unsigned long)(PM_CPU_LOAD_MULTIPLIER * (processKernel - mProcessKernelPrev ) / (hostTotal - mHostTotalPrev)));244 mUser->put((ULONG)(PM_CPU_LOAD_MULTIPLIER * (processUser - mProcessUserPrev) / (hostTotal - mHostTotalPrev))); 245 mKernel->put((ULONG)(PM_CPU_LOAD_MULTIPLIER * (processKernel - mProcessKernelPrev ) / (hostTotal - mHostTotalPrev))); 246 246 } 247 247 … … 252 252 } 253 253 254 void MachineRamUsage::init( unsigned long period, unsigned longlength)254 void MachineRamUsage::init(ULONG period, ULONG length) 255 255 { 256 256 mPeriod = period; … … 261 261 void MachineRamUsage::collect() 262 262 { 263 unsigned longused;263 ULONG used; 264 264 int rc = mHAL->getProcessMemoryUsage(mProcess, &used); 265 265 if (RT_SUCCESS(rc)) … … 267 267 } 268 268 269 void CircularBuffer::init( unsigned longlength)269 void CircularBuffer::init(ULONG length) 270 270 { 271 271 if (mData) 272 272 RTMemFree(mData); 273 273 mLength = length; 274 mData = ( unsigned long *)RTMemAllocZ(length * sizeof(unsigned long));274 mData = (ULONG *)RTMemAllocZ(length * sizeof(ULONG)); 275 275 mWrapped = false; 276 276 mEnd = 0; 277 277 } 278 278 279 unsigned longCircularBuffer::length()279 ULONG CircularBuffer::length() 280 280 { 281 281 return mWrapped ? mLength : mEnd; 282 282 } 283 283 284 void CircularBuffer::put( unsigned longvalue)284 void CircularBuffer::put(ULONG value) 285 285 { 286 286 if (mData) … … 295 295 } 296 296 297 void CircularBuffer::copyTo( unsigned long*data)297 void CircularBuffer::copyTo(ULONG *data) 298 298 { 299 299 if (mWrapped) 300 300 { 301 memcpy(data, mData + mEnd, (mLength - mEnd) * sizeof( unsigned long));301 memcpy(data, mData + mEnd, (mLength - mEnd) * sizeof(ULONG)); 302 302 // Copy the wrapped part 303 303 if (mEnd) 304 memcpy(data + (mLength - mEnd), mData, mEnd * sizeof( unsigned long));304 memcpy(data + (mLength - mEnd), mData, mEnd * sizeof(ULONG)); 305 305 } 306 306 else 307 memcpy(data, mData, mEnd * sizeof( unsigned long));308 } 309 310 void SubMetric::query( unsigned long*data)307 memcpy(data, mData, mEnd * sizeof(ULONG)); 308 } 309 310 void SubMetric::query(ULONG *data) 311 311 { 312 312 copyTo(data); 313 313 } 314 314 315 void Metric::query( unsigned long **data, unsigned long*count)316 { 317 unsigned longlength;318 unsigned long*tmpData;315 void Metric::query(ULONG **data, ULONG *count) 316 { 317 ULONG length; 318 ULONG *tmpData; 319 319 320 320 length = mSubMetric->length(); 321 321 if (length) 322 322 { 323 tmpData = ( unsigned long*)RTMemAlloc(sizeof(*tmpData)*length);323 tmpData = (ULONG*)RTMemAlloc(sizeof(*tmpData)*length); 324 324 mSubMetric->query(tmpData); 325 325 if (mAggregate) 326 326 { 327 327 *count = 1; 328 *data = ( unsigned long*)RTMemAlloc(sizeof(**data));328 *data = (ULONG*)RTMemAlloc(sizeof(**data)); 329 329 **data = mAggregate->compute(tmpData, length); 330 330 RTMemFree(tmpData); … … 343 343 } 344 344 345 unsigned long AggregateAvg::compute(unsigned long *data, unsigned longlength)345 ULONG AggregateAvg::compute(ULONG *data, ULONG length) 346 346 { 347 347 uint64_t tmp = 0; 348 for ( unsigned longi = 0; i < length; ++i)348 for (ULONG i = 0; i < length; ++i) 349 349 tmp += data[i]; 350 return ( unsigned long)(tmp / length);350 return (ULONG)(tmp / length); 351 351 } 352 352 … … 356 356 } 357 357 358 unsigned long AggregateMin::compute(unsigned long *data, unsigned longlength)359 { 360 unsigned longtmp = *data;361 for ( unsigned longi = 0; i < length; ++i)358 ULONG AggregateMin::compute(ULONG *data, ULONG length) 359 { 360 ULONG tmp = *data; 361 for (ULONG i = 0; i < length; ++i) 362 362 if (data[i] < tmp) 363 363 tmp = data[i]; … … 370 370 } 371 371 372 unsigned long AggregateMax::compute(unsigned long *data, unsigned longlength)373 { 374 unsigned longtmp = *data;375 for ( unsigned longi = 0; i < length; ++i)372 ULONG AggregateMax::compute(ULONG *data, ULONG length) 373 { 374 ULONG tmp = *data; 375 for (ULONG i = 0; i < length; ++i) 376 376 if (data[i] > tmp) 377 377 tmp = data[i]; -
trunk/src/VBox/Main/PerformanceImpl.cpp
r10959 r11180 347 347 { 348 348 /* @todo Filtering goes here! */ 349 unsigned long*values, length;349 ULONG *values, length; 350 350 /* @todo We may want to revise the query method to get rid of excessive alloc/memcpy calls. */ 351 351 (*it)->query(&values, &length); -
trunk/src/VBox/Main/darwin/PerformanceDarwin.cpp
r10753 r11180 29 29 { 30 30 public: 31 virtual int getHostCpuLoad( unsigned long *user, unsigned long *kernel, unsigned long*idle);32 virtual int getHostCpuMHz( unsigned long*mhz);33 virtual int getHostMemoryUsage( unsigned long *total, unsigned long *used, unsigned long*available);34 virtual int getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long*kernel);35 virtual int getProcessMemoryUsage(RTPROCESS process, unsigned long*used);31 virtual int getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle); 32 virtual int getHostCpuMHz(ULONG *mhz); 33 virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available); 34 virtual int getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel); 35 virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used); 36 36 }; 37 37 … … 42 42 } 43 43 44 int CollectorDarwin::getHostCpuLoad( unsigned long *user, unsigned long *kernel, unsigned long*idle)44 int CollectorDarwin::getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle) 45 45 { 46 46 return E_NOTIMPL; 47 47 } 48 48 49 int CollectorDarwin::getHostCpuMHz( unsigned long*mhz)49 int CollectorDarwin::getHostCpuMHz(ULONG *mhz) 50 50 { 51 51 return E_NOTIMPL; 52 52 } 53 53 54 int CollectorDarwin::getHostMemoryUsage( unsigned long *total, unsigned long *used, unsigned long*available)54 int CollectorDarwin::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available) 55 55 { 56 56 return E_NOTIMPL; 57 57 } 58 58 59 int CollectorDarwin::getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long*kernel)59 int CollectorDarwin::getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel) 60 60 { 61 61 return E_NOTIMPL; 62 62 } 63 63 64 int CollectorDarwin::getProcessMemoryUsage(RTPROCESS process, unsigned long*used)64 int CollectorDarwin::getProcessMemoryUsage(RTPROCESS process, ULONG *used) 65 65 { 66 66 return E_NOTIMPL; -
trunk/src/VBox/Main/include/Performance.h
r10870 r11180 39 39 public: 40 40 CircularBuffer() : mData(0), mLength(0), mEnd(0), mWrapped(false) {}; 41 void init( unsigned longlength);42 unsigned longlength();43 void put( unsigned longvalue);44 void copyTo( unsigned long*data);45 private: 46 unsigned long*mData;47 unsigned longmLength;48 unsigned longmEnd;41 void init(ULONG length); 42 ULONG length(); 43 void put(ULONG value); 44 void copyTo(ULONG *data); 45 private: 46 ULONG *mData; 47 ULONG mLength; 48 ULONG mEnd; 49 49 bool mWrapped; 50 50 }; … … 55 55 SubMetric(const char *name) 56 56 : mName(name) {}; 57 void query( unsigned long*data);57 void query(ULONG *data); 58 58 const char *getName() { return mName; }; 59 59 private: … … 66 66 { 67 67 public: 68 virtual int getHostCpuLoad( unsigned long *user, unsigned long *kernel, unsigned long*idle);69 virtual int getHostCpuMHz( unsigned long*mhz) = 0;70 virtual int getHostMemoryUsage( unsigned long *total, unsigned long *used, unsigned long*available) = 0;71 virtual int getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long*kernel);72 virtual int getProcessMemoryUsage(RTPROCESS process, unsigned long*used) = 0;68 virtual int getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle); 69 virtual int getHostCpuMHz(ULONG *mhz) = 0; 70 virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available) = 0; 71 virtual int getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel); 72 virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used) = 0; 73 73 74 74 virtual int getRawHostCpuLoad(uint64_t *user, uint64_t *kernel, uint64_t *idle); … … 83 83 : mHAL(hal), mLength(0), mName(name), mObject(object), mLastSampleTaken(0), mEnabled(false) {}; 84 84 85 virtual void init( unsigned long period, unsigned longlength) = 0;85 virtual void init(ULONG period, ULONG length) = 0; 86 86 virtual void collect() = 0; 87 87 virtual const char *getUnit() = 0; 88 virtual unsigned longgetMinValue() = 0;89 virtual unsigned longgetMaxValue() = 0;88 virtual ULONG getMinValue() = 0; 89 virtual ULONG getMaxValue() = 0; 90 90 91 91 void collectorBeat(uint64_t nowAt); … … 95 95 96 96 bool isEnabled() { return mEnabled; }; 97 unsigned longgetPeriod() { return mPeriod; };98 unsigned longgetLength() { return mLength; };97 ULONG getPeriod() { return mPeriod; }; 98 ULONG getLength() { return mLength; }; 99 99 const char *getName() { return mName; }; 100 100 ComPtr<IUnknown> getObject() { return mObject; }; … … 103 103 protected: 104 104 CollectorHAL *mHAL; 105 unsigned longmPeriod;106 unsigned longmLength;105 ULONG mPeriod; 106 ULONG mLength; 107 107 const char *mName; 108 108 ComPtr<IUnknown> mObject; … … 116 116 HostCpuLoad(CollectorHAL *hal, ComPtr<IUnknown> object, SubMetric *user, SubMetric *kernel, SubMetric *idle) 117 117 : BaseMetric(hal, "CPU/Load", object), mUser(user), mKernel(kernel), mIdle(idle) {}; 118 void init( unsigned long period, unsigned longlength);118 void init(ULONG period, ULONG length); 119 119 120 120 void collect(); 121 121 const char *getUnit() { return "%"; }; 122 unsigned longgetMinValue() { return 0; };123 unsigned longgetMaxValue() { return PM_CPU_LOAD_MULTIPLIER; };122 ULONG getMinValue() { return 0; }; 123 ULONG getMaxValue() { return PM_CPU_LOAD_MULTIPLIER; }; 124 124 125 125 protected: … … 148 148 : BaseMetric(hal, "CPU/MHz", object), mMHz(mhz) {}; 149 149 150 void init( unsigned long period, unsigned longlength);150 void init(ULONG period, ULONG length); 151 151 void collect(); 152 152 const char *getUnit() { return "MHz"; }; 153 unsigned longgetMinValue() { return 0; };154 unsigned longgetMaxValue() { return UINT32_MAX; };153 ULONG getMinValue() { return 0; }; 154 ULONG getMaxValue() { return UINT32_MAX; }; 155 155 private: 156 156 SubMetric *mMHz; … … 163 163 : BaseMetric(hal, "RAM/Usage", object), mTotal(total), mUsed(used), mAvailable(available) {}; 164 164 165 void init( unsigned long period, unsigned longlength);165 void init(ULONG period, ULONG length); 166 166 void collect(); 167 167 const char *getUnit() { return "kB"; }; 168 unsigned longgetMinValue() { return 0; };169 unsigned longgetMaxValue() { return UINT32_MAX; };168 ULONG getMinValue() { return 0; }; 169 ULONG getMaxValue() { return UINT32_MAX; }; 170 170 private: 171 171 SubMetric *mTotal; … … 180 180 : BaseMetric(hal, "CPU/Load", object), mProcess(process), mUser(user), mKernel(kernel) {}; 181 181 182 void init( unsigned long period, unsigned longlength);182 void init(ULONG period, ULONG length); 183 183 void collect(); 184 184 const char *getUnit() { return "%"; }; 185 unsigned longgetMinValue() { return 0; };186 unsigned longgetMaxValue() { return PM_CPU_LOAD_MULTIPLIER; };185 ULONG getMinValue() { return 0; }; 186 ULONG getMaxValue() { return PM_CPU_LOAD_MULTIPLIER; }; 187 187 protected: 188 188 RTPROCESS mProcess; … … 210 210 : BaseMetric(hal, "RAM/Usage", object), mProcess(process), mUsed(used) {}; 211 211 212 void init( unsigned long period, unsigned longlength);212 void init(ULONG period, ULONG length); 213 213 void collect(); 214 214 const char *getUnit() { return "kB"; }; 215 unsigned longgetMinValue() { return 0; };216 unsigned longgetMaxValue() { return UINT32_MAX; };215 ULONG getMinValue() { return 0; }; 216 ULONG getMaxValue() { return UINT32_MAX; }; 217 217 private: 218 218 RTPROCESS mProcess; … … 224 224 { 225 225 public: 226 virtual unsigned long compute(unsigned long *data, unsigned longlength) = 0;226 virtual ULONG compute(ULONG *data, ULONG length) = 0; 227 227 virtual const char *getName() = 0; 228 228 }; … … 231 231 { 232 232 public: 233 virtual unsigned long compute(unsigned long *data, unsigned longlength);233 virtual ULONG compute(ULONG *data, ULONG length); 234 234 virtual const char *getName(); 235 235 }; … … 238 238 { 239 239 public: 240 virtual unsigned long compute(unsigned long *data, unsigned longlength);240 virtual ULONG compute(ULONG *data, ULONG length); 241 241 virtual const char *getName(); 242 242 }; … … 245 245 { 246 246 public: 247 virtual unsigned long compute(unsigned long *data, unsigned longlength);247 virtual ULONG compute(ULONG *data, ULONG length); 248 248 virtual const char *getName(); 249 249 }; … … 272 272 ComPtr<IUnknown> getObject() { return mBaseMetric->getObject(); }; 273 273 const char *getUnit() { return mBaseMetric->getUnit(); }; 274 unsigned longgetMinValue() { return mBaseMetric->getMinValue(); };275 unsigned longgetMaxValue() { return mBaseMetric->getMaxValue(); };276 unsigned longgetPeriod() { return mBaseMetric->getPeriod(); };277 unsigned longgetLength() { return mAggregate ? 1 : mBaseMetric->getLength(); };278 void query( unsigned long **data, unsigned long*count);274 ULONG getMinValue() { return mBaseMetric->getMinValue(); }; 275 ULONG getMaxValue() { return mBaseMetric->getMaxValue(); }; 276 ULONG getPeriod() { return mBaseMetric->getPeriod(); }; 277 ULONG getLength() { return mAggregate ? 1 : mBaseMetric->getLength(); }; 278 void query(ULONG **data, ULONG *count); 279 279 280 280 private: -
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 -
trunk/src/VBox/Main/os2/PerformanceOs2.cpp
r10993 r11180 29 29 { 30 30 public: 31 virtual int getHostCpuLoad( unsigned long *user, unsigned long *kernel, unsigned long*idle);32 virtual int getHostCpuMHz( unsigned long*mhz);33 virtual int getHostMemoryUsage( unsigned long *total, unsigned long *used, unsigned long*available);34 virtual int getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long*kernel);35 virtual int getProcessMemoryUsage(RTPROCESS process, unsigned long*used);31 virtual int getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle); 32 virtual int getHostCpuMHz(ULONG *mhz); 33 virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available); 34 virtual int getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel); 35 virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used); 36 36 }; 37 37 … … 43 43 } 44 44 45 int CollectorOS2::getHostCpuLoad( unsigned long *user, unsigned long *kernel, unsigned long*idle)45 int CollectorOS2::getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle) 46 46 { 47 47 return E_NOTIMPL; 48 48 } 49 49 50 int CollectorOS2::getHostCpuMHz( unsigned long*mhz)50 int CollectorOS2::getHostCpuMHz(ULONG *mhz) 51 51 { 52 52 return E_NOTIMPL; 53 53 } 54 54 55 int CollectorOS2::getHostMemoryUsage( unsigned long *total, unsigned long *used, unsigned long*available)55 int CollectorOS2::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available) 56 56 { 57 57 return E_NOTIMPL; 58 58 } 59 59 60 int CollectorOS2::getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long*kernel)60 int CollectorOS2::getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel) 61 61 { 62 62 return E_NOTIMPL; 63 63 } 64 64 65 int CollectorOS2::getProcessMemoryUsage(RTPROCESS process, unsigned long*used)65 int CollectorOS2::getProcessMemoryUsage(RTPROCESS process, ULONG *used) 66 66 { 67 67 return E_NOTIMPL; -
trunk/src/VBox/Main/solaris/PerformanceSolaris.cpp
r11099 r11180 45 45 CollectorSolaris(); 46 46 ~CollectorSolaris(); 47 virtual int getHostCpuMHz( unsigned long*mhz);48 virtual int getHostMemoryUsage( unsigned long *total, unsigned long *used, unsigned long*available);49 virtual int getProcessMemoryUsage(RTPROCESS process, unsigned long*used);47 virtual int getHostCpuMHz(ULONG *mhz); 48 virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available); 49 virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used); 50 50 51 51 virtual int getRawHostCpuLoad(uint64_t *user, uint64_t *kernel, uint64_t *idle); … … 164 164 } 165 165 166 int CollectorSolaris::getHostCpuMHz( unsigned long*mhz)166 int CollectorSolaris::getHostCpuMHz(ULONG *mhz) 167 167 { 168 168 return VERR_NOT_IMPLEMENTED; 169 169 } 170 170 171 int CollectorSolaris::getHostMemoryUsage( unsigned long *total, unsigned long *used, unsigned long*available)171 int CollectorSolaris::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available) 172 172 { 173 173 int rc = VINF_SUCCESS; … … 199 199 return rc; 200 200 } 201 int CollectorSolaris::getProcessMemoryUsage(RTPROCESS process, unsigned long*used)201 int CollectorSolaris::getProcessMemoryUsage(RTPROCESS process, ULONG *used) 202 202 { 203 203 int rc = VINF_SUCCESS; -
trunk/src/VBox/Main/win/PerformanceWin.cpp
r10868 r11180 36 36 ~CollectorWin(); 37 37 38 virtual int getHostCpuLoad( unsigned long *user, unsigned long *kernel, unsigned long*idle);39 virtual int getHostCpuMHz( unsigned long*mhz);40 virtual int getHostMemoryUsage( unsigned long *total, unsigned long *used, unsigned long*available);41 virtual int getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long*kernel);42 virtual int getProcessMemoryUsage(RTPROCESS process, unsigned long*used);38 virtual int getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle); 39 virtual int getHostCpuMHz(ULONG *mhz); 40 virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available); 41 virtual int getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel); 42 virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used); 43 43 44 44 virtual int getRawHostCpuLoad(uint64_t *user, uint64_t *kernel, uint64_t *idle); … … 261 261 } 262 262 263 int CollectorWin::getHostCpuLoad( unsigned long *user, unsigned long *kernel, unsigned long*idle)263 int CollectorWin::getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle) 264 264 { 265 265 return VERR_NOT_IMPLEMENTED; … … 334 334 } 335 335 336 int CollectorWin::getHostCpuMHz( unsigned long*mhz)336 int CollectorWin::getHostCpuMHz(ULONG *mhz) 337 337 { 338 338 return VERR_NOT_IMPLEMENTED; 339 339 } 340 340 341 int CollectorWin::getHostMemoryUsage( unsigned long *total, unsigned long *used, unsigned long*available)341 int CollectorWin::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available) 342 342 { 343 343 MEMORYSTATUSEX mstat; … … 346 346 if (GlobalMemoryStatusEx(&mstat)) 347 347 { 348 *total = ( unsigned long)( mstat.ullTotalPhys / 1000 );349 *available = ( unsigned long)( mstat.ullAvailPhys / 1000 );348 *total = (ULONG)( mstat.ullTotalPhys / 1000 ); 349 *available = (ULONG)( mstat.ullAvailPhys / 1000 ); 350 350 *used = *total - *available; 351 351 } … … 356 356 } 357 357 358 int CollectorWin::getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long*kernel)358 int CollectorWin::getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel) 359 359 { 360 360 return VERR_NOT_IMPLEMENTED; … … 430 430 } 431 431 432 int CollectorWin::getProcessMemoryUsage(RTPROCESS process, unsigned long*used)432 int CollectorWin::getProcessMemoryUsage(RTPROCESS process, ULONG *used) 433 433 { 434 434 HRESULT hr; … … 472 472 return VERR_INTERNAL_ERROR; 473 473 } 474 *used = ( unsigned long)(u64used / 1024);474 *used = (ULONG)(u64used / 1024); 475 475 rc = VINF_SUCCESS; 476 476 }
Note:
See TracChangeset
for help on using the changeset viewer.