- Timestamp:
- Nov 8, 2012 1:33:23 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/linux/PerformanceLinux.cpp
r43831 r43840 60 60 virtual int _getRawHostCpuLoad(); 61 61 int getRawProcessStats(RTPROCESS process, uint64_t *cpuUser, uint64_t *cpuKernel, ULONG *memPagesUsed); 62 char *getDiskName(char *pszDiskName, size_t cbDiskName, const char *pszDevName, bool fTrimDigits); 63 void addVolumeDependencies(const char *pcszVolume, DiskList& listDisks); 62 64 63 65 struct VMProcessStats … … 354 356 } 355 357 356 static char *getDiskName(char *pszDiskName, size_t cbDiskName, const char *pszDevName)358 char *CollectorLinux::getDiskName(char *pszDiskName, size_t cbDiskName, const char *pszDevName, bool fTrimDigits) 357 359 { 358 360 unsigned cbName = 0; 359 361 unsigned cbDevName = strlen(pszDevName); 360 362 const char *pszEnd = pszDevName + cbDevName - 1; 361 while (pszEnd > pszDevName && RT_C_IS_DIGIT(*pszEnd)) 362 pszEnd--; 363 if (fTrimDigits) 364 while (pszEnd > pszDevName && RT_C_IS_DIGIT(*pszEnd)) 365 pszEnd--; 363 366 while (pszEnd > pszDevName && *pszEnd != '/') 364 367 { … … 370 373 } 371 374 372 static voidaddVolumeDependencies(const char *pcszVolume, DiskList& listDisks)375 void CollectorLinux::addVolumeDependencies(const char *pcszVolume, DiskList& listDisks) 373 376 { 374 377 char szVolInfo[RTPATH_MAX]; … … 407 410 { 408 411 char szDevName[128]; 409 getDiskName(szDevName, sizeof(szDevName), mntent->mnt_fsname);410 412 if (strncmp(mntent->mnt_fsname, "/dev/mapper", 11)) 413 { 414 getDiskName(szDevName, sizeof(szDevName), mntent->mnt_fsname, true); 411 415 listDisks.push_back(RTCString(szDevName)); 416 } 412 417 else 418 { 419 getDiskName(szDevName, sizeof(szDevName), mntent->mnt_fsname, false); 413 420 addVolumeDependencies(szDevName, listDisks); 421 } 414 422 break; 415 423 }
Note:
See TracChangeset
for help on using the changeset viewer.