Changeset 27896 in vbox for trunk/src/VBox/Main/VMMDevInterface.cpp
- Timestamp:
- Mar 31, 2010 1:33:57 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59584
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/VMMDevInterface.cpp
r27885 r27896 458 458 return VERR_INVALID_PARAMETER; /** @todo wrong error */ 459 459 460 #if 0461 460 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_IDLE) 462 guest->SetStatistic(pGuestStats->u32CpuId, G uestStatisticType_CPULoad_Idle, pGuestStats->u32CpuLoad_Idle);461 guest->SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUIDLE, pGuestStats->u32CpuLoad_Idle); 463 462 464 463 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_KERNEL) 465 guest->SetStatistic(pGuestStats->u32CpuId, G uestStatisticType_CPULoad_Kernel, pGuestStats->u32CpuLoad_Kernel);464 guest->SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUKERNEL, pGuestStats->u32CpuLoad_Kernel); 466 465 467 466 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_USER) 468 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_CPULoad_User, pGuestStats->u32CpuLoad_User); 469 470 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_THREADS) 471 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_Threads, pGuestStats->u32Threads); 472 473 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PROCESSES) 474 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_Processes, pGuestStats->u32Processes); 475 476 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_HANDLES) 477 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_Handles, pGuestStats->u32Handles); 478 479 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEMORY_LOAD) 480 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_MemoryLoad, pGuestStats->u32MemoryLoad); 467 guest->SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUUSER, pGuestStats->u32CpuLoad_User); 468 481 469 482 470 /* Note that reported values are in pages; upper layers expect them in megabytes */ … … 486 474 487 475 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_TOTAL) 488 guest->SetStatistic(pGuestStats->u32CpuId, G uestStatisticType_PhysMemTotal, (pGuestStats->u32PhysMemTotal + (_1M/pGuestStats->u32PageSize)-1) / (_1M/pGuestStats->u32PageSize));476 guest->SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMTOTAL, (pGuestStats->u32PhysMemTotal + (_1M/pGuestStats->u32PageSize)-1) / (_1M/pGuestStats->u32PageSize)); 489 477 490 478 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_AVAIL) 491 guest->SetStatistic(pGuestStats->u32CpuId, G uestStatisticType_PhysMemAvailable, pGuestStats->u32PhysMemAvail / (_1M/pGuestStats->u32PageSize));479 guest->SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMFREE, pGuestStats->u32PhysMemAvail / (_1M/pGuestStats->u32PageSize)); 492 480 493 481 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_BALLOON) 494 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PhysMemBalloon, pGuestStats->u32PhysMemBalloon / (_1M/pGuestStats->u32PageSize)); 495 496 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_COMMIT_TOTAL) 497 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_MemCommitTotal, pGuestStats->u32MemCommitTotal / (_1M/pGuestStats->u32PageSize)); 498 499 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_KERNEL_TOTAL) 500 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_MemKernelTotal, pGuestStats->u32MemKernelTotal / (_1M/pGuestStats->u32PageSize)); 501 502 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_KERNEL_PAGED) 503 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_MemKernelPaged, pGuestStats->u32MemKernelPaged / (_1M/pGuestStats->u32PageSize)); 504 505 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_KERNEL_NONPAGED) 506 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_MemKernelNonpaged, pGuestStats->u32MemKernelNonPaged / (_1M/pGuestStats->u32PageSize)); 482 guest->SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMBALLOON, pGuestStats->u32PhysMemBalloon / (_1M/pGuestStats->u32PageSize)); 507 483 508 484 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_SYSTEM_CACHE) 509 guest->SetStatistic(pGuestStats->u32CpuId, G uestStatisticType_MemSystemCache, pGuestStats->u32MemSystemCache / (_1M/pGuestStats->u32PageSize));485 guest->SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMCACHE, pGuestStats->u32MemSystemCache / (_1M/pGuestStats->u32PageSize)); 510 486 511 487 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PAGE_FILE_SIZE) 512 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PageFileSize, pGuestStats->u32PageFileSize / (_1M/pGuestStats->u32PageSize)); 513 514 /* increase sample number */ 515 ULONG sample; 516 517 int rc = guest->GetStatistic(0, GuestStatisticType_SampleNumber, &sample); 518 if (SUCCEEDED(rc)) 519 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_SampleNumber, sample+1); 520 #endif 488 guest->SetStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_PAGETOTAL, pGuestStats->u32PageFileSize / (_1M/pGuestStats->u32PageSize)); 489 521 490 return VINF_SUCCESS; 522 491 }
Note:
See TracChangeset
for help on using the changeset viewer.