VirtualBox

Changeset 4650 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Sep 10, 2007 9:07:13 AM (17 years ago)
Author:
vboxsync
Message:

Update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r4649 r4650  
    15461546        }
    15471547    }
    1548     if (details == VMINFO_STATISTICS || details == VMINFO_FULL)
     1548    if (    console
     1549        &&  (details == VMINFO_STATISTICS || details == VMINFO_FULL))
    15491550    {
    15501551        ComPtr <IGuest> Guest;
    15511552        ULONG statVal;
    15521553
    1553         CHECK_ERROR_RET(console, COMGETTER(Guest)(Guest.asOutParam()), rc);
    1554 
    1555         rc = Guest->GetStatistic(0, GuestStatisticType_CPULoad_Idle, &statVal);
    1556         if (rc == S_OK)
    1557             RTPrintf("CPU%d: CPU Load Idle          %-3d%%\n", 0, statVal);
    1558 
    1559         rc = Guest->GetStatistic(0, GuestStatisticType_CPULoad_Kernel, &statVal);
    1560         if (rc == S_OK)
    1561             RTPrintf("CPU%d: CPU Load Kernel        %-3d%%\n", 0, statVal);
    1562 
    1563         rc = Guest->GetStatistic(0, GuestStatisticType_CPULoad_User, &statVal);
    1564         if (rc == S_OK)
    1565             RTPrintf("CPU%d: CPU Load User          %-3d%%\n", 0, statVal);
    1566 
    1567         rc = Guest->GetStatistic(0, GuestStatisticType_Threads, &statVal);
    1568         if (rc == S_OK)
    1569             RTPrintf("CPU%d: Threads                %d%%\n", 0, statVal);
    1570 
    1571         rc = Guest->GetStatistic(0, GuestStatisticType_Processes, &statVal);
    1572         if (rc == S_OK)
    1573             RTPrintf("CPU%d: Processes              %d%%\n", 0, statVal);
    1574 
    1575         rc = Guest->GetStatistic(0, GuestStatisticType_Handles, &statVal);
    1576         if (rc == S_OK)
    1577             RTPrintf("CPU%d: Handles                %d%%\n", 0, statVal);
    1578 
    1579         rc = Guest->GetStatistic(0, GuestStatisticType_MemoryLoad, &statVal);
    1580         if (rc == S_OK)
    1581             RTPrintf("CPU%d: Memory Load            %d%%\n", 0, statVal);
    1582 
    1583         rc = Guest->GetStatistic(0, GuestStatisticType_PhysMemTotal, &statVal);
    1584         if (rc == S_OK)
    1585             RTPrintf("CPU%d: Total physical memory  %-4d MB\n", 0, statVal);
    1586 
    1587         rc = Guest->GetStatistic(0, GuestStatisticType_PhysMemAvailable, &statVal);
    1588         if (rc == S_OK)
    1589             RTPrintf("CPU%d: Free physical memory   %-4d MB\n", 0, statVal);
    1590 
    1591         rc = Guest->GetStatistic(0, GuestStatisticType_PhysMemBalloon, &statVal);
    1592         if (rc == S_OK)
    1593             RTPrintf("CPU%d: Memory balloon size    %-4d MB\n", 0, statVal);
    1594 
    1595         rc = Guest->GetStatistic(0, GuestStatisticType_MemCommitTotal, &statVal);
    1596         if (rc == S_OK)
    1597             RTPrintf("CPU%d: Committed memory       %-4d MB\n", 0, statVal);
    1598 
    1599         rc = Guest->GetStatistic(0, GuestStatisticType_MemKernelTotal, &statVal);
    1600         if (rc == S_OK)
    1601             RTPrintf("CPU%d: Total kernel memory    %-4d MB\n", 0, statVal);
    1602 
    1603         rc = Guest->GetStatistic(0, GuestStatisticType_MemKernelPaged, &statVal);
    1604         if (rc == S_OK)
    1605             RTPrintf("CPU%d: Paged kernel memory    %-4d MB\n", 0, statVal);
    1606 
    1607         rc = Guest->GetStatistic(0, GuestStatisticType_MemKernelNonpaged, &statVal);
    1608         if (rc == S_OK)
    1609             RTPrintf("CPU%d: Nonpaged kernel memory %-4d MB\n", 0, statVal);
    1610 
    1611         rc = Guest->GetStatistic(0, GuestStatisticType_MemSystemCache, &statVal);
    1612         if (rc == S_OK)
    1613             RTPrintf("CPU%d: System cache size      %-4d MB\n", 0, statVal);
    1614 
    1615         rc = Guest->GetStatistic(0, GuestStatisticType_PageFileSize, &statVal);
    1616         if (rc == S_OK)
    1617             RTPrintf("CPU%d: Page file size         %-4d MB\n", 0, statVal);
     1554        rc = console->COMGETTER(Guest)(Guest.asOutParam());
     1555        if (SUCCEEDED(rc))
     1556        {
     1557            rc = Guest->GetStatistic(0, GuestStatisticType_CPULoad_Idle, &statVal);
     1558            if (SUCCEEDED(rc))
     1559                RTPrintf("CPU%d: CPU Load Idle          %-3d%%\n", 0, statVal);
     1560
     1561            rc = Guest->GetStatistic(0, GuestStatisticType_CPULoad_Kernel, &statVal);
     1562            if (SUCCEEDED(rc))
     1563                RTPrintf("CPU%d: CPU Load Kernel        %-3d%%\n", 0, statVal);
     1564
     1565            rc = Guest->GetStatistic(0, GuestStatisticType_CPULoad_User, &statVal);
     1566            if (SUCCEEDED(rc))
     1567                RTPrintf("CPU%d: CPU Load User          %-3d%%\n", 0, statVal);
     1568
     1569            rc = Guest->GetStatistic(0, GuestStatisticType_Threads, &statVal);
     1570            if (SUCCEEDED(rc))
     1571                RTPrintf("CPU%d: Threads                %d%%\n", 0, statVal);
     1572
     1573            rc = Guest->GetStatistic(0, GuestStatisticType_Processes, &statVal);
     1574            if (SUCCEEDED(rc))
     1575                RTPrintf("CPU%d: Processes              %d%%\n", 0, statVal);
     1576
     1577            rc = Guest->GetStatistic(0, GuestStatisticType_Handles, &statVal);
     1578            if (SUCCEEDED(rc))
     1579                RTPrintf("CPU%d: Handles                %d%%\n", 0, statVal);
     1580
     1581            rc = Guest->GetStatistic(0, GuestStatisticType_MemoryLoad, &statVal);
     1582            if (SUCCEEDED(rc))
     1583                RTPrintf("CPU%d: Memory Load            %d%%\n", 0, statVal);
     1584
     1585            rc = Guest->GetStatistic(0, GuestStatisticType_PhysMemTotal, &statVal);
     1586            if (SUCCEEDED(rc))
     1587                RTPrintf("CPU%d: Total physical memory  %-4d MB\n", 0, statVal);
     1588
     1589            rc = Guest->GetStatistic(0, GuestStatisticType_PhysMemAvailable, &statVal);
     1590            if (SUCCEEDED(rc))
     1591                RTPrintf("CPU%d: Free physical memory   %-4d MB\n", 0, statVal);
     1592
     1593            rc = Guest->GetStatistic(0, GuestStatisticType_PhysMemBalloon, &statVal);
     1594            if (SUCCEEDED(rc))
     1595                RTPrintf("CPU%d: Memory balloon size    %-4d MB\n", 0, statVal);
     1596
     1597            rc = Guest->GetStatistic(0, GuestStatisticType_MemCommitTotal, &statVal);
     1598            if (SUCCEEDED(rc))
     1599                RTPrintf("CPU%d: Committed memory       %-4d MB\n", 0, statVal);
     1600
     1601            rc = Guest->GetStatistic(0, GuestStatisticType_MemKernelTotal, &statVal);
     1602            if (SUCCEEDED(rc))
     1603                RTPrintf("CPU%d: Total kernel memory    %-4d MB\n", 0, statVal);
     1604
     1605            rc = Guest->GetStatistic(0, GuestStatisticType_MemKernelPaged, &statVal);
     1606            if (SUCCEEDED(rc))
     1607                RTPrintf("CPU%d: Paged kernel memory    %-4d MB\n", 0, statVal);
     1608
     1609            rc = Guest->GetStatistic(0, GuestStatisticType_MemKernelNonpaged, &statVal);
     1610            if (SUCCEEDED(rc))
     1611                RTPrintf("CPU%d: Nonpaged kernel memory %-4d MB\n", 0, statVal);
     1612
     1613            rc = Guest->GetStatistic(0, GuestStatisticType_MemSystemCache, &statVal);
     1614            if (SUCCEEDED(rc))
     1615                RTPrintf("CPU%d: System cache size      %-4d MB\n", 0, statVal);
     1616
     1617            rc = Guest->GetStatistic(0, GuestStatisticType_PageFileSize, &statVal);
     1618            if (SUCCEEDED(rc))
     1619                RTPrintf("CPU%d: Page file size         %-4d MB\n", 0, statVal);
     1620        }
     1621        else
     1622        {
     1623            RTPrintf("[!] FAILED calling console->getGuest at line %d!\n", __LINE__);
     1624            PRINT_RC_MESSAGE(rc);
     1625        }
    16181626    }
    16191627
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette