VirtualBox

Changeset 706 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 6, 2007 2:05:06 PM (18 years ago)
Author:
vboxsync
Message:

IOM handler profiling.

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

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

    r23 r706  
    351351            AssertRC(rc);
    352352
     353            /* Profiling */
     354            RTStrPrintf(szName, sizeof(szName), "/IOM/Ports/%04x-In-R3/Prof", Port);
     355            rc = STAMR3Register(pVM, &pPort->InR3, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszDesc);
     356            AssertRC(rc);
     357
     358            RTStrPrintf(szName, sizeof(szName), "/IOM/Ports/%04x-Out-R3/Prof", Port);
     359            rc = STAMR3Register(pVM, &pPort->OutR3, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszDesc);
     360            AssertRC(rc);
     361
     362            RTStrPrintf(szName, sizeof(szName), "/IOM/Ports/%04x-In-GC/Prof", Port);
     363            rc = STAMR3Register(pVM, &pPort->InGC, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszDesc);
     364            AssertRC(rc);
     365
     366            RTStrPrintf(szName, sizeof(szName), "/IOM/Ports/%04x-Out-GC/Prof", Port);
     367            rc = STAMR3Register(pVM, &pPort->OutGC, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszDesc);
     368            AssertRC(rc);
     369
     370            RTStrPrintf(szName, sizeof(szName), "/IOM/Ports/%04x-In-R0/Prof", Port);
     371            rc = STAMR3Register(pVM, &pPort->InR0, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszDesc);
     372            AssertRC(rc);
     373
     374            RTStrPrintf(szName, sizeof(szName), "/IOM/Ports/%04x-Out-R0/Prof", Port);
     375            rc = STAMR3Register(pVM, &pPort->OutR0, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszDesc);
     376            AssertRC(rc);
     377
    353378            return pPort;
    354379        }
     
    425450            RTStrPrintf(szName, sizeof(szName), "/IOM/MMIO/%RGp-Write-R0-2-R3", GCPhys);
    426451            rc = STAMR3Register(pVM, &pStats->WriteR0ToR3, STAMTYPE_COUNTER, STAMVISIBILITY_USED, szName, STAMUNIT_OCCURENCES, pszDesc);
     452            AssertRC(rc);
     453
     454            /* Profiling */
     455            RTStrPrintf(szName, sizeof(szName), "/IOM/MMIO/%RGp-Read-R3/Prof", GCPhys);
     456            rc = STAMR3Register(pVM, &pStats->ReadR3, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszDesc);
     457            AssertRC(rc);
     458
     459            RTStrPrintf(szName, sizeof(szName), "/IOM/MMIO/%RGp-Write-R3/Prof", GCPhys);
     460            rc = STAMR3Register(pVM, &pStats->WriteR3, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszDesc);
     461            AssertRC(rc);
     462
     463            RTStrPrintf(szName, sizeof(szName), "/IOM/MMIO/%RGp-Read-GC/Prof", GCPhys);
     464            rc = STAMR3Register(pVM, &pStats->ReadGC, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszDesc);
     465            AssertRC(rc);
     466
     467            RTStrPrintf(szName, sizeof(szName), "/IOM/MMIO/%RGp-Write-GC/Prof", GCPhys);
     468            rc = STAMR3Register(pVM, &pStats->WriteGC, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszDesc);
     469            AssertRC(rc);
     470
     471            RTStrPrintf(szName, sizeof(szName), "/IOM/MMIO/%RGp-Read-R0/Prof", GCPhys);
     472            rc = STAMR3Register(pVM, &pStats->ReadR0, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszDesc);
     473            AssertRC(rc);
     474
     475            RTStrPrintf(szName, sizeof(szName), "/IOM/MMIO/%RGp-Write-R0/Prof", GCPhys);
     476            rc = STAMR3Register(pVM, &pStats->WriteR0, STAMTYPE_PROFILE, STAMVISIBILITY_USED, szName, STAMUNIT_TICKS_PER_CALL, pszDesc);
    427477            AssertRC(rc);
    428478
  • trunk/src/VBox/VMM/IOMInternal.h

    r23 r706  
    122122    /** Number of writes to this address from GC. */
    123123    STAMCOUNTER                 WriteGC;
     124    /** Profiling read handler overhead in R3. */
     125    STAMPROFILEADV              ProfReadR3;
     126    /** Profiling write handler overhead in R3. */
     127    STAMPROFILEADV              ProfWriteR3;
     128    /** Profiling read handler overhead in R0. */
     129    STAMPROFILEADV              ProfReadR0;
     130    /** Profiling write handler overhead in R0. */
     131    STAMPROFILEADV              ProfWriteR0;
     132    /** Profiling read handler overhead in GC. */
     133    STAMPROFILEADV              ProfReadGC;
     134    /** Profiling write handler overhead in GC. */
     135    STAMPROFILEADV              ProfWriteGC;
    124136    /** Number of reads to this address from R0 which was serviced in R3. */
    125137    STAMCOUNTER                 ReadR0ToR3;
     
    221233    /** Number of OUTs to this port from GC. */
    222234    STAMCOUNTER                 OutGC;
     235    /** Profiling IN handler overhead in R3. */
     236    STAMPROFILEADV              ProfInR3;
     237    /** Profiling OUT handler overhead in R3. */
     238    STAMPROFILEADV              ProfOutR3;
     239    /** Profiling IN handler overhead in R0. */
     240    STAMPROFILEADV              ProfInR0;
     241    /** Profiling OUT handler overhead in R0. */
     242    STAMPROFILEADV              ProfOutR0;
     243    /** Profiling IN handler overhead in GC. */
     244    STAMPROFILEADV              ProfInGC;
     245    /** Profiling OUT handler overhead in GC. */
     246    STAMPROFILEADV              ProfOutGC;
    223247    /** Number of INs to this port from R0 which was serviced in R3. */
    224248    STAMCOUNTER                 InR0ToR3;
  • trunk/src/VBox/VMM/VMMAll/IOMAll.cpp

    r23 r706  
    567567#endif
    568568        /* call the device. */
     569#ifdef VBOX_WITH_STATISTICS
     570        if (pStats)
     571            STAM_PROFILE_ADV_START(&pStats->CTXALLSUFF(ProfIn), a);
     572#endif
    569573        int rc = pRange->pfnInCallback(pRange->pDevIns, pRange->pvUser, Port, pu32Value, cbValue);
    570574#ifdef VBOX_WITH_STATISTICS
     575        if (pStats)
     576            STAM_PROFILE_ADV_STOP(&pStats->CTXALLSUFF(ProfIn), a);
    571577        if (rc == VINF_SUCCESS && pStats)
    572578            STAM_COUNTER_INC(&pStats->CTXALLSUFF(In));
     
    701707#endif
    702708        /* call the device. */
     709#ifdef VBOX_WITH_STATISTICS
     710        if (pStats)
     711            STAM_PROFILE_ADV_START(&pStats->CTXALLSUFF(ProfIn), a);
     712#endif
     713
    703714        int rc = pRange->pfnInStrCallback(pRange->pDevIns, pRange->pvUser, Port, pGCPtrDst, pcTransfers, cb);
    704715#ifdef VBOX_WITH_STATISTICS
     716        if (pStats)
     717            STAM_PROFILE_ADV_STOP(&pStats->CTXALLSUFF(ProfIn), a);
    705718        if (rc == VINF_SUCCESS && pStats)
    706719            STAM_COUNTER_INC(&pStats->CTXALLSUFF(In));
     
    812825#endif
    813826        /* call the device. */
     827#ifdef VBOX_WITH_STATISTICS
     828        if (pStats)
     829            STAM_PROFILE_ADV_START(&pStats->CTXALLSUFF(ProfOut), a);
     830#endif
    814831        int rc = pRange->pfnOutCallback(pRange->pDevIns, pRange->pvUser, Port, u32Value, cbValue);
    815832
    816833#ifdef VBOX_WITH_STATISTICS
     834        if (pStats)
     835            STAM_PROFILE_ADV_STOP(&pStats->CTXALLSUFF(ProfOut), a);
    817836        if (rc == VINF_SUCCESS && pStats)
    818837            STAM_COUNTER_INC(&pStats->CTXALLSUFF(Out));
     
    923942#endif
    924943        /* call the device. */
     944#ifdef VBOX_WITH_STATISTICS
     945        if (pStats)
     946            STAM_PROFILE_ADV_START(&pStats->CTXALLSUFF(ProfOut), a);
     947#endif
    925948        int rc = pRange->pfnOutStrCallback(pRange->pDevIns, pRange->pvUser, Port, pGCPtrSrc, pcTransfers, cb);
    926949#ifdef VBOX_WITH_STATISTICS
     950        if (pStats)
     951            STAM_PROFILE_ADV_STOP(&pStats->CTXALLSUFF(ProfOut), a);
    927952        if (rc == VINF_SUCCESS && pStats)
    928953            STAM_COUNTER_INC(&pStats->CTXALLSUFF(Out));
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