VirtualBox

Changeset 35196 in vbox


Ignore:
Timestamp:
Dec 16, 2010 4:19:33 PM (14 years ago)
Author:
vboxsync
Message:

AsyncCompletion: Only register debug statistics if the endpoint creation succeeded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PDMAsyncCompletion.cpp

    r34873 r35196  
    12211221            pEndpoint->pBwMgr            = NULL;
    12221222
    1223 #ifdef VBOX_WITH_STATISTICS
    1224             /* Init the statistics part */
    1225             for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesNs); i++)
    1226             {
    1227                 rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesNs[i], STAMTYPE_COUNTER,
    1228                                      STAMVISIBILITY_USED,
    1229                                      STAMUNIT_OCCURENCES,
    1230                                      "Nanosecond resolution runtime statistics",
    1231                                      "/PDM/AsyncCompletion/File/%s/TaskRun1Ns-%u-%u",
    1232                                      RTPathFilename(pEndpoint->pszUri),
    1233                                      i*100, i*100+100-1);
    1234                 if (RT_FAILURE(rc))
    1235                     break;
    1236             }
    1237 
    1238             if (RT_SUCCESS(rc))
    1239             {
    1240                 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesMicroSec); i++)
    1241                 {
    1242                     rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesMicroSec[i], STAMTYPE_COUNTER,
    1243                                          STAMVISIBILITY_USED,
    1244                                          STAMUNIT_OCCURENCES,
    1245                                          "Microsecond resolution runtime statistics",
    1246                                          "/PDM/AsyncCompletion/File/%s/TaskRun2MicroSec-%u-%u",
    1247                                          RTPathFilename(pEndpoint->pszUri),
    1248                                         i*100, i*100+100-1);
    1249                     if (RT_FAILURE(rc))
    1250                         break;
    1251                 }
    1252             }
    1253 
    1254             if (RT_SUCCESS(rc))
    1255             {
    1256                 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesMs); i++)
    1257                 {
    1258                     rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesMs[i], STAMTYPE_COUNTER,
    1259                                          STAMVISIBILITY_USED,
    1260                                          STAMUNIT_OCCURENCES,
    1261                                          "Milliseconds resolution runtime statistics",
    1262                                          "/PDM/AsyncCompletion/File/%s/TaskRun3Ms-%u-%u",
    1263                                          RTPathFilename(pEndpoint->pszUri),
    1264                                         i*100, i*100+100-1);
    1265                     if (RT_FAILURE(rc))
    1266                         break;
    1267                 }
    1268             }
    1269 
    1270             if (RT_SUCCESS(rc))
    1271             {
    1272                 for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesMs); i++)
    1273                 {
    1274                     rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesSec[i], STAMTYPE_COUNTER,
    1275                                          STAMVISIBILITY_USED,
    1276                                          STAMUNIT_OCCURENCES,
    1277                                          "Second resolution runtime statistics",
    1278                                          "/PDM/AsyncCompletion/File/%s/TaskRun4Sec-%u-%u",
    1279                                          RTPathFilename(pEndpoint->pszUri),
    1280                                         i*10, i*10+10-1);
    1281                     if (RT_FAILURE(rc))
    1282                         break;
    1283                 }
    1284             }
    1285 
    1286             if (RT_SUCCESS(rc))
    1287             {
    1288                 rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunOver100Sec, STAMTYPE_COUNTER,
    1289                                      STAMVISIBILITY_USED,
    1290                                      STAMUNIT_OCCURENCES,
    1291                                      "Tasks which ran more than 100sec",
    1292                                      "/PDM/AsyncCompletion/File/%s/TaskRunSecGreater100Sec",
    1293                                      RTPathFilename(pEndpoint->pszUri));
    1294             }
    1295 
    1296             if (RT_SUCCESS(rc))
    1297             {
    1298                 rc = STAMR3RegisterF(pVM, &pEndpoint->StatIoOpsPerSec, STAMTYPE_COUNTER,
    1299                                      STAMVISIBILITY_ALWAYS,
    1300                                      STAMUNIT_OCCURENCES,
    1301                                      "Processed I/O operations per second",
    1302                                      "/PDM/AsyncCompletion/File/%s/IoOpsPerSec",
    1303                                      RTPathFilename(pEndpoint->pszUri));
    1304             }
    1305 
    1306             if (RT_SUCCESS(rc))
    1307             {
    1308                 rc = STAMR3RegisterF(pVM, &pEndpoint->StatIoOpsStarted, STAMTYPE_COUNTER,
    1309                                      STAMVISIBILITY_ALWAYS,
    1310                                      STAMUNIT_OCCURENCES,
    1311                                      "Started I/O operations for this endpoint",
    1312                                      "/PDM/AsyncCompletion/File/%s/IoOpsStarted",
    1313                                      RTPathFilename(pEndpoint->pszUri));
    1314             }
    1315 
    1316             if (RT_SUCCESS(rc))
    1317             {
    1318                 rc = STAMR3RegisterF(pVM, &pEndpoint->StatIoOpsCompleted, STAMTYPE_COUNTER,
    1319                                      STAMVISIBILITY_ALWAYS,
    1320                                      STAMUNIT_OCCURENCES,
    1321                                      "Completed I/O operations for this endpoint",
    1322                                      "/PDM/AsyncCompletion/File/%s/IoOpsCompleted",
    1323                                      RTPathFilename(pEndpoint->pszUri));
    1324             }
    1325 
    1326             pEndpoint->tsIntervalStartMs = RTTimeMilliTS();
    1327 #endif
    1328 
    13291223            if (   pEndpoint->pszUri
    13301224                && RT_SUCCESS(rc))
     
    13511245                    ASMAtomicIncU32(&pTemplate->cUsed);
    13521246
     1247#ifdef VBOX_WITH_STATISTICS
     1248                    /* Init the statistics part */
     1249                    for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesNs); i++)
     1250                    {
     1251                        rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesNs[i], STAMTYPE_COUNTER,
     1252                                             STAMVISIBILITY_USED,
     1253                                             STAMUNIT_OCCURENCES,
     1254                                             "Nanosecond resolution runtime statistics",
     1255                                             "/PDM/AsyncCompletion/File/%s/TaskRun1Ns-%u-%u",
     1256                                             RTPathFilename(pEndpoint->pszUri),
     1257                                             i*100, i*100+100-1);
     1258                        if (RT_FAILURE(rc))
     1259                            break;
     1260                    }
     1261
     1262                    if (RT_SUCCESS(rc))
     1263                    {
     1264                        for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesMicroSec); i++)
     1265                        {
     1266                            rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesMicroSec[i], STAMTYPE_COUNTER,
     1267                                                 STAMVISIBILITY_USED,
     1268                                                 STAMUNIT_OCCURENCES,
     1269                                                 "Microsecond resolution runtime statistics",
     1270                                                 "/PDM/AsyncCompletion/File/%s/TaskRun2MicroSec-%u-%u",
     1271                                                 RTPathFilename(pEndpoint->pszUri),
     1272                                                 i*100, i*100+100-1);
     1273                            if (RT_FAILURE(rc))
     1274                                break;
     1275                        }
     1276                    }
     1277
     1278                   if (RT_SUCCESS(rc))
     1279                   {
     1280                       for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesMs); i++)
     1281                       {
     1282                           rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesMs[i], STAMTYPE_COUNTER,
     1283                                                STAMVISIBILITY_USED,
     1284                                                STAMUNIT_OCCURENCES,
     1285                                                "Milliseconds resolution runtime statistics",
     1286                                                "/PDM/AsyncCompletion/File/%s/TaskRun3Ms-%u-%u",
     1287                                                RTPathFilename(pEndpoint->pszUri),
     1288                                                i*100, i*100+100-1);
     1289                           if (RT_FAILURE(rc))
     1290                               break;
     1291                       }
     1292                   }
     1293
     1294                   if (RT_SUCCESS(rc))
     1295                   {
     1296                       for (unsigned i = 0; i < RT_ELEMENTS(pEndpoint->StatTaskRunTimesMs); i++)
     1297                       {
     1298                            rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunTimesSec[i], STAMTYPE_COUNTER,
     1299                                                 STAMVISIBILITY_USED,
     1300                                                 STAMUNIT_OCCURENCES,
     1301                                                 "Second resolution runtime statistics",
     1302                                                 "/PDM/AsyncCompletion/File/%s/TaskRun4Sec-%u-%u",
     1303                                                 RTPathFilename(pEndpoint->pszUri),
     1304                                                 i*10, i*10+10-1);
     1305                            if (RT_FAILURE(rc))
     1306                                break;
     1307                        }
     1308                    }
     1309
     1310                    if (RT_SUCCESS(rc))
     1311                    {
     1312                        rc = STAMR3RegisterF(pVM, &pEndpoint->StatTaskRunOver100Sec, STAMTYPE_COUNTER,
     1313                                             STAMVISIBILITY_USED,
     1314                                             STAMUNIT_OCCURENCES,
     1315                                             "Tasks which ran more than 100sec",
     1316                                             "/PDM/AsyncCompletion/File/%s/TaskRunSecGreater100Sec",
     1317                                             RTPathFilename(pEndpoint->pszUri));
     1318                    }
     1319
     1320                    if (RT_SUCCESS(rc))
     1321                    {
     1322                        rc = STAMR3RegisterF(pVM, &pEndpoint->StatIoOpsPerSec, STAMTYPE_COUNTER,
     1323                                             STAMVISIBILITY_ALWAYS,
     1324                                             STAMUNIT_OCCURENCES,
     1325                                             "Processed I/O operations per second",
     1326                                             "/PDM/AsyncCompletion/File/%s/IoOpsPerSec",
     1327                                             RTPathFilename(pEndpoint->pszUri));
     1328                    }
     1329
     1330                    if (RT_SUCCESS(rc))
     1331                    {
     1332                        rc = STAMR3RegisterF(pVM, &pEndpoint->StatIoOpsStarted, STAMTYPE_COUNTER,
     1333                                             STAMVISIBILITY_ALWAYS,
     1334                                             STAMUNIT_OCCURENCES,
     1335                                             "Started I/O operations for this endpoint",
     1336                                             "/PDM/AsyncCompletion/File/%s/IoOpsStarted",
     1337                                             RTPathFilename(pEndpoint->pszUri));
     1338                    }
     1339
     1340                    if (RT_SUCCESS(rc))
     1341                    {
     1342                        rc = STAMR3RegisterF(pVM, &pEndpoint->StatIoOpsCompleted, STAMTYPE_COUNTER,
     1343                                             STAMVISIBILITY_ALWAYS,
     1344                                             STAMUNIT_OCCURENCES,
     1345                                             "Completed I/O operations for this endpoint",
     1346                                             "/PDM/AsyncCompletion/File/%s/IoOpsCompleted",
     1347                                             RTPathFilename(pEndpoint->pszUri));
     1348                    }
     1349
     1350                    pEndpoint->tsIntervalStartMs = RTTimeMilliTS();
     1351#endif
     1352
    13531353                    *ppEndpoint = pEndpoint;
    13541354
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