Changeset 27822 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Mar 30, 2010 1:01:36 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59493
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r27703 r27822 122 122 VMINFO_NONE = 0, 123 123 VMINFO_STANDARD = 1, /**< standard details */ 124 VMINFO_STATISTICS = 2, /**< guest statistics */ 125 VMINFO_FULL = 3, /**< both */ 126 VMINFO_MACHINEREADABLE = 4, /**< both, and make it machine readable */ 127 VMINFO_COMPACT = 5 124 VMINFO_FULL = 2, /**< both */ 125 VMINFO_MACHINEREADABLE = 3, /**< both, and make it machine readable */ 126 VMINFO_COMPACT = 4 128 127 } VMINFO_DETAILS; 129 128 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r27581 r27822 791 791 CHECK_ERROR(guest, COMSETTER(MemoryBalloonSize)(uVal)); 792 792 } 793 else if (!strcmp(a->argv[1], "gueststatisticsinterval"))794 {795 if (a->argc != 3)796 {797 errorSyntax(USAGE_CONTROLVM, "Incorrect number of parameters");798 rc = E_FAIL;799 break;800 }801 uint32_t uVal;802 int vrc;803 vrc = RTStrToUInt32Ex(a->argv[2], NULL, 0, &uVal);804 if (vrc != VINF_SUCCESS)805 {806 errorArgument("Error parsing guest statistics interval '%s'", a->argv[2]);807 rc = E_FAIL;808 break;809 }810 811 /* guest is running; update IGuest */812 ComPtr <IGuest> guest;813 814 rc = console->COMGETTER(Guest)(guest.asOutParam());815 if (SUCCEEDED(rc))816 CHECK_ERROR(guest, COMSETTER(StatisticsUpdateInterval)(uVal));817 }818 /* Undocumented show guest statistics testcase. */819 else if (!strcmp(a->argv[1], "showgueststats"))820 {821 /* guest is running; update IGuest */822 ComPtr <IGuest> guest;823 824 rc = console->COMGETTER(Guest)(guest.asOutParam());825 if (SUCCEEDED(rc))826 {827 ULONG StatVal;828 829 if (guest->GetStatistic(0, GuestStatisticType_SampleNumber, &StatVal) == S_OK)830 RTPrintf("Statistics sample: %u\n", StatVal);831 if (guest->GetStatistic(0, GuestStatisticType_CPULoad_Idle, &StatVal) == S_OK)832 RTPrintf("CPU load idle: %u%%\n", StatVal);833 if (guest->GetStatistic(0, GuestStatisticType_CPULoad_Kernel, &StatVal) == S_OK)834 RTPrintf("CPU load kernel: %u%%\n", StatVal);835 if (guest->GetStatistic(0, GuestStatisticType_CPULoad_User, &StatVal) == S_OK)836 RTPrintf("CPU load user: %u%%\n", StatVal);837 if (guest->GetStatistic(0, GuestStatisticType_Threads, &StatVal) == S_OK)838 RTPrintf("Nr. of threads: %u\n", StatVal);839 if (guest->GetStatistic(0, GuestStatisticType_Processes, &StatVal) == S_OK)840 RTPrintf("Nr. of processes: %u\n", StatVal);841 if (guest->GetStatistic(0, GuestStatisticType_Handles, &StatVal) == S_OK)842 RTPrintf("Nr. of handles: %u\n", StatVal);843 if (guest->GetStatistic(0, GuestStatisticType_MemoryLoad, &StatVal) == S_OK)844 RTPrintf("Memory load: %u\n", StatVal);845 if (guest->GetStatistic(0, GuestStatisticType_PhysMemTotal, &StatVal) == S_OK)846 RTPrintf("Total phys. memory: %uMB\n", StatVal);847 if (guest->GetStatistic(0, GuestStatisticType_PhysMemAvailable, &StatVal) == S_OK)848 RTPrintf("Available phys. memory: %uMB\n", StatVal);849 if (guest->GetStatistic(0, GuestStatisticType_PhysMemBalloon, &StatVal) == S_OK)850 RTPrintf("Balloon size: %uMB\n", StatVal);851 if (guest->GetStatistic(0, GuestStatisticType_MemCommitTotal, &StatVal) == S_OK)852 RTPrintf("Total memory commit: %uMB\n", StatVal);853 if (guest->GetStatistic(0, GuestStatisticType_MemKernelTotal, &StatVal) == S_OK)854 RTPrintf("Kernel memory: %uMB\n", StatVal);855 if (guest->GetStatistic(0, GuestStatisticType_MemKernelPaged, &StatVal) == S_OK)856 RTPrintf("Paged kernel mem: %uMB\n", StatVal);857 if (guest->GetStatistic(0, GuestStatisticType_MemKernelNonpaged, &StatVal) == S_OK)858 RTPrintf("Locked kernel mem: %uMB\n", StatVal);859 if (guest->GetStatistic(0, GuestStatisticType_MemSystemCache, &StatVal) == S_OK)860 RTPrintf("System cache: %uMB\n", StatVal);861 if (guest->GetStatistic(0, GuestStatisticType_PageFileSize, &StatVal) == S_OK)862 RTPrintf("Page file size: %uMB\n", StatVal);863 }864 }865 793 else if (!strcmp(a->argv[1], "teleport")) 866 794 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r27537 r27822 1806 1806 RTPrintf("Configured memory balloon size: %d MB\n", guestVal); 1807 1807 } 1808 rc = machine->COMGETTER(StatisticsUpdateInterval)(&guestVal);1809 if (SUCCEEDED(rc))1810 {1811 if (details == VMINFO_MACHINEREADABLE)1812 RTPrintf("GuestStatisticsUpdateInterval=%d\n", guestVal);1813 else1814 {1815 if (guestVal == 0)1816 RTPrintf("Statistics update: disabled\n");1817 else1818 RTPrintf("Statistics update interval: %d seconds\n", guestVal);1819 }1820 }1821 1808 if (details != VMINFO_MACHINEREADABLE) 1822 1809 RTPrintf("\n"); 1823 1824 if ( console1825 && ( details == VMINFO_STATISTICS1826 || details == VMINFO_FULL1827 || details == VMINFO_MACHINEREADABLE))1828 {1829 ComPtr <IGuest> guest;1830 1831 rc = console->COMGETTER(Guest)(guest.asOutParam());1832 if (SUCCEEDED(rc))1833 {1834 ULONG statVal;1835 1836 rc = guest->GetStatistic(0, GuestStatisticType_SampleNumber, &statVal);1837 if (SUCCEEDED(rc))1838 {1839 if (details == VMINFO_MACHINEREADABLE)1840 RTPrintf("StatGuestSample=%d\n", statVal);1841 else1842 RTPrintf("Guest statistics for sample %d:\n\n", statVal);1843 }1844 1845 rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_Idle, &statVal);1846 if (SUCCEEDED(rc))1847 {1848 if (details == VMINFO_MACHINEREADABLE)1849 RTPrintf("StatGuestLoadIdleCPU%d=%d\n", 0, statVal);1850 else1851 RTPrintf("CPU%d: CPU Load Idle %-3d%%\n", 0, statVal);1852 }1853 1854 rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_Kernel, &statVal);1855 if (SUCCEEDED(rc))1856 {1857 if (details == VMINFO_MACHINEREADABLE)1858 RTPrintf("StatGuestLoadKernelCPU%d=%d\n", 0, statVal);1859 else1860 RTPrintf("CPU%d: CPU Load Kernel %-3d%%\n", 0, statVal);1861 }1862 1863 rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_User, &statVal);1864 if (SUCCEEDED(rc))1865 {1866 if (details == VMINFO_MACHINEREADABLE)1867 RTPrintf("StatGuestLoadUserCPU%d=%d\n", 0, statVal);1868 else1869 RTPrintf("CPU%d: CPU Load User %-3d%%\n", 0, statVal);1870 }1871 1872 rc = guest->GetStatistic(0, GuestStatisticType_Threads, &statVal);1873 if (SUCCEEDED(rc))1874 {1875 if (details == VMINFO_MACHINEREADABLE)1876 RTPrintf("StatGuestThreadsCPU%d=%d\n", 0, statVal);1877 else1878 RTPrintf("CPU%d: Threads %d\n", 0, statVal);1879 }1880 1881 rc = guest->GetStatistic(0, GuestStatisticType_Processes, &statVal);1882 if (SUCCEEDED(rc))1883 {1884 if (details == VMINFO_MACHINEREADABLE)1885 RTPrintf("StatGuestProcessesCPU%d=%d\n", 0, statVal);1886 else1887 RTPrintf("CPU%d: Processes %d\n", 0, statVal);1888 }1889 1890 rc = guest->GetStatistic(0, GuestStatisticType_Handles, &statVal);1891 if (SUCCEEDED(rc))1892 {1893 if (details == VMINFO_MACHINEREADABLE)1894 RTPrintf("StatGuestHandlesCPU%d=%d\n", 0, statVal);1895 else1896 RTPrintf("CPU%d: Handles %d\n", 0, statVal);1897 }1898 1899 rc = guest->GetStatistic(0, GuestStatisticType_MemoryLoad, &statVal);1900 if (SUCCEEDED(rc))1901 {1902 if (details == VMINFO_MACHINEREADABLE)1903 RTPrintf("StatGuestMemoryLoadCPU%d=%d\n", 0, statVal);1904 else1905 RTPrintf("CPU%d: Memory Load %d%%\n", 0, statVal);1906 }1907 1908 rc = guest->GetStatistic(0, GuestStatisticType_PhysMemTotal, &statVal);1909 if (SUCCEEDED(rc))1910 {1911 if (details == VMINFO_MACHINEREADABLE)1912 RTPrintf("StatGuestMemoryTotalPhysCPU%d=%d\n", 0, statVal);1913 else1914 RTPrintf("CPU%d: Total physical memory %-4d MB\n", 0, statVal);1915 }1916 1917 rc = guest->GetStatistic(0, GuestStatisticType_PhysMemAvailable, &statVal);1918 if (SUCCEEDED(rc))1919 {1920 if (details == VMINFO_MACHINEREADABLE)1921 RTPrintf("StatGuestMemoryFreePhysCPU%d=%d\n", 0, statVal);1922 else1923 RTPrintf("CPU%d: Free physical memory %-4d MB\n", 0, statVal);1924 }1925 1926 rc = guest->GetStatistic(0, GuestStatisticType_PhysMemBalloon, &statVal);1927 if (SUCCEEDED(rc))1928 {1929 if (details == VMINFO_MACHINEREADABLE)1930 RTPrintf("StatGuestMemoryBalloonCPU%d=%d\n", 0, statVal);1931 else1932 RTPrintf("CPU%d: Memory balloon size %-4d MB\n", 0, statVal);1933 }1934 1935 rc = guest->GetStatistic(0, GuestStatisticType_MemCommitTotal, &statVal);1936 if (SUCCEEDED(rc))1937 {1938 if (details == VMINFO_MACHINEREADABLE)1939 RTPrintf("StatGuestMemoryCommittedCPU%d=%d\n", 0, statVal);1940 else1941 RTPrintf("CPU%d: Committed memory %-4d MB\n", 0, statVal);1942 }1943 1944 rc = guest->GetStatistic(0, GuestStatisticType_MemKernelTotal, &statVal);1945 if (SUCCEEDED(rc))1946 {1947 if (details == VMINFO_MACHINEREADABLE)1948 RTPrintf("StatGuestMemoryTotalKernelCPU%d=%d\n", 0, statVal);1949 else1950 RTPrintf("CPU%d: Total kernel memory %-4d MB\n", 0, statVal);1951 }1952 1953 rc = guest->GetStatistic(0, GuestStatisticType_MemKernelPaged, &statVal);1954 if (SUCCEEDED(rc))1955 {1956 if (details == VMINFO_MACHINEREADABLE)1957 RTPrintf("StatGuestMemoryPagedKernelCPU%d=%d\n", 0, statVal);1958 else1959 RTPrintf("CPU%d: Paged kernel memory %-4d MB\n", 0, statVal);1960 }1961 1962 rc = guest->GetStatistic(0, GuestStatisticType_MemKernelNonpaged, &statVal);1963 if (SUCCEEDED(rc))1964 {1965 if (details == VMINFO_MACHINEREADABLE)1966 RTPrintf("StatGuestMemoryNonpagedKernelCPU%d=%d\n", 0, statVal);1967 else1968 RTPrintf("CPU%d: Nonpaged kernel memory %-4d MB\n", 0, statVal);1969 }1970 1971 rc = guest->GetStatistic(0, GuestStatisticType_MemSystemCache, &statVal);1972 if (SUCCEEDED(rc))1973 {1974 if (details == VMINFO_MACHINEREADABLE)1975 RTPrintf("StatGuestSystemCacheSizeCPU%d=%d\n", 0, statVal);1976 else1977 RTPrintf("CPU%d: System cache size %-4d MB\n", 0, statVal);1978 }1979 1980 rc = guest->GetStatistic(0, GuestStatisticType_PageFileSize, &statVal);1981 if (SUCCEEDED(rc))1982 {1983 if (details == VMINFO_MACHINEREADABLE)1984 RTPrintf("StatGuestPageFileSizeCPU%d=%d\n", 0, statVal);1985 else1986 RTPrintf("CPU%d: Page file size %-4d MB\n", 0, statVal);1987 }1988 1989 RTPrintf("\n");1990 }1991 else1992 {1993 if (details != VMINFO_MACHINEREADABLE)1994 {1995 RTPrintf("[!] FAILED calling console->getGuest at line %d!\n", __LINE__);1996 GluePrintRCMessage(rc);1997 }1998 }1999 }2000 1810 2001 1811 /* … … 2029 1839 { "--details", 'D', RTGETOPT_REQ_NOTHING }, 2030 1840 { "-details", 'D', RTGETOPT_REQ_NOTHING }, // deprecated 2031 { "--statistics", 'S', RTGETOPT_REQ_NOTHING },2032 { "-statistics", 'S', RTGETOPT_REQ_NOTHING }, // deprecated2033 1841 { "--machinereadable", 'M', RTGETOPT_REQ_NOTHING }, 2034 1842 { "-machinereadable", 'M', RTGETOPT_REQ_NOTHING }, // deprecated … … 2040 1848 const char *VMNameOrUuid = NULL; 2041 1849 bool fDetails = false; 2042 bool fStatistics = false;2043 1850 bool fMachinereadable = false; 2044 1851 … … 2055 1862 case 'D': // --details 2056 1863 fDetails = true; 2057 break;2058 2059 case 'S': // --statistics2060 fStatistics = true;2061 1864 break; 2062 1865 … … 2109 1912 return 1; 2110 1913 2111 /* 2nd option can be -details , -statisticsor -argdump */1914 /* 2nd option can be -details or -argdump */ 2112 1915 VMINFO_DETAILS details = VMINFO_NONE; 2113 1916 if (fMachinereadable) 2114 1917 details = VMINFO_MACHINEREADABLE; 2115 1918 else 2116 if (fDetails && fStatistics)1919 if (fDetails) 2117 1920 details = VMINFO_FULL; 2118 1921 else 2119 1922 if (fDetails) 2120 1923 details = VMINFO_STANDARD; 2121 else2122 if (fStatistics)2123 details = VMINFO_STATISTICS;2124 1924 2125 1925 ComPtr <IConsole> console; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r27537 r27822 120 120 MODIFYVM_UARTMODE, 121 121 MODIFYVM_UART, 122 MODIFYVM_GUESTSTATISTICSINTERVAL,123 122 MODIFYVM_GUESTMEMORYBALLOON, 124 123 MODIFYVM_AUDIOCONTROLLER, … … 216 215 { "--uartmode", MODIFYVM_UARTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 217 216 { "--uart", MODIFYVM_UART, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 218 { "--gueststatisticsinterval", MODIFYVM_GUESTSTATISTICSINTERVAL, RTGETOPT_REQ_UINT32 },219 217 { "--guestmemoryballoon", MODIFYVM_GUESTMEMORYBALLOON, RTGETOPT_REQ_UINT32 }, 220 218 { "--audiocontroller", MODIFYVM_AUDIOCONTROLLER, RTGETOPT_REQ_STRING }, … … 1395 1393 } 1396 1394 1397 case MODIFYVM_GUESTSTATISTICSINTERVAL:1398 {1399 CHECK_ERROR(machine, COMSETTER(StatisticsUpdateInterval)(ValueUnion.u32));1400 break;1401 }1402 1403 1395 case MODIFYVM_GUESTMEMORYBALLOON: 1404 1396 {
Note:
See TracChangeset
for help on using the changeset viewer.