Changeset 46493 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 11, 2013 1:34:40 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PATM.cpp
r46159 r46493 5631 5631 if (PATM_STAT_INDEX_IS_VALID(pPatchRec->patch.uPatchIdx)) 5632 5632 { 5633 STAMR3Deregister(pVM, &pPatchRec->patch); 5634 #ifndef DEBUG_sandervl 5635 STAMR3Deregister(pVM, &pVM->patm.s.pStatsHC[pPatchRec->patch.uPatchIdx]); 5636 STAMR3Deregister(pVM, &pPatchRec->patch.cbPatchBlockSize); 5637 STAMR3Deregister(pVM, &pPatchRec->patch.cbPatchJump); 5638 STAMR3Deregister(pVM, &pPatchRec->patch.cbPrivInstr); 5639 STAMR3Deregister(pVM, &pPatchRec->patch.cCodeWrites); 5640 STAMR3Deregister(pVM, &pPatchRec->patch.cInvalidWrites); 5641 STAMR3Deregister(pVM, &pPatchRec->patch.cTraps); 5642 STAMR3Deregister(pVM, &pPatchRec->patch.flags); 5643 STAMR3Deregister(pVM, &pPatchRec->patch.nrJumpRecs); 5644 STAMR3Deregister(pVM, &pPatchRec->patch.nrFixups); 5645 STAMR3Deregister(pVM, &pPatchRec->patch.opcode); 5646 STAMR3Deregister(pVM, &pPatchRec->patch.uState); 5647 STAMR3Deregister(pVM, &pPatchRec->patch.uOldState); 5648 STAMR3Deregister(pVM, &pPatchRec->patch.uOpMode); 5649 #endif 5633 STAMR3DeregisterF(pVM->pUVM, "/PATM/Stats/Patch/0x%RRv", pPatchRec->patch.pPrivInstrGC); 5634 STAMR3DeregisterF(pVM->pUVM, "/PATM/Stats/PatchBD/0x%RRv*", pPatchRec->patch.pPrivInstrGC); 5650 5635 } 5651 5636 #endif … … 5749 5734 } 5750 5735 5751 /* *Note: quite ugly to enable/disable/remove/insert old and new patches, but there's no easy way around it. */5736 /* Note: quite ugly to enable/disable/remove/insert old and new patches, but there's no easy way around it. */ 5752 5737 5753 5738 rc = PATMR3DisablePatch(pVM, pInstrGC); 5754 5739 AssertRC(rc); 5755 5740 5756 /* *Kick it out of the lookup tree to make sure PATMR3InstallPatch doesn't fail (hack alert) */5741 /* Kick it out of the lookup tree to make sure PATMR3InstallPatch doesn't fail (hack alert) */ 5757 5742 RTAvloU32Remove(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pPatchRec->Core.Key); 5758 5743 #ifdef VBOX_WITH_STATISTICS 5759 5744 if (PATM_STAT_INDEX_IS_VALID(pPatchRec->patch.uPatchIdx)) 5760 5745 { 5761 STAMR3Deregister(pVM, &pPatchRec->patch); 5762 #ifndef DEBUG_sandervl 5763 STAMR3Deregister(pVM, &pVM->patm.s.pStatsHC[pPatchRec->patch.uPatchIdx]); 5764 STAMR3Deregister(pVM, &pPatchRec->patch.cbPatchBlockSize); 5765 STAMR3Deregister(pVM, &pPatchRec->patch.cbPatchJump); 5766 STAMR3Deregister(pVM, &pPatchRec->patch.cbPrivInstr); 5767 STAMR3Deregister(pVM, &pPatchRec->patch.cCodeWrites); 5768 STAMR3Deregister(pVM, &pPatchRec->patch.cInvalidWrites); 5769 STAMR3Deregister(pVM, &pPatchRec->patch.cTraps); 5770 STAMR3Deregister(pVM, &pPatchRec->patch.flags); 5771 STAMR3Deregister(pVM, &pPatchRec->patch.nrJumpRecs); 5772 STAMR3Deregister(pVM, &pPatchRec->patch.nrFixups); 5773 STAMR3Deregister(pVM, &pPatchRec->patch.opcode); 5774 STAMR3Deregister(pVM, &pPatchRec->patch.uState); 5775 STAMR3Deregister(pVM, &pPatchRec->patch.uOldState); 5776 STAMR3Deregister(pVM, &pPatchRec->patch.uOpMode); 5777 #endif 5746 STAMR3DeregisterF(pVM->pUVM, "/PATM/Stats/Patch/0x%RRv", pPatchRec->patch.pPrivInstrGC); 5747 STAMR3DeregisterF(pVM->pUVM, "/PATM/Stats/PatchBD/0x%RRv*", pPatchRec->patch.pPrivInstrGC); 5778 5748 } 5779 5749 #endif -
trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletion.cpp
r44358 r46493 1049 1049 pEndpoint->tsIntervalStartMs = RTTimeMilliTS(); 1050 1050 1051 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesNs); i++) 1052 { 1051 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesNs) && RT_SUCCESS(rc); i++) 1053 1052 rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesNs[i], STAMTYPE_COUNTER, 1054 1053 STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, … … 1056 1055 "/PDM/AsyncCompletion/File/%s/TaskRun1Ns-%u-%u", 1057 1056 RTPathFilename(pEndpoint->pszUri), i*100, i*100+100-1); 1058 if (RT_FAILURE(rc)) 1059 break; 1060 } 1061 1062 if (RT_SUCCESS(rc)) 1063 { 1064 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesUs); i++) 1065 { 1066 rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesUs[i], STAMTYPE_COUNTER, 1067 STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 1068 "Microsecond resolution runtime statistics", 1069 "/PDM/AsyncCompletion/File/%s/TaskRun2MicroSec-%u-%u", 1070 RTPathFilename(pEndpoint->pszUri), i*100, i*100+100-1); 1071 if (RT_FAILURE(rc)) 1072 break; 1073 } 1074 } 1075 1076 if (RT_SUCCESS(rc)) 1077 { 1078 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesMs); i++) 1079 { 1080 rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesMs[i], STAMTYPE_COUNTER, 1081 STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 1082 "Milliseconds resolution runtime statistics", 1083 "/PDM/AsyncCompletion/File/%s/TaskRun3Ms-%u-%u", 1084 RTPathFilename(pEndpoint->pszUri), i*100, i*100+100-1); 1085 if (RT_FAILURE(rc)) 1086 break; 1087 } 1088 } 1089 1090 if (RT_SUCCESS(rc)) 1091 { 1092 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesMs); i++) 1093 { 1094 rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesSec[i], STAMTYPE_COUNTER, 1095 STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 1096 "Second resolution runtime statistics", 1097 "/PDM/AsyncCompletion/File/%s/TaskRun4Sec-%u-%u", 1098 RTPathFilename(pEndpoint->pszUri), i*10, i*10+10-1); 1099 if (RT_FAILURE(rc)) 1100 break; 1101 } 1102 } 1103 1104 if (RT_SUCCESS(rc)) 1105 { 1057 1058 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesUs) && RT_SUCCESS(rc); i++) 1059 rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesUs[i], STAMTYPE_COUNTER, 1060 STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 1061 "Microsecond resolution runtime statistics", 1062 "/PDM/AsyncCompletion/File/%s/TaskRun2MicroSec-%u-%u", 1063 RTPathFilename(pEndpoint->pszUri), i*100, i*100+100-1); 1064 1065 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesMs) && RT_SUCCESS(rc); i++) 1066 rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesMs[i], STAMTYPE_COUNTER, 1067 STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 1068 "Milliseconds resolution runtime statistics", 1069 "/PDM/AsyncCompletion/File/%s/TaskRun3Ms-%u-%u", 1070 RTPathFilename(pEndpoint->pszUri), i*100, i*100+100-1); 1071 1072 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesMs) && RT_SUCCESS(rc); i++) 1073 rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesSec[i], STAMTYPE_COUNTER, 1074 STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 1075 "Second resolution runtime statistics", 1076 "/PDM/AsyncCompletion/File/%s/TaskRun4Sec-%u-%u", 1077 RTPathFilename(pEndpoint->pszUri), i*10, i*10+10-1); 1078 1079 if (RT_SUCCESS(rc)) 1106 1080 rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunOver100Sec, STAMTYPE_COUNTER, 1107 1081 STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, … … 1109 1083 "/PDM/AsyncCompletion/File/%s/TaskRunSecGreater100Sec", 1110 1084 RTPathFilename(pEndpoint->pszUri)); 1111 } 1112 1113 if (RT_SUCCESS(rc)) 1114 { 1085 1086 if (RT_SUCCESS(rc)) 1115 1087 rc = STAMR3RegisterF(pVM, &pEndpoint->StatIoOpsPerSec, STAMTYPE_COUNTER, 1116 1088 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1118 1090 "/PDM/AsyncCompletion/File/%s/IoOpsPerSec", 1119 1091 RTPathFilename(pEndpoint->pszUri)); 1120 } 1121 1122 if (RT_SUCCESS(rc)) 1123 { 1092 1093 if (RT_SUCCESS(rc)) 1124 1094 rc = STAMR3RegisterF(pVM, &pEndpoint->StatIoOpsStarted, STAMTYPE_COUNTER, 1125 1095 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1127 1097 "/PDM/AsyncCompletion/File/%s/IoOpsStarted", 1128 1098 RTPathFilename(pEndpoint->pszUri)); 1129 } 1130 1131 if (RT_SUCCESS(rc)) 1132 { 1099 1100 if (RT_SUCCESS(rc)) 1133 1101 rc = STAMR3RegisterF(pVM, &pEndpoint->StatIoOpsCompleted, STAMTYPE_COUNTER, 1134 1102 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1136 1104 "/PDM/AsyncCompletion/File/%s/IoOpsCompleted", 1137 1105 RTPathFilename(pEndpoint->pszUri)); 1138 } 1139 1140 if (RT_SUCCESS(rc)) 1141 { 1106 1107 if (RT_SUCCESS(rc)) 1142 1108 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqSizeSmaller512, STAMTYPE_COUNTER, 1143 1109 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1145 1111 "/PDM/AsyncCompletion/File/%s/ReqSizeSmaller512", 1146 1112 RTPathFilename(pEndpoint->pszUri)); 1147 } 1148 1149 if (RT_SUCCESS(rc)) 1150 { 1113 1114 if (RT_SUCCESS(rc)) 1151 1115 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqSize512To1K, STAMTYPE_COUNTER, 1152 1116 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1154 1118 "/PDM/AsyncCompletion/File/%s/ReqSize512To1K", 1155 1119 RTPathFilename(pEndpoint->pszUri)); 1156 } 1157 1158 if (RT_SUCCESS(rc)) 1159 { 1120 1121 if (RT_SUCCESS(rc)) 1160 1122 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqSize1KTo2K, STAMTYPE_COUNTER, 1161 1123 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1163 1125 "/PDM/AsyncCompletion/File/%s/ReqSize1KTo2K", 1164 1126 RTPathFilename(pEndpoint->pszUri)); 1165 } 1166 1167 if (RT_SUCCESS(rc)) 1168 { 1127 1128 if (RT_SUCCESS(rc)) 1169 1129 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqSize2KTo4K, STAMTYPE_COUNTER, 1170 1130 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1172 1132 "/PDM/AsyncCompletion/File/%s/ReqSize2KTo4K", 1173 1133 RTPathFilename(pEndpoint->pszUri)); 1174 } 1175 1176 if (RT_SUCCESS(rc)) 1177 { 1134 1135 if (RT_SUCCESS(rc)) 1178 1136 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqSize4KTo8K, STAMTYPE_COUNTER, 1179 1137 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1181 1139 "/PDM/AsyncCompletion/File/%s/ReqSize4KTo8K", 1182 1140 RTPathFilename(pEndpoint->pszUri)); 1183 } 1184 1185 if (RT_SUCCESS(rc)) 1186 { 1141 1142 if (RT_SUCCESS(rc)) 1187 1143 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqSize8KTo16K, STAMTYPE_COUNTER, 1188 1144 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1190 1146 "/PDM/AsyncCompletion/File/%s/ReqSize8KTo16K", 1191 1147 RTPathFilename(pEndpoint->pszUri)); 1192 } 1193 1194 if (RT_SUCCESS(rc)) 1195 { 1148 1149 if (RT_SUCCESS(rc)) 1196 1150 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqSize16KTo32K, STAMTYPE_COUNTER, 1197 1151 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1199 1153 "/PDM/AsyncCompletion/File/%s/ReqSize16KTo32K", 1200 1154 RTPathFilename(pEndpoint->pszUri)); 1201 } 1202 1203 if (RT_SUCCESS(rc)) 1204 { 1155 1156 if (RT_SUCCESS(rc)) 1205 1157 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqSize32KTo64K, STAMTYPE_COUNTER, 1206 1158 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1208 1160 "/PDM/AsyncCompletion/File/%s/ReqSize32KTo64K", 1209 1161 RTPathFilename(pEndpoint->pszUri)); 1210 } 1211 1212 if (RT_SUCCESS(rc)) 1213 { 1162 1163 if (RT_SUCCESS(rc)) 1214 1164 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqSize64KTo128K, STAMTYPE_COUNTER, 1215 1165 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1217 1167 "/PDM/AsyncCompletion/File/%s/ReqSize64KTo128K", 1218 1168 RTPathFilename(pEndpoint->pszUri)); 1219 } 1220 1221 if (RT_SUCCESS(rc)) 1222 { 1169 1170 if (RT_SUCCESS(rc)) 1223 1171 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqSize128KTo256K, STAMTYPE_COUNTER, 1224 1172 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1226 1174 "/PDM/AsyncCompletion/File/%s/ReqSize128KTo256K", 1227 1175 RTPathFilename(pEndpoint->pszUri)); 1228 } 1229 1230 if (RT_SUCCESS(rc)) 1231 { 1176 1177 if (RT_SUCCESS(rc)) 1232 1178 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqSize256KTo512K, STAMTYPE_COUNTER, 1233 1179 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1235 1181 "/PDM/AsyncCompletion/File/%s/ReqSize256KTo512K", 1236 1182 RTPathFilename(pEndpoint->pszUri)); 1237 } 1238 1239 if (RT_SUCCESS(rc)) 1240 { 1183 1184 if (RT_SUCCESS(rc)) 1241 1185 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqSizeOver512K, STAMTYPE_COUNTER, 1242 1186 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1244 1188 "/PDM/AsyncCompletion/File/%s/ReqSizeOver512K", 1245 1189 RTPathFilename(pEndpoint->pszUri)); 1246 } 1247 1248 if (RT_SUCCESS(rc)) 1249 { 1190 1191 if (RT_SUCCESS(rc)) 1250 1192 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqsUnaligned512, STAMTYPE_COUNTER, 1251 1193 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1253 1195 "/PDM/AsyncCompletion/File/%s/ReqsUnaligned512", 1254 1196 RTPathFilename(pEndpoint->pszUri)); 1255 } 1256 1257 if (RT_SUCCESS(rc)) 1258 { 1197 1198 if (RT_SUCCESS(rc)) 1259 1199 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqsUnaligned4K, STAMTYPE_COUNTER, 1260 1200 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1262 1202 "/PDM/AsyncCompletion/File/%s/ReqsUnaligned4K", 1263 1203 RTPathFilename(pEndpoint->pszUri)); 1264 } 1265 1266 if (RT_SUCCESS(rc)) 1267 { 1204 1205 if (RT_SUCCESS(rc)) 1268 1206 rc = STAMR3RegisterF(pVM, &pEndpoint->StatReqsUnaligned8K, STAMTYPE_COUNTER, 1269 1207 STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, … … 1271 1209 "/PDM/AsyncCompletion/File/%s/ReqsUnaligned8K", 1272 1210 RTPathFilename(pEndpoint->pszUri)); 1273 }1274 1211 1275 1212 return rc; … … 1285 1222 static void pdmR3AsyncCompletionStatisticsDeregister(PPDMASYNCCOMPLETIONENDPOINT pEndpoint) 1286 1223 { 1287 PVM pVM = pEndpoint->pEpClass->pVM; 1288 1289 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesNs); i++) 1290 STAMR3Deregister(pVM, &pEndpoint->StatTaskRunTimesNs[i]); 1291 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesUs); i++) 1292 STAMR3Deregister(pVM, &pEndpoint->StatTaskRunTimesUs[i]); 1293 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesMs); i++) 1294 STAMR3Deregister(pVM, &pEndpoint->StatTaskRunTimesMs[i]); 1295 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesMs); i++) 1296 STAMR3Deregister(pVM, &pEndpoint->StatTaskRunTimesSec[i]); 1297 1298 STAMR3Deregister(pVM, &pEndpoint->StatTaskRunOver100Sec); 1299 STAMR3Deregister(pVM, &pEndpoint->StatIoOpsPerSec); 1300 STAMR3Deregister(pVM, &pEndpoint->StatIoOpsStarted); 1301 STAMR3Deregister(pVM, &pEndpoint->StatIoOpsCompleted); 1302 1303 STAMR3Deregister(pVM, &pEndpoint->StatReqSizeSmaller512); 1304 STAMR3Deregister(pVM, &pEndpoint->StatReqSize512To1K); 1305 STAMR3Deregister(pVM, &pEndpoint->StatReqSize1KTo2K); 1306 STAMR3Deregister(pVM, &pEndpoint->StatReqSize2KTo4K); 1307 STAMR3Deregister(pVM, &pEndpoint->StatReqSize4KTo8K); 1308 STAMR3Deregister(pVM, &pEndpoint->StatReqSize8KTo16K); 1309 STAMR3Deregister(pVM, &pEndpoint->StatReqSize16KTo32K); 1310 STAMR3Deregister(pVM, &pEndpoint->StatReqSize32KTo64K); 1311 STAMR3Deregister(pVM, &pEndpoint->StatReqSize64KTo128K); 1312 STAMR3Deregister(pVM, &pEndpoint->StatReqSize128KTo256K); 1313 STAMR3Deregister(pVM, &pEndpoint->StatReqSize256KTo512K); 1314 STAMR3Deregister(pVM, &pEndpoint->StatReqSizeOver512K); 1315 STAMR3Deregister(pVM, &pEndpoint->StatReqsUnaligned512); 1316 STAMR3Deregister(pVM, &pEndpoint->StatReqsUnaligned4K); 1317 STAMR3Deregister(pVM, &pEndpoint->StatReqsUnaligned8K); 1224 /* I hope this doesn't remove too much... */ 1225 STAMR3DeregisterF(pEndpoint->pEpClass->pVM->pUVM, "/PDM/AsyncCompletion/File/%s/*", RTPathFilename(pEndpoint->pszUri)); 1318 1226 } 1319 1227 -
trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp
r44528 r46493 1154 1154 1155 1155 #ifdef VBOX_WITH_STATISTICS 1156 STAMR3Deregister(pEpClassFile->Core.pVM, &pEpFile->StatRead);1157 STAMR3Deregister (pEpClassFile->Core.pVM, &pEpFile->StatWrite);1156 /* Not sure if this might be unnecessary because of similar statement in pdmR3AsyncCompletionStatisticsDeregister? */ 1157 STAMR3DeregisterF(pEpClassFile->Core.pVM->pUVM, "/PDM/AsyncCompletion/File/%s/*", RTPathFilename(pEpFile->Core.pszUri)); 1158 1158 #endif 1159 1159 -
trunk/src/VBox/VMM/VMMR3/PDMBlkCache.cpp
r44528 r46493 1242 1242 return VINF_SUCCESS; 1243 1243 } 1244 else 1245 rc = VERR_NO_MEMORY; 1246 1244 1245 rc = VERR_NO_MEMORY; 1247 1246 RTSemRWDestroy(pBlkCache->SemRWEntries); 1248 1247 } … … 1446 1445 1447 1446 #ifdef VBOX_WITH_STATISTICS 1448 STAMR3Deregister (pCache->pVM, &pBlkCache->StatWriteDeferred);1447 STAMR3DeregisterF(pCache->pVM->pUVM, "/PDM/BlkCache/%s/Cache/DeferredWrites", pBlkCache->pszId); 1449 1448 #endif 1450 1449 -
trunk/src/VBox/VMM/VMMR3/PDMCritSect.cpp
r45177 r46493 525 525 pCritSect->pVMR0 = NIL_RTR0PTR; 526 526 pCritSect->pVMRC = NIL_RTRCPTR; 527 if (!fFinal) 528 STAMR3DeregisterF(pVM->pUVM, "/PDM/CritSects/%s/*", pCritSect->pszName); 527 529 RTStrFree((char *)pCritSect->pszName); 528 530 pCritSect->pszName = NULL; 529 if (!fFinal)530 {531 STAMR3Deregister(pVM, &pCritSect->StatContentionRZLock);532 STAMR3Deregister(pVM, &pCritSect->StatContentionRZUnlock);533 STAMR3Deregister(pVM, &pCritSect->StatContentionR3);534 #ifdef VBOX_WITH_STATISTICS535 STAMR3Deregister(pVM, &pCritSect->StatLocked);536 #endif537 }538 531 return rc; 539 532 } … … 602 595 pCritSect->pVMR0 = NIL_RTR0PTR; 603 596 pCritSect->pVMRC = NIL_RTRCPTR; 597 if (!fFinal) 598 STAMR3DeregisterF(pVM->pUVM, "/PDM/CritSectsRw/%s/*", pCritSect->pszName); 604 599 RTStrFree((char *)pCritSect->pszName); 605 600 pCritSect->pszName = NULL; 606 if (!fFinal)607 {608 STAMR3Deregister(pVM, &pCritSect->StatContentionRZEnterExcl);609 STAMR3Deregister(pVM, &pCritSect->StatContentionRZLeaveExcl);610 STAMR3Deregister(pVM, &pCritSect->StatContentionRZEnterShared);611 STAMR3Deregister(pVM, &pCritSect->StatContentionRZLeaveShared);612 STAMR3Deregister(pVM, &pCritSect->StatRZEnterExcl);613 STAMR3Deregister(pVM, &pCritSect->StatRZEnterShared);614 STAMR3Deregister(pVM, &pCritSect->StatContentionR3EnterExcl);615 STAMR3Deregister(pVM, &pCritSect->StatContentionR3EnterShared);616 STAMR3Deregister(pVM, &pCritSect->StatR3EnterExcl);617 STAMR3Deregister(pVM, &pCritSect->StatR3EnterShared);618 #ifdef VBOX_WITH_STATISTICS619 STAMR3Deregister(pVM, &pCritSect->StatWriteLocked);620 #endif621 }622 601 623 602 return RT_SUCCESS(rc1) ? rc2 : rc1; -
trunk/src/VBox/VMM/VMMR3/PDMDriver.cpp
r45808 r46493 1427 1427 VM_ASSERT_EMT(pDrvIns->Internal.s.pVMR3); 1428 1428 1429 int rc = STAMR3Deregister U(pDrvIns->Internal.s.pVMR3->pUVM, pvSample);1429 int rc = STAMR3DeregisterByAddr(pDrvIns->Internal.s.pVMR3->pUVM, pvSample); 1430 1430 AssertRC(rc); 1431 1431 return rc; -
trunk/src/VBox/VMM/VMMR3/PDMQueue.cpp
r46420 r46493 446 446 * Deregister statistics. 447 447 */ 448 STAMR3Deregister(pVM, &pQueue->cbItem); 449 STAMR3Deregister(pVM, &pQueue->cbItem); 450 STAMR3Deregister(pVM, &pQueue->StatAllocFailures); 451 STAMR3Deregister(pVM, &pQueue->StatInsert); 452 STAMR3Deregister(pVM, &pQueue->StatFlush); 453 STAMR3Deregister(pVM, &pQueue->StatFlushLeftovers); 454 #ifdef VBOX_WITH_STATISTICS 455 STAMR3Deregister(pVM, &pQueue->StatFlushPrf); 456 STAMR3Deregister(pVM, (void *)&pQueue->cStatPending); 457 #endif 448 STAMR3DeregisterF(pVM->pUVM, "/PDM/Queue/%s/cbItem", pQueue->pszName); 458 449 459 450 /* -
trunk/src/VBox/VMM/VMMR3/PGMHandler.cpp
r45808 r46493 411 411 412 412 #ifdef VBOX_WITH_STATISTICS 413 char szPath[256]; 414 RTStrPrintf(szPath, sizeof(szPath), "/PGM/VirtHandler/Calls/%RGv-%RGv", pNew->Core.Key, pNew->Core.KeyLast); 415 rc = STAMR3Register(pVM, &pNew->Stat, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szPath, STAMUNIT_TICKS_PER_CALL, pszDesc); 413 rc = STAMR3RegisterF(pVM, &pNew->Stat, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, pszDesc, 414 "/PGM/VirtHandler/Calls/%RGv-%RGv", pNew->Core.Key, pNew->Core.KeyLast); 416 415 AssertRC(rc); 417 416 #endif … … 509 508 pgmUnlock(pVM); 510 509 511 STAM_DEREG(pVM, &pCur->Stat); 510 #ifdef VBOX_WITH_STATISTICS 511 STAMR3DeregisterF(pVM->pUVM, "/PGM/VirtHandler/Calls/%RGv-%RGv", pCur->Core.Key, pCur->Core.KeyLast); 512 #endif 512 513 MMHyperFree(pVM, pCur); 513 514 -
trunk/src/VBox/VMM/VMMR3/STAM.cpp
r46452 r46493 62 62 #include <iprt/stream.h> 63 63 #include <iprt/string.h> 64 65 66 /******************************************************************************* 67 * Defined Constants And Macros * 68 *******************************************************************************/ 69 /** The maximum name length excluding the terminator. */ 70 #define STAM_MAX_NAME_LEN 239 64 71 65 72 … … 487 494 AssertReturn(enmType != STAMTYPE_CALLBACK, VERR_INVALID_PARAMETER); 488 495 489 char *pszFormattedName; 490 RTStrAPrintfV(&pszFormattedName, pszName, args); 491 if (!pszFormattedName) 492 return VERR_NO_MEMORY; 493 494 int rc = STAMR3RegisterU(pUVM, pvSample, enmType, enmVisibility, pszFormattedName, enmUnit, pszDesc); 495 RTStrFree(pszFormattedName); 496 return rc; 496 char szFormattedName[STAM_MAX_NAME_LEN + 8]; 497 size_t cch = RTStrPrintfV(szFormattedName, sizeof(szFormattedName), pszName, args); 498 AssertReturn(cch <= STAM_MAX_NAME_LEN, VERR_OUT_OF_RANGE); 499 500 return STAMR3RegisterU(pUVM, pvSample, enmType, enmVisibility, szFormattedName, enmUnit, pszDesc); 497 501 } 498 502 … … 1254 1258 AssertReturn(pszName[1] != '/' && pszName[1], VERR_INVALID_NAME); 1255 1259 uint32_t const cchName = (uint32_t)strlen(pszName); 1256 AssertReturn(cchName < 256, VERR_OUT_OF_RANGE);1260 AssertReturn(cchName <= STAM_MAX_NAME_LEN, VERR_OUT_OF_RANGE); 1257 1261 AssertReturn(pszName[cchName - 1] != '/', VERR_INVALID_NAME); 1258 1262 AssertReturn(memchr(pszName, '\\', cchName) == NULL, VERR_INVALID_NAME); … … 1437 1441 1438 1442 /** 1439 * Deregisters a sample previously registered by STAR3Register(). 1443 * Destroys the statistics descriptor, unlinking it and freeing all resources. 1444 * 1445 * @returns VINF_SUCCESS 1446 * @param pUVM Pointer to the user mode VM structure. 1447 * @param pCur The descriptor to destroy. 1448 */ 1449 static int stamR3DestroyDesc(PUVM pUVM, PSTAMDESC pCur) 1450 { 1451 RTListNodeRemove(&pCur->ListEntry); 1452 #ifdef STAM_WITH_LOOKUP_TREE 1453 pCur->pLookup->pDesc = NULL; /** @todo free lookup nodes once it's working. */ 1454 stamR3LookupDecUsage(pCur->pLookup); 1455 stamR3LookupMaybeFree(pCur->pLookup); 1456 #endif 1457 RTMemFree(pCur); 1458 1459 return VINF_SUCCESS; 1460 } 1461 1462 1463 /** 1464 * Deregisters a sample previously registered by STAR3Register() given its 1465 * address. 1440 1466 * 1441 1467 * This is intended used for devices which can be unplugged and for … … 1446 1472 * @param pvSample Pointer to the sample registered with STAMR3Register(). 1447 1473 */ 1448 VMMR3DECL(int) STAMR3Deregister U(PUVM pUVM, void *pvSample)1474 VMMR3DECL(int) STAMR3DeregisterByAddr(PUVM pUVM, void *pvSample) 1449 1475 { 1450 1476 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1477 1478 /* This is a complete waste of time when shutting down. */ 1479 VMSTATE enmState = VMR3GetStateU(pUVM); 1480 if (enmState >= VMSTATE_DESTROYING) 1481 return VINF_SUCCESS; 1451 1482 1452 1483 STAM_LOCK_WR(pUVM); … … 1460 1491 { 1461 1492 if (pCur->u.pv == pvSample) 1462 { 1463 RTListNodeRemove(&pCur->ListEntry); 1464 #ifdef STAM_WITH_LOOKUP_TREE 1465 pCur->pLookup->pDesc = NULL; /** @todo free lookup nodes once it's working. */ 1466 stamR3LookupDecUsage(pCur->pLookup); 1467 stamR3LookupMaybeFree(pCur->pLookup); 1468 #endif 1469 RTMemFree(pCur); 1470 rc = VINF_SUCCESS; 1471 } 1493 rc = stamR3DestroyDesc(pUVM, pCur); 1472 1494 } 1473 1495 … … 1478 1500 1479 1501 /** 1480 * Deregisters a sample previously registered by STAR3Register(). 1481 * 1482 * This is intended used for devices which can be unplugged and for 1483 * temporary samples. 1502 * Worker for STAMR3Deregister, STAMR3DeregisterV and STAMR3DeregisterF. 1503 * 1504 * @returns VBox status code. 1505 * @retval VWRN_NOT_FOUND if no matching names found. 1506 * 1507 * @param pUVM Pointer to the user mode VM structure. 1508 * @param pszPat The name pattern. 1509 */ 1510 static int stamR3DeregisterByPattern(PUVM pUVM, const char *pszPat) 1511 { 1512 Assert(!strchr(pszPat, '|')); /* single pattern! */ 1513 1514 int rc = VWRN_NOT_FOUND; 1515 STAM_LOCK_WR(pUVM); 1516 1517 PSTAMDESC pLast; 1518 PSTAMDESC pCur = stamR3LookupFindPatternDescRange(pUVM->stam.s.pRoot, &pUVM->stam.s.List, pszPat, &pLast); 1519 if (pCur) 1520 { 1521 for (;;) 1522 { 1523 PSTAMDESC pNext = RTListNodeGetNext(&pCur->ListEntry, STAMDESC, ListEntry); 1524 1525 if (RTStrSimplePatternMatch(pszPat, pCur->pszName)) 1526 rc = stamR3DestroyDesc(pUVM, pCur); 1527 1528 /* advance. */ 1529 if (pCur == pLast) 1530 break; 1531 pCur = pNext; 1532 } 1533 Assert(pLast); 1534 } 1535 else 1536 Assert(!pLast); 1537 1538 STAM_UNLOCK_WR(pUVM); 1539 return rc; 1540 } 1541 1542 1543 /** 1544 * Deregister zero or more samples given a (single) pattern matching their 1545 * names. 1484 1546 * 1485 1547 * @returns VBox status. 1486 * @param pVM Pointer to the VM. 1487 * @param pvSample Pointer to the sample registered with STAMR3Register(). 1488 */ 1489 VMMR3DECL(int) STAMR3Deregister(PVM pVM, void *pvSample) 1490 { 1491 return STAMR3DeregisterU(pVM->pUVM, pvSample); 1548 * @param pUVM Pointer to the user mode VM structure. 1549 * @param pszPat The name pattern. 1550 * @sa STAMR3DeregisterF, STAMR3DeregisterV 1551 */ 1552 VMMR3DECL(int) STAMR3Deregister(PUVM pUVM, const char *pszPat) 1553 { 1554 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1555 1556 /* This is a complete waste of time when shutting down. */ 1557 VMSTATE enmState = VMR3GetStateU(pUVM); 1558 if (enmState >= VMSTATE_DESTROYING) 1559 return VINF_SUCCESS; 1560 1561 return stamR3DeregisterByPattern(pUVM, pszPat); 1562 } 1563 1564 1565 /** 1566 * Deregister zero or more samples given a (single) pattern matching their 1567 * names. 1568 * 1569 * @returns VBox status. 1570 * @param pUVM Pointer to the user mode VM structure. 1571 * @param pszPatFmt The name pattern format string. 1572 * @param ... Format string arguments. 1573 * @sa STAMR3Deregister, STAMR3DeregisterV 1574 */ 1575 VMMR3DECL(int) STAMR3DeregisterF(PUVM pUVM, const char *pszPatFmt, ...) 1576 { 1577 va_list va; 1578 va_start(va, pszPatFmt); 1579 int rc = STAMR3DeregisterV(pUVM, pszPatFmt, va); 1580 va_end(va); 1581 return rc; 1582 } 1583 1584 1585 /** 1586 * Deregister zero or more samples given a (single) pattern matching their 1587 * names. 1588 * 1589 * @returns VBox status. 1590 * @param pUVM Pointer to the user mode VM structure. 1591 * @param pszPatFmt The name pattern format string. 1592 * @param va Format string arguments. 1593 * @sa STAMR3Deregister, STAMR3DeregisterF 1594 */ 1595 VMMR3DECL(int) STAMR3DeregisterV(PUVM pUVM, const char *pszPatFmt, va_list va) 1596 { 1597 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1598 1599 /* This is a complete waste of time when shutting down. */ 1600 VMSTATE enmState = VMR3GetStateU(pUVM); 1601 if (enmState >= VMSTATE_DESTROYING) 1602 return VINF_SUCCESS; 1603 1604 char szPat[STAM_MAX_NAME_LEN + 8]; 1605 size_t cchPat = RTStrPrintfV(szPat, sizeof(szPat), pszPatFmt, va); 1606 AssertReturn(cchPat <= STAM_MAX_NAME_LEN, VERR_OUT_OF_RANGE); 1607 1608 return stamR3DeregisterByPattern(pUVM, szPat); 1492 1609 } 1493 1610
Note:
See TracChangeset
for help on using the changeset viewer.