Changeset 4649 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 10, 2007 8:50:51 AM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r4372 r4649 278 278 RTPrintf("VBoxManage showvminfo <uuid>|<name>\n" 279 279 " [-details]\n" 280 " [-statistics]\n" 280 281 "\n"); 281 282 } … … 705 706 static HRESULT showVMInfo (ComPtr <IVirtualBox> virtualBox, ComPtr<IMachine> machine, 706 707 ComPtr <IConsole> console = ComPtr <IConsole> (), 707 bool fDetails = false)708 VMINFO_DETAILS details = VMINFO_NONE) 708 709 { 709 710 HRESULT rc; … … 1536 1537 } 1537 1538 1538 if ( fDetails)1539 if (details == VMINFO_STANDARD || details == VMINFO_FULL) 1539 1540 { 1540 1541 Bstr description; … … 1544 1545 RTPrintf("Description:\n%lS\n", description.raw()); 1545 1546 } 1547 } 1548 if (details == VMINFO_STATISTICS || details == VMINFO_FULL) 1549 { 1550 ComPtr <IGuest> Guest; 1551 ULONG statVal; 1552 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); 1546 1618 } 1547 1619 … … 1588 1660 return 1; 1589 1661 1590 /* 2nd option can be -details */ 1662 /* 2nd option can be -details or -statistics */ 1663 VMINFO_DETAILS details = VMINFO_NONE; 1591 1664 bool fDetails = false; 1592 if ((argc == 2) && !strcmp(argv[1], "-details")) 1593 fDetails = true; 1665 bool fStatistics = false; 1666 for (int i=1;i<argc;i++) 1667 { 1668 if (!strcmp(argv[i], "-details")) 1669 fDetails = true; 1670 else 1671 if (!strcmp(argv[i], "-statistics")) 1672 fStatistics = true; 1673 } 1674 if (fDetails && fStatistics) 1675 details = VMINFO_FULL; 1676 else 1677 if (fDetails) 1678 details = VMINFO_STANDARD; 1679 else 1680 if (fStatistics) 1681 details = VMINFO_STATISTICS; 1594 1682 1595 1683 ComPtr <IConsole> console; … … 1604 1692 rc = session->COMGETTER(Console)(console.asOutParam()); 1605 1693 1606 rc = showVMInfo (virtualBox, machine, console, fDetails);1694 rc = showVMInfo (virtualBox, machine, console, details); 1607 1695 1608 1696 if (console) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r4071 r4649 70 70 extern bool fInternalMode; 71 71 72 /** showVMInfo details */ 73 typedef enum 74 { 75 VMINFO_NONE = 0, 76 VMINFO_STANDARD = 1, /* standard details */ 77 VMINFO_STATISTICS = 2, /* guest statistics */ 78 VMINFO_FULL = 3, /* both */ 79 } VMINFO_DETAILS; 80 72 81 /* 73 82 * Prototypes
Note:
See TracChangeset
for help on using the changeset viewer.