VirtualBox

Changeset 60516 in vbox for trunk


Ignore:
Timestamp:
Apr 15, 2016 10:33:13 AM (9 years ago)
Author:
vboxsync
Message:

VMM/APIC: Add some profile statistics.

Location:
trunk/src/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp

    r60464 r60516  
    792792    GEN_CHECK_OFF(APICCPU, StatMsrWriteR3);
    793793    GEN_CHECK_OFF(APICCPU, StatMsrWriteRC);
     794    GEN_CHECK_OFF(APICCPU, StatUpdatePendingIntrs);
     795    GEN_CHECK_OFF(APICCPU, StatPostInterrupt);
    794796#else
    795797    /* PC/DevAPIC.cpp */
  • trunk/src/VBox/VMM/VMMAll/APICAll.cpp

    r60479 r60516  
    10811081static void apicUpdatePpr(PVMCPU pVCpu)
    10821082{
    1083     VMCPU_ASSERT_EMT_OR_NOT_RUNNING(pVCpu);
     1083    VMCPU_ASSERT_EMT(pVCpu);
    10841084
    10851085    /* See Intel spec 10.8.3.1 "Task and Processor Priorities". */
     
    11031103static uint8_t apicGetPpr(PVMCPU pVCpu)
    11041104{
    1105     VMCPU_ASSERT_EMT_OR_NOT_RUNNING(pVCpu);
     1105    VMCPU_ASSERT_EMT(pVCpu);
    11061106
    11071107    /*
     
    23942394{
    23952395    Assert(pVCpu);
     2396    Assert(uVector > XAPIC_ILLEGAL_VECTOR_END);
    23962397
    23972398    PCAPIC   pApic    = VM_TO_APIC(pVCpu->CTX_SUFF(pVM));
    23982399    PAPICCPU pApicCpu = VMCPU_TO_APICCPU(pVCpu);
     2400
     2401    STAM_PROFILE_START(&pApicCpu->StatPostInterrupt, a);
     2402
    23992403    /* Validate the vector. See Intel spec. 10.5.2 "Valid Interrupt Vectors". */
    24002404    if (RT_LIKELY(uVector > XAPIC_ILLEGAL_VECTOR_END))
     
    24062410            apicSetVectorInPib(CTX_SUFF(pApicCpu->pvApicPib), uVector);
    24072411            bool const fAlreadySet = apicSetNotificationBitInPib(CTX_SUFF(pApicCpu->pvApicPib));
    2408             if (fAlreadySet)
    2409                 return;
    2410 
    2411             if (pApic->fPostedIntrsEnabled)
    2412             { /** @todo posted-interrupt call to hardware */ }
    2413             else
    2414                 APICSetInterruptFF(pVCpu, PDMAPICIRQ_HARDWARE);
     2412            if (!fAlreadySet)
     2413            {
     2414                if (pApic->fPostedIntrsEnabled)
     2415                { /** @todo posted-interrupt call to hardware */ }
     2416                else
     2417                    APICSetInterruptFF(pVCpu, PDMAPICIRQ_HARDWARE);
     2418            }
    24152419        }
    24162420        else
     
    24222426            apicSetVectorInPib(&pApicCpu->ApicPibLevel.aVectorBitmap[0], uVector);
    24232427            bool const fAlreadySet = apicSetNotificationBitInPib(&pApicCpu->ApicPibLevel.aVectorBitmap[0]);
    2424             if (fAlreadySet)
    2425                 return;
    2426 
    2427             APICSetInterruptFF(pVCpu, PDMAPICIRQ_HARDWARE);
     2428            if (!fAlreadySet)
     2429                APICSetInterruptFF(pVCpu, PDMAPICIRQ_HARDWARE);
    24282430        }
    24292431    }
    24302432    else
    24312433        apicSetError(pVCpu, XAPIC_ESR_RECV_ILLEGAL_VECTOR);
     2434
     2435    STAM_PROFILE_STOP(&pApicCpu->StatPostInterrupt, a);
    24322436}
    24332437
     
    25372541    PAPIC pApic = VM_TO_APIC(CTX_SUFF(pVCpu->pVM));
    25382542    Assert(!pApic->fVirtApicRegsEnabled);
     2543    NOREF(pApic);
    25392544
    25402545    PXAPICPAGE pXApicPage = VMCPU_TO_XAPICPAGE(pVCpu);
     
    25672572    PAPIC pApic = VM_TO_APIC(CTX_SUFF(pVCpu->pVM));
    25682573    Assert(!pApic->fVirtApicRegsEnabled);
     2574    NOREF(pApic);
    25692575
    25702576    PXAPICPAGE pXApicPage = VMCPU_TO_XAPICPAGE(pVCpu);
     
    25912597    PXAPICPAGE pXApicPage = VMCPU_TO_XAPICPAGE(pVCpu);
    25922598
     2599    STAM_PROFILE_START(&pApicCpu->StatUpdatePendingIntrs, a);
     2600
    25932601    /* Update edge-triggered pending interrupts. */
    25942602    for (;;)
     
    26282636        }
    26292637    }
     2638
     2639    STAM_PROFILE_STOP(&pApicCpu->StatUpdatePendingIntrs, a);
    26302640}
    26312641
  • trunk/src/VBox/VMM/VMMR3/APIC.cpp

    r60475 r60516  
    411411    pHlp->pfnPrintf(pHlp, "    Recv Illegal Vector         = %RTbool\n",  pXApicPage->esr.u.fRcvdIllegalVector);
    412412    pHlp->pfnPrintf(pHlp, "    Illegal Register Address    = %RTbool\n",  pXApicPage->esr.u.fIllegalRegAddr);
    413     pHlp->pfnPrintf(pHlp, "  ICR Low                       = %#x\n",      pXApicPage->icr_lo.all);
     413    pHlp->pfnPrintf(pHlp, "  ICR Low                       = %#x\n",      pXApicPage->icr_lo.all.u32IcrLo);
    414414    pHlp->pfnPrintf(pHlp, "    Vector                      = %u (%#x)\n", pXApicPage->icr_lo.u.u8Vector,
    415415                                                                          pXApicPage->icr_lo.u.u8Vector);
     
    12951295    } while(0)
    12961296
     1297#define APIC_PROF_COUNTER(a_Reg, a_Desc, a_Key) \
     1298    do { \
     1299        rc = STAMR3RegisterF(pVM, a_Reg, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, a_Desc, a_Key, \
     1300                             idCpu); \
     1301        AssertRCReturn(rc, rc); \
     1302    } while(0)
     1303
    12971304    bool const fHasRC = !HMIsEnabled(pVM);
    12981305    for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
     
    13181325            APIC_REG_COUNTER(&pApicCpu->StatMsrWriteRC,  "Number of APIC MSR writes in RC.",  "/Devices/APIC/%u/RC/MsrWrite");
    13191326        }
     1327
     1328        APIC_PROF_COUNTER(&pApicCpu->StatUpdatePendingIntrs, "Profiling of APICUpdatePendingInterrupts",
     1329                          "/PROF/CPU%d/APIC/UpdatePendingInterrupts");
     1330        APIC_PROF_COUNTER(&pApicCpu->StatPostInterrupt, "Profiling of APICPostInterrupt", "/PROF/CPU%d/APIC/PostInterrupt");
    13201331    }
    13211332# undef APIC_REG_ACCESS_COUNTER
  • trunk/src/VBox/VMM/include/APICInternal.h

    r60475 r60516  
    587587    /** Number of MSR writes in RC. */
    588588    STAMCOUNTER                 StatMsrWriteRC;
     589
     590    /** Profiling of APICUpdatePendingInterrupts().  */
     591    STAMPROFILE                 StatUpdatePendingIntrs;
     592    /** Profiling of APICPostInterrupt().  */
     593    STAMPROFILE                 StatPostInterrupt;
    589594    /** @} */
    590595#endif
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