Changeset 44347 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jan 24, 2013 12:27:56 AM (12 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r43387 r44347 31 31 #include "PGMInternal.h" 32 32 #include <VBox/vmm/vm.h> 33 #include <VBox/vmm/uvm.h> 33 34 #include "PGMInline.h" 34 35 #include <VBox/sup.h> … … 1361 1362 * 1362 1363 * @returns VBox status code. 1363 * @param p VM Pointer to the VM.1364 * @param pUVM The user mode VM handle. 1364 1365 * @param pcbAllocMem Where to return the amount of memory allocated 1365 1366 * by VMs. … … 1372 1373 * currently shared. 1373 1374 */ 1374 VMMR3DECL(int) PGMR3QueryGlobalMemoryStats(P VM pVM, uint64_t *pcbAllocMem, uint64_t *pcbFreeMem,1375 VMMR3DECL(int) PGMR3QueryGlobalMemoryStats(PUVM pUVM, uint64_t *pcbAllocMem, uint64_t *pcbFreeMem, 1375 1376 uint64_t *pcbBallonedMem, uint64_t *pcbSharedMem) 1376 1377 { 1378 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1379 VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE); 1380 1377 1381 uint64_t cAllocPages = 0; 1378 1382 uint64_t cFreePages = 0; 1379 1383 uint64_t cBalloonPages = 0; 1380 1384 uint64_t cSharedPages = 0; 1381 int rc = GMMR3QueryHypervisorMemoryStats(p VM, &cAllocPages, &cFreePages, &cBalloonPages, &cSharedPages);1385 int rc = GMMR3QueryHypervisorMemoryStats(pUVM->pVM, &cAllocPages, &cFreePages, &cBalloonPages, &cSharedPages); 1382 1386 AssertRCReturn(rc, rc); 1383 1387 … … 1404 1408 * 1405 1409 * @returns VBox status code. 1406 * @param p VM Pointer to the VM.1410 * @param pUVM The user mode VM handle. 1407 1411 * @param pcbTotalMem Where to return total amount memory the VM may 1408 1412 * possibly use. … … 1425 1429 * lower number of shared pages? 1426 1430 */ 1427 VMMR3DECL(int) PGMR3QueryMemoryStats(P VM pVM, uint64_t *pcbTotalMem, uint64_t *pcbPrivateMem,1431 VMMR3DECL(int) PGMR3QueryMemoryStats(PUVM pUVM, uint64_t *pcbTotalMem, uint64_t *pcbPrivateMem, 1428 1432 uint64_t *pcbSharedMem, uint64_t *pcbZeroMem) 1429 1433 { 1434 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1435 PVM pVM = pUVM->pVM; 1430 1436 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 1431 1437 -
trunk/src/VBox/VMM/VMMR3/SSM.cpp
r42335 r44347 150 150 #include "SSMInternal.h" 151 151 #include <VBox/vmm/vm.h> 152 #include <VBox/vmm/uvm.h> 152 153 #include <VBox/err.h> 153 154 #include <VBox/log.h> … … 1362 1363 * @returns VBox status. 1363 1364 * 1364 * @param p VM Pointer to the VM.1365 * @param pUVM The user mode VM handle. 1365 1366 * @param pszName Data unit name. 1366 1367 * @param uInstance The instance identifier of the data unit. … … 1383 1384 * @param pvUser User argument. 1384 1385 */ 1385 VMMR3DECL(int) SSMR3RegisterExternal(P VM pVM, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,1386 VMMR3DECL(int) SSMR3RegisterExternal(PUVM pUVM, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess, 1386 1387 PFNSSMEXTLIVEPREP pfnLivePrep, PFNSSMEXTLIVEEXEC pfnLiveExec, PFNSSMEXTLIVEVOTE pfnLiveVote, 1387 1388 PFNSSMEXTSAVEPREP pfnSavePrep, PFNSSMEXTSAVEEXEC pfnSaveExec, PFNSSMEXTSAVEDONE pfnSaveDone, 1388 1389 PFNSSMEXTLOADPREP pfnLoadPrep, PFNSSMEXTLOADEXEC pfnLoadExec, PFNSSMEXTLOADDONE pfnLoadDone, void *pvUser) 1389 1390 { 1391 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1392 PVM pVM = pUVM->pVM; 1393 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 1394 1390 1395 PSSMUNIT pUnit; 1391 1396 int rc = ssmR3Register(pVM, pszName, uInstance, uVersion, cbGuess, NULL, &pUnit); … … 1638 1643 * @remark Only for dynamic data units. 1639 1644 */ 1640 VMMR3DECL(int) SSMR3DeregisterExternal(PVM pVM, const char *pszName) 1641 { 1645 VMMR3DECL(int) SSMR3DeregisterExternal(PUVM pUVM, const char *pszName) 1646 { 1647 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1648 PVM pVM = pUVM->pVM; 1649 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 1650 1642 1651 return ssmR3DeregisterByNameAndType(pVM, pszName, SSMUNITTYPE_EXTERNAL); 1643 1652 } … … 9132 9141 * cancelled. 9133 9142 * 9134 * @param p VM Pointer to the VM.9143 * @param pUVM The VM handle. 9135 9144 * 9136 9145 * @thread Any. 9137 9146 */ 9138 VMMR3DECL(int) SSMR3Cancel(PVM pVM) 9139 { 9147 VMMR3DECL(int) SSMR3Cancel(PUVM pUVM) 9148 { 9149 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 9150 PVM pVM = pUVM->pVM; 9140 9151 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 9141 9152 -
trunk/src/VBox/VMM/VMMR3/STAM.cpp
r41965 r44347 349 349 { 350 350 AssertReturn(enmType != STAMTYPE_CALLBACK, VERR_INVALID_PARAMETER); 351 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 351 352 return stamR3RegisterU(pUVM, pvSample, NULL, NULL, enmType, enmVisibility, pszName, enmUnit, pszDesc); 352 353 } … … 739 740 VMMR3DECL(int) STAMR3DeregisterU(PUVM pUVM, void *pvSample) 740 741 { 742 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 743 741 744 STAM_LOCK_WR(pUVM); 742 745 … … 794 797 * 795 798 * @returns VBox status. (Basically, it cannot fail.) 796 * @param p VM Pointer to the VM.799 * @param pUVM The user mode VM handle. 797 800 * @param pszPat The name matching pattern. See somewhere_where_this_is_described_in_detail. 798 801 * If NULL all samples are reset. 799 802 * @remarks Don't confuse this with the other 'XYZR3Reset' methods, it's not called at VM reset. 800 803 */ 801 VMMR3DECL(int) STAMR3ResetU(PUVM pUVM, const char *pszPat) 802 { 804 VMMR3DECL(int) STAMR3Reset(PUVM pUVM, const char *pszPat) 805 { 806 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 807 VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE); 808 803 809 int rc = VINF_SUCCESS; 804 810 … … 876 882 877 883 /** 878 * Resets statistics for the specified VM.879 * It's possible to select a subset of the samples.880 *881 * @returns VBox status. (Basically, it cannot fail.)882 * @param pVM Pointer to the VM.883 * @param pszPat The name matching pattern. See somewhere_where_this_is_described_in_detail.884 * If NULL all samples are reset.885 * @remarks Don't confuse this with the other 'XYZR3Reset' methods, it's not called at VM reset.886 */887 VMMR3DECL(int) STAMR3Reset(PVM pVM, const char *pszPat)888 {889 return STAMR3ResetU(pVM->pUVM, pszPat);890 }891 892 893 /**894 884 * Resets one statistics sample. 895 885 * Callback for stamR3EnumU(). … … 976 966 * 977 967 * @returns VBox status. (Basically, it cannot fail.) 978 * @param pUVM Pointer to the user mode VM structure.968 * @param pUVM The user mode VM handle. 979 969 * @param pszPat The name matching pattern. See somewhere_where_this_is_described_in_detail. 980 970 * If NULL all samples are reset. … … 986 976 * @param pcchSnapshot Where to store the size of the snapshot data. (Excluding the trailing '\0') 987 977 */ 988 VMMR3DECL(int) STAMR3SnapshotU(PUVM pUVM, const char *pszPat, char **ppszSnapshot, size_t *pcchSnapshot, bool fWithDesc) 989 { 978 VMMR3DECL(int) STAMR3Snapshot(PUVM pUVM, const char *pszPat, char **ppszSnapshot, size_t *pcchSnapshot, bool fWithDesc) 979 { 980 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 981 VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE); 982 990 983 STAMR3SNAPSHOTONE State = { NULL, NULL, NULL, pUVM->pVM, 0, VINF_SUCCESS, fWithDesc }; 991 984 … … 1019 1012 *pcchSnapshot = State.psz - State.pszStart; 1020 1013 return rc; 1021 }1022 1023 1024 /**1025 * Get a snapshot of the statistics.1026 * It's possible to select a subset of the samples.1027 *1028 * @returns VBox status. (Basically, it cannot fail.)1029 * @param pVM Pointer to the VM.1030 * @param pszPat The name matching pattern. See somewhere_where_this_is_described_in_detail.1031 * If NULL all samples are reset.1032 * @param fWithDesc Whether to include the descriptions.1033 * @param ppszSnapshot Where to store the pointer to the snapshot data.1034 * The format of the snapshot should be XML, but that will have to be discussed1035 * when this function is implemented.1036 * The returned pointer must be freed by calling STAMR3SnapshotFree().1037 * @param pcchSnapshot Where to store the size of the snapshot data.1038 * (Excluding the trailing '\\0')1039 */1040 VMMR3DECL(int) STAMR3Snapshot(PVM pVM, const char *pszPat, char **ppszSnapshot, size_t *pcchSnapshot, bool fWithDesc)1041 {1042 return STAMR3SnapshotU(pVM->pUVM, pszPat, ppszSnapshot, pcchSnapshot, fWithDesc);1043 1014 } 1044 1015 … … 1283 1254 * 1284 1255 * @returns VBox status. 1285 * @param pUVM Pointer to the user mode VM structure.1256 * @param pUVM The user mode VM handle. 1286 1257 * @param pszSnapshot The snapshot data pointer returned by STAMR3Snapshot(). 1287 1258 * NULL is allowed. 1288 1259 */ 1289 VMMR3DECL(int) STAMR3SnapshotFree U(PUVM pUVM, char *pszSnapshot)1260 VMMR3DECL(int) STAMR3SnapshotFree(PUVM pUVM, char *pszSnapshot) 1290 1261 { 1291 1262 if (!pszSnapshot) … … 1297 1268 1298 1269 /** 1299 * Releases a statistics snapshot returned by STAMR3Snapshot().1300 *1301 * @returns VBox status.1302 * @param pVM Pointer to the VM.1303 * @param pszSnapshot The snapshot data pointer returned by STAMR3Snapshot().1304 * NULL is allowed.1305 */1306 VMMR3DECL(int) STAMR3SnapshotFree(PVM pVM, char *pszSnapshot)1307 {1308 return STAMR3SnapshotFreeU(pVM->pUVM, pszSnapshot);1309 }1310 1311 1312 /**1313 1270 * Dumps the selected statistics to the log. 1314 1271 * … … 1318 1275 * If NULL all samples are written to the log. 1319 1276 */ 1320 VMMR3DECL(int) STAMR3DumpU(PUVM pUVM, const char *pszPat) 1321 { 1277 VMMR3DECL(int) STAMR3Dump(PUVM pUVM, const char *pszPat) 1278 { 1279 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1280 VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE); 1281 1322 1282 STAMR3PRINTONEARGS Args; 1323 1283 Args.pVM = pUVM->pVM; … … 1327 1287 stamR3EnumU(pUVM, pszPat, true /* fUpdateRing0 */, stamR3PrintOne, &Args); 1328 1288 return VINF_SUCCESS; 1329 }1330 1331 1332 /**1333 * Dumps the selected statistics to the log.1334 *1335 * @returns VBox status.1336 * @param pVM Pointer to the VM.1337 * @param pszPat The name matching pattern. See somewhere_where_this_is_described_in_detail.1338 * If NULL all samples are written to the log.1339 */1340 VMMR3DECL(int) STAMR3Dump(PVM pVM, const char *pszPat)1341 {1342 return STAMR3DumpU(pVM->pUVM, pszPat);1343 1289 } 1344 1290 … … 1369 1315 * If NULL all samples are written to the log. 1370 1316 */ 1371 VMMR3DECL(int) STAMR3DumpToReleaseLogU(PUVM pUVM, const char *pszPat) 1372 { 1317 VMMR3DECL(int) STAMR3DumpToReleaseLog(PUVM pUVM, const char *pszPat) 1318 { 1319 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1320 VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE); 1321 1373 1322 STAMR3PRINTONEARGS Args; 1374 1323 Args.pVM = pUVM->pVM; … … 1379 1328 return VINF_SUCCESS; 1380 1329 } 1381 1382 1383 /**1384 * Dumps the selected statistics to the release log.1385 *1386 * @returns VBox status.1387 * @param pVM Pointer to the VM.1388 * @param pszPat The name matching pattern. See somewhere_where_this_is_described_in_detail.1389 * If NULL all samples are written to the log.1390 */1391 VMMR3DECL(int) STAMR3DumpToReleaseLog(PVM pVM, const char *pszPat)1392 {1393 return STAMR3DumpToReleaseLogU(pVM->pUVM, pszPat);1394 }1395 1396 1330 1397 1331 /** … … 1416 1350 * 1417 1351 * @returns VBox status. 1418 * @param p VM Pointer to the VM.1352 * @param pUVM The user mode VM handle. 1419 1353 * @param pszPat The name matching pattern. See somewhere_where_this_is_described_in_detail. 1420 1354 * If NULL all samples are reset. 1421 1355 */ 1422 VMMR3DECL(int) STAMR3PrintU(PUVM pUVM, const char *pszPat) 1423 { 1356 VMMR3DECL(int) STAMR3Print(PUVM pUVM, const char *pszPat) 1357 { 1358 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1359 VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE); 1360 1424 1361 STAMR3PRINTONEARGS Args; 1425 1362 Args.pVM = pUVM->pVM; … … 1429 1366 stamR3EnumU(pUVM, pszPat, true /* fUpdateRing0 */, stamR3PrintOne, &Args); 1430 1367 return VINF_SUCCESS; 1431 }1432 1433 1434 /**1435 * Prints the selected statistics to standard out.1436 *1437 * @returns VBox status.1438 * @param pVM Pointer to the VM.1439 * @param pszPat The name matching pattern. See somewhere_where_this_is_described_in_detail.1440 * If NULL all samples are reset.1441 */1442 VMMR3DECL(int) STAMR3Print(PVM pVM, const char *pszPat)1443 {1444 return STAMR3PrintU(pVM->pUVM, pszPat);1445 1368 } 1446 1369 … … 1590 1513 * @returns Whatever the callback returns. 1591 1514 * 1592 * @param pUVM Pointer to the user mode VM structure.1515 * @param pUVM The user mode VM handle. 1593 1516 * @param pszPat The pattern to match samples. 1594 1517 * @param pfnEnum The callback function. 1595 1518 * @param pvUser The pvUser argument of the callback function. 1596 1519 */ 1597 VMMR3DECL(int) STAMR3EnumU(PUVM pUVM, const char *pszPat, PFNSTAMR3ENUM pfnEnum, void *pvUser) 1598 { 1520 VMMR3DECL(int) STAMR3Enum(PUVM pUVM, const char *pszPat, PFNSTAMR3ENUM pfnEnum, void *pvUser) 1521 { 1522 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1523 VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE); 1524 1599 1525 STAMR3ENUMONEARGS Args; 1600 1526 Args.pVM = pUVM->pVM; … … 1603 1529 1604 1530 return stamR3EnumU(pUVM, pszPat, true /* fUpdateRing0 */, stamR3EnumOne, &Args); 1605 }1606 1607 1608 /**1609 * Enumerate the statistics by the means of a callback function.1610 *1611 * @returns Whatever the callback returns.1612 *1613 * @param pVM Pointer to the VM.1614 * @param pszPat The pattern to match samples.1615 * @param pfnEnum The callback function.1616 * @param pvUser The pvUser argument of the callback function.1617 */1618 VMMR3DECL(int) STAMR3Enum(PVM pVM, const char *pszPat, PFNSTAMR3ENUM pfnEnum, void *pvUser)1619 {1620 return STAMR3EnumU(pVM->pUVM, pszPat, pfnEnum, pvUser);1621 1531 } 1622 1532 … … 2077 1987 * Execute reset. 2078 1988 */ 2079 int rc = STAMR3Reset U(pUVM, cArgs ? paArgs[0].u.pszString : NULL);1989 int rc = STAMR3Reset(pUVM, cArgs ? paArgs[0].u.pszString : NULL); 2080 1990 if (RT_SUCCESS(rc)) 2081 1991 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "STAMR3ResetU"); -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r44340 r44347 2173 2173 return rc; 2174 2174 if (rc >= 7) 2175 SSMR3Cancel(pVM );2175 SSMR3Cancel(pVM->pUVM); 2176 2176 } 2177 2177 … … 2384 2384 #endif 2385 2385 #ifdef VBOX_WITH_STATISTICS 2386 STAMR3Dump(p VM, "*");2386 STAMR3Dump(pUVM, "*"); 2387 2387 #else 2388 2388 LogRel(("************************* Statistics *************************\n")); 2389 STAMR3DumpToReleaseLog(p VM, "*");2389 STAMR3DumpToReleaseLog(pUVM, "*"); 2390 2390 LogRel(("********************* End of statistics **********************\n")); 2391 2391 #endif … … 3371 3371 { 3372 3372 vmR3SetStateLocked(pVM, pUVM, VMSTATE_GURU_MEDITATION_LS, VMSTATE_RUNNING_LS); 3373 SSMR3Cancel(p VM);3373 SSMR3Cancel(pUVM); 3374 3374 } 3375 3375 … … 3920 3920 return rc; 3921 3921 if (rc == 2) 3922 SSMR3Cancel(pVM );3922 SSMR3Cancel(pVM->pUVM); 3923 3923 3924 3924 VM_FF_SET(pVM, VM_FF_CHECK_VM_STATE); -
trunk/src/VBox/VMM/testcase/tstMicro.cpp
r44340 r44347 356 356 rc = VMR3ReqCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)doit, 1, pVM); 357 357 AssertRC(rc); 358 STAMR3Dump(p VM, "*");358 STAMR3Dump(pUVM, "*"); 359 359 360 360 /* -
trunk/src/VBox/VMM/testcase/tstVMM-HM.cpp
r44340 r44347 95 95 AssertRC(rc); 96 96 97 STAMR3Dump(p VM, "*");97 STAMR3Dump(pUVM, "*"); 98 98 99 99 /* -
trunk/src/VBox/VMM/testcase/tstVMM.cpp
r44340 r44347 287 287 } 288 288 289 STAMR3Dump(p VM, "*");289 STAMR3Dump(pUVM, "*"); 290 290 291 291 /* -
trunk/src/VBox/VMM/testcase/tstVMMFork.cpp
r44340 r44347 135 135 VMR3ReqCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)VMMDoTest, 1, pVM); 136 136 137 STAMR3Dump(p VM, "*");137 STAMR3Dump(pUVM, "*"); 138 138 } 139 139 } -
trunk/src/VBox/VMM/testcase/tstVMREQ.cpp
r44340 r44347 273 273 * Print stats. 274 274 */ 275 STAMR3Print( VMR3GetVM(pUVM), "/VM/Req/*");275 STAMR3Print(pUVM, "/VM/Req/*"); 276 276 277 277 /*
Note:
See TracChangeset
for help on using the changeset viewer.