VirtualBox

Changeset 88347 in vbox for trunk


Ignore:
Timestamp:
Apr 1, 2021 1:17:16 PM (4 years ago)
Author:
vboxsync
Message:

Forward ported r143576 from 6.1: VMM: Re-enabled vmmR0DoHalt and added more statistics to it. ​oem2ticketref:40

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

Legend:

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

    r88346 r88347  
    601601}
    602602
    603 #if 0 /** @todo temporarily disabled, see oem2 ticket 40 */
    604603
    605604/**
     
    645644    {
    646645        Log12(("vmmR0DoHaltInterrupt: CPU%d failed #3\n", pVCpu->idCpu));
     646        STAM_REL_COUNTER_INC(&pVCpu->vmm.s.StatR0HaltToR3);
    647647        return VINF_EM_HALT;
    648648    }
     
    656656            /** @todo later. */
    657657            Log12(("vmmR0DoHaltInterrupt: CPU%d failed #2 (uMWait=%u enmInt=%d)\n", pVCpu->idCpu, uMWait, enmInterruptibility));
     658            STAM_REL_COUNTER_INC(&pVCpu->vmm.s.StatR0HaltToR3);
    658659            return VINF_EM_HALT;
    659660        }
     
    670671             *        for details. */
    671672            Log12(("vmmR0DoHaltInterrupt: CPU%d failed #1 (uMWait=%u enmInt=%d)\n", pVCpu->idCpu, uMWait, enmInterruptibility));
     673            STAM_REL_COUNTER_INC(&pVCpu->vmm.s.StatR0HaltToR3);
    672674            return VINF_EM_HALT;
    673675        }
     
    688690
    689691    Log12(("vmmR0DoHaltInterrupt: CPU%d failed #0 (uMWait=%u enmInt=%d)\n", pVCpu->idCpu, uMWait, enmInterruptibility));
     692    STAM_REL_COUNTER_INC(&pVCpu->vmm.s.StatR0HaltToR3);
    690693    return VINF_EM_HALT;
    691694}
     
    814817                            {
    815818                                STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3FromSpin);
     819                                STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3);
    816820                                return VINF_EM_HALT;
    817821                            }
     
    820824                            {
    821825                                STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3FromSpin);
     826                                STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3);
    822827                                return VINF_EM_HALT;
    823828                            }
     
    885890                                        return vmmR0DoHaltInterrupt(pGVCpu, uMWait, enmInterruptibility);
    886891                                    }
     892                                    STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3PostNoInt);
    887893                                    Log12(("vmmR0DoHalt: CPU%d post #2 - No pending interrupt\n", pGVCpu->idCpu));
    888894                                }
    889895                                else
     896                                {
     897                                    STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3PostPendingFF);
    890898                                    Log12(("vmmR0DoHalt: CPU%d post #1 - Pending FF\n", pGVCpu->idCpu));
     899                                }
    891900                            }
    892901                            else
     902                            {
     903                                STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3Other);
    893904                                Log12(("vmmR0DoHalt: CPU%d GVMMR0SchedHalt failed: %Rrc\n", pGVCpu->idCpu, rc));
     905                            }
    894906                        }
    895907                        else
    896908                        {
    897909                            VMCPU_CMPXCHG_STATE(pGVCpu, VMCPUSTATE_STARTED, VMCPUSTATE_STARTED_HALTED);
    898                             Log12(("vmmR0DoHalt: CPU%d failed #4 - Pending FF\n", pGVCpu->idCpu));
     910                            STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3PendingFF);
     911                            Log12(("vmmR0DoHalt: CPU%d failed #5 - Pending FF\n", pGVCpu->idCpu));
    899912                        }
    900913                    }
    901914                    else
    902                         Log12(("vmmR0DoHalt: CPU%d failed #3 - enmState=%d\n", pGVCpu->idCpu, VMCPU_GET_STATE(pGVCpu)));
     915                    {
     916                        STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3Other);
     917                        Log12(("vmmR0DoHalt: CPU%d failed #4 - enmState=%d\n", pGVCpu->idCpu, VMCPU_GET_STATE(pGVCpu)));
     918                    }
    903919                }
    904920                else
    905                     Log12(("vmmR0DoHalt: CPU%d failed #2 - Pending FF\n", pGVCpu->idCpu));
     921                {
     922                    STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3SmallDelta);
     923                    Log12(("vmmR0DoHalt: CPU%d failed #3 - delta too small: %RU64\n", pGVCpu->idCpu, u64Delta));
     924                }
    906925            }
     926            else
     927            {
     928                STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3PendingFF);
     929                Log12(("vmmR0DoHalt: CPU%d failed #2 - Pending FF\n", pGVCpu->idCpu));
     930            }
    907931        }
    908932        else
     933        {
     934            STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3PendingFF);
    909935            Log12(("vmmR0DoHalt: CPU%d failed #1 - Pending FF\n", pGVCpu->idCpu));
     936        }
    910937    }
    911938    else
     939    {
     940        STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3Other);
    912941        Log12(("vmmR0DoHalt: CPU%d failed #0 - fMayHaltInRing0=%d TRPMHasTrap=%d enmInt=%d uMWait=%u\n",
    913942               pGVCpu->idCpu, pGVCpu->vmm.s.fMayHaltInRing0, TRPMHasTrap(pGVCpu), enmInterruptibility, uMWait));
    914 
     943    }
     944
     945    STAM_REL_COUNTER_INC(&pGVCpu->vmm.s.StatR0HaltToR3);
    915946    return VINF_EM_HALT;
    916947}
    917948
    918 #endif
    919949
    920950/**
     
    15161546                    vmmR0RecordRC(pGVM, pGVCpu, rc);
    15171547#endif
    1518 #if 0 /** @todo temporarily disabled, see oem2 ticket 40 */
    15191548                    /*
    15201549                     * If this is a halt.
     
    15321561                        pGVCpu->vmm.s.cR0HaltsToRing3++;
    15331562                    }
    1534 #endif
    15351563                }
    15361564                /*
  • trunk/src/VBox/VMM/VMMR3/VMM.cpp

    r88346 r88347  
    540540        STAMR3RegisterF(pVM, &pVCpu->vmm.s.StatR0HaltExecFromSpin,   STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,  "", "/PROF/CPU%u/VM/Halt/R0HaltExec/FromSpin", i);
    541541        STAMR3RegisterF(pVM, &pVCpu->vmm.s.StatR0HaltExecFromBlock,  STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,  "", "/PROF/CPU%u/VM/Halt/R0HaltExec/FromBlock", i);
    542         STAMR3RegisterF(pVM, &pVCpu->vmm.s.StatR0HaltToR3FromSpin,   STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,  "", "/PROF/CPU%u/VM/Halt/R0HaltToR3FromSpin", i);
     542        STAMR3RegisterF(pVM, &pVCpu->vmm.s.StatR0HaltToR3,           STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,  "", "/PROF/CPU%u/VM/Halt/R0HaltToR3", i);
     543        STAMR3RegisterF(pVM, &pVCpu->vmm.s.StatR0HaltToR3FromSpin,   STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,  "", "/PROF/CPU%u/VM/Halt/R0HaltToR3/FromSpin", i);
     544        STAMR3RegisterF(pVM, &pVCpu->vmm.s.StatR0HaltToR3Other,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,  "", "/PROF/CPU%u/VM/Halt/R0HaltToR3/Other", i);
     545        STAMR3RegisterF(pVM, &pVCpu->vmm.s.StatR0HaltToR3PendingFF,  STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,  "", "/PROF/CPU%u/VM/Halt/R0HaltToR3/PendingFF", i);
     546        STAMR3RegisterF(pVM, &pVCpu->vmm.s.StatR0HaltToR3SmallDelta, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,  "", "/PROF/CPU%u/VM/Halt/R0HaltToR3/SmallDelta", i);
     547        STAMR3RegisterF(pVM, &pVCpu->vmm.s.StatR0HaltToR3PostNoInt,  STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,  "", "/PROF/CPU%u/VM/Halt/R0HaltToR3/PostWaitNoInt", i);
     548        STAMR3RegisterF(pVM, &pVCpu->vmm.s.StatR0HaltToR3PostPendingFF,STAMTYPE_COUNTER,STAMVISIBILITY_ALWAYS,STAMUNIT_OCCURENCES,  "", "/PROF/CPU%u/VM/Halt/R0HaltToR3/PostWaitPendingFF", i);
    543549        STAMR3RegisterF(pVM, &pVCpu->vmm.s.cR0Halts,                 STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,  "", "/PROF/CPU%u/VM/Halt/R0HaltHistoryCounter", i);
    544550        STAMR3RegisterF(pVM, &pVCpu->vmm.s.cR0HaltsSucceeded,        STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,  "", "/PROF/CPU%u/VM/Halt/R0HaltHistorySucceeded", i);
  • trunk/src/VBox/VMM/include/VMMInternal.h

    r87819 r88347  
    436436    STAMCOUNTER                 StatR0HaltExecFromBlock;
    437437    STAMCOUNTER                 StatR0HaltExecFromSpin;
     438    STAMCOUNTER                 StatR0HaltToR3;
    438439    STAMCOUNTER                 StatR0HaltToR3FromSpin;
     440    STAMCOUNTER                 StatR0HaltToR3Other;
     441    STAMCOUNTER                 StatR0HaltToR3PendingFF;
     442    STAMCOUNTER                 StatR0HaltToR3SmallDelta;
     443    STAMCOUNTER                 StatR0HaltToR3PostNoInt;
     444    STAMCOUNTER                 StatR0HaltToR3PostPendingFF;
    439445} VMMCPU;
    440446AssertCompileMemberAlignment(VMMCPU, TracerCtx, 8);
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