VirtualBox

Changeset 40375 in vbox for trunk


Ignore:
Timestamp:
Mar 6, 2012 1:37:23 PM (13 years ago)
Author:
vboxsync
Message:

VMM: flow tracing.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r40371 r40375  
    4444#include <VBox/vmm/iom.h>
    4545#include <VBox/vmm/dbgf.h>
    46 #include <VBox/vmm/dbgftrace.h>
    4746#include <VBox/vmm/pgm.h>
    4847#ifdef VBOX_WITH_REM
     
    6968#include <VBox/disopcode.h>
    7069#include <VBox/vmm/dbgf.h>
     70#include "VMMTracing.h"
    7171
    7272#include <iprt/asm.h>
     
    11031103            STAM_REL_PROFILE_ADV_SUSPEND(&pVCpu->em.s.StatREMTotal, a);
    11041104            rc = emR3ForcedActions(pVM, pVCpu, rc);
     1105            VBOXVMMR3_EM_FF_ALL_RET(pVCpu, rc);
    11051106            STAM_REL_PROFILE_ADV_RESUME(&pVCpu->em.s.StatREMTotal, a);
    11061107            if (    rc != VINF_SUCCESS
     
    13301331int emR3HighPriorityPostForcedActions(PVM pVM, PVMCPU pVCpu, int rc)
    13311332{
     1333    VBOXVMMR3_EM_FF_HIGH(pVCpu, pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions, rc);
     1334
    13321335    if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PDM_CRITSECT))
    13331336        PDMCritSectFF(pVCpu);
     
    13811384                rc = rc2; \
    13821385        } while (0)
     1386    VBOXVMMR3_EM_FF_ALL(pVCpu, pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions, rc);
    13831387
    13841388    /*
     
    18851889            {
    18861890                rc = emR3ForcedActions(pVM, pVCpu, rc);
     1891                VBOXVMMR3_EM_FF_ALL_RET(pVCpu, rc);
    18871892                if (   (   rc == VINF_EM_RESCHEDULE_REM
    18881893                        || rc == VINF_EM_RESCHEDULE_HWACC)
     
    19101915                 */
    19111916                case VINF_EM_RESCHEDULE_RAW:
    1912                     Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_RAW: %d -> %d (EMSTATE_RAW)\n", pVCpu->em.s.enmState, EMSTATE_RAW));
     1917                    Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_RAW: %d -> %d (EMSTATE_RAW)\n", enmOldState, EMSTATE_RAW));
    19131918                    pVCpu->em.s.enmState = EMSTATE_RAW;
    19141919                    break;
     
    19181923                 */
    19191924                case VINF_EM_RESCHEDULE_HWACC:
    1920                     Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_HWACC: %d -> %d (EMSTATE_HWACC)\n", pVCpu->em.s.enmState, EMSTATE_HWACC));
     1925                    Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_HWACC: %d -> %d (EMSTATE_HWACC)\n", enmOldState, EMSTATE_HWACC));
    19211926                    Assert(!pVCpu->em.s.fForceRAW);
    19221927                    pVCpu->em.s.enmState = EMSTATE_HWACC;
     
    19271932                 */
    19281933                case VINF_EM_RESCHEDULE_REM:
    1929                     Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_REM: %d -> %d (EMSTATE_REM)\n", pVCpu->em.s.enmState, EMSTATE_REM));
     1934                    Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_REM: %d -> %d (EMSTATE_REM)\n", enmOldState, EMSTATE_REM));
    19301935                    pVCpu->em.s.enmState = EMSTATE_REM;
    19311936                    break;
     
    19351940                 */
    19361941                case VINF_EM_RESUME:
    1937                     Log2(("EMR3ExecuteVM: VINF_EM_RESUME: %d -> VINF_EM_RESCHEDULE\n", pVCpu->em.s.enmState));
     1942                    Log2(("EMR3ExecuteVM: VINF_EM_RESUME: %d -> VINF_EM_RESCHEDULE\n", enmOldState));
    19381943                    /* Don't reschedule in the halted or wait for SIPI case. */
    19391944                    if (    pVCpu->em.s.enmPrevState == EMSTATE_WAIT_SIPI
     
    19511956                {
    19521957                    EMSTATE enmState = emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx);
    1953                     Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE: %d -> %d (%s)\n", pVCpu->em.s.enmState, enmState, emR3GetStateName(enmState)));
     1958                    Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE: %d -> %d (%s)\n", enmOldState, enmState, emR3GetStateName(enmState)));
    19541959                    pVCpu->em.s.enmState = enmState;
    19551960                    break;
     
    19601965                 */
    19611966                case VINF_EM_HALT:
    1962                     Log2(("EMR3ExecuteVM: VINF_EM_HALT: %d -> %d\n", pVCpu->em.s.enmState, EMSTATE_HALTED));
     1967                    Log2(("EMR3ExecuteVM: VINF_EM_HALT: %d -> %d\n", enmOldState, EMSTATE_HALTED));
    19631968                    pVCpu->em.s.enmState = EMSTATE_HALTED;
    19641969                    break;
     
    19691974                case VINF_EM_WAIT_SIPI:
    19701975                    Assert(pVCpu->idCpu != 0);
    1971                     Log2(("EMR3ExecuteVM: VINF_EM_WAIT_SIPI: %d -> %d\n", pVCpu->em.s.enmState, EMSTATE_WAIT_SIPI));
     1976                    Log2(("EMR3ExecuteVM: VINF_EM_WAIT_SIPI: %d -> %d\n", enmOldState, EMSTATE_WAIT_SIPI));
    19721977                    pVCpu->em.s.enmState = EMSTATE_WAIT_SIPI;
    19731978                    break;
     
    19781983                 */
    19791984                case VINF_EM_SUSPEND:
    1980                     Log2(("EMR3ExecuteVM: VINF_EM_SUSPEND: %d -> %d\n", pVCpu->em.s.enmState, EMSTATE_SUSPENDED));
    1981                     Assert(pVCpu->em.s.enmState != EMSTATE_SUSPENDED);
    1982                     pVCpu->em.s.enmPrevState = pVCpu->em.s.enmState;
     1985                    Log2(("EMR3ExecuteVM: VINF_EM_SUSPEND: %d -> %d\n", enmOldState, EMSTATE_SUSPENDED));
     1986                    Assert(enmOldState != EMSTATE_SUSPENDED);
     1987                    pVCpu->em.s.enmPrevState = enmOldState;
    19831988                    pVCpu->em.s.enmState     = EMSTATE_SUSPENDED;
    19841989                    break;
     
    19931998                    {
    19941999                        EMSTATE enmState = emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx);
    1995                         Log2(("EMR3ExecuteVM: VINF_EM_RESET: %d -> %d (%s)\n", pVCpu->em.s.enmState, enmState, emR3GetStateName(enmState)));
     2000                        Log2(("EMR3ExecuteVM: VINF_EM_RESET: %d -> %d (%s)\n", enmOldState, enmState, emR3GetStateName(enmState)));
    19962001                        pVCpu->em.s.enmState = enmState;
    19972002                    }
     
    20092014                case VINF_EM_OFF:
    20102015                    pVCpu->em.s.enmState = EMSTATE_TERMINATING;
    2011                     Log2(("EMR3ExecuteVM: returns VINF_EM_OFF (%d -> %d)\n", pVCpu->em.s.enmState, EMSTATE_TERMINATING));
     2016                    Log2(("EMR3ExecuteVM: returns VINF_EM_OFF (%d -> %d)\n", enmOldState, EMSTATE_TERMINATING));
    20122017                    TMR3NotifySuspend(pVM, pVCpu);
    20132018                    STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatTotal, x);
     
    20192024                case VINF_EM_TERMINATE:
    20202025                    pVCpu->em.s.enmState = EMSTATE_TERMINATING;
    2021                     Log(("EMR3ExecuteVM returns VINF_EM_TERMINATE (%d -> %d)\n", pVCpu->em.s.enmState, EMSTATE_TERMINATING));
     2026                    Log(("EMR3ExecuteVM returns VINF_EM_TERMINATE (%d -> %d)\n", enmOldState, EMSTATE_TERMINATING));
    20222027                    if (pVM->enmVMState < VMSTATE_DESTROYING) /* ugly */
    20232028                        TMR3NotifySuspend(pVM, pVCpu);
     
    20302035                 */
    20312036                case VINF_EM_NO_MEMORY:
    2032                     Log2(("EMR3ExecuteVM: VINF_EM_NO_MEMORY: %d -> %d\n", pVCpu->em.s.enmState, EMSTATE_SUSPENDED));
    2033                     Assert(pVCpu->em.s.enmState != EMSTATE_SUSPENDED);
    2034                     pVCpu->em.s.enmPrevState = pVCpu->em.s.enmState;
     2037                    Log2(("EMR3ExecuteVM: VINF_EM_NO_MEMORY: %d -> %d\n", enmOldState, EMSTATE_SUSPENDED));
     2038                    Assert(enmOldState != EMSTATE_SUSPENDED);
     2039                    pVCpu->em.s.enmPrevState = enmOldState;
    20352040                    pVCpu->em.s.enmState = EMSTATE_SUSPENDED;
    20362041                    TMR3NotifySuspend(pVM, pVCpu);
     
    20582063                case VINF_EM_DBG_BREAKPOINT:
    20592064                case VINF_EM_DBG_STEP:
    2060                     if (pVCpu->em.s.enmState == EMSTATE_RAW)
     2065                    if (enmOldState == EMSTATE_RAW)
    20612066                    {
    2062                         Log2(("EMR3ExecuteVM: %Rrc: %d -> %d\n", rc, pVCpu->em.s.enmState, EMSTATE_DEBUG_GUEST_RAW));
     2067                        Log2(("EMR3ExecuteVM: %Rrc: %d -> %d\n", rc, enmOldState, EMSTATE_DEBUG_GUEST_RAW));
    20632068                        pVCpu->em.s.enmState = EMSTATE_DEBUG_GUEST_RAW;
    20642069                    }
    20652070                    else
    20662071                    {
    2067                         Log2(("EMR3ExecuteVM: %Rrc: %d -> %d\n", rc, pVCpu->em.s.enmState, EMSTATE_DEBUG_GUEST_REM));
     2072                        Log2(("EMR3ExecuteVM: %Rrc: %d -> %d\n", rc, enmOldState, EMSTATE_DEBUG_GUEST_REM));
    20682073                        pVCpu->em.s.enmState = EMSTATE_DEBUG_GUEST_REM;
    20692074                    }
     
    20762081                case VINF_EM_DBG_HYPER_BREAKPOINT:
    20772082                case VINF_EM_DBG_HYPER_ASSERTION:
    2078                     Log2(("EMR3ExecuteVM: %Rrc: %d -> %d\n", rc, pVCpu->em.s.enmState, EMSTATE_DEBUG_HYPER));
     2083                    Log2(("EMR3ExecuteVM: %Rrc: %d -> %d\n", rc, enmOldState, EMSTATE_DEBUG_HYPER));
    20792084                    pVCpu->em.s.enmState = EMSTATE_DEBUG_HYPER;
    20802085                    break;
     
    20842089                 */
    20852090                case VERR_VMM_RING0_ASSERTION:
    2086                     Log(("EMR3ExecuteVM: %Rrc: %d -> %d (EMSTATE_GURU_MEDITATION)\n", rc, pVCpu->em.s.enmState, EMSTATE_GURU_MEDITATION));
     2091                    Log(("EMR3ExecuteVM: %Rrc: %d -> %d (EMSTATE_GURU_MEDITATION)\n", rc, enmOldState, EMSTATE_GURU_MEDITATION));
    20872092                    pVCpu->em.s.enmState = EMSTATE_GURU_MEDITATION;
    20882093                    break;
     
    21012106                        rc = VERR_EM_INTERNAL_ERROR;
    21022107                    }
    2103                     Log(("EMR3ExecuteVM: %Rrc: %d -> %d (EMSTATE_GURU_MEDITATION)\n", rc, pVCpu->em.s.enmState, EMSTATE_GURU_MEDITATION));
     2108                    Log(("EMR3ExecuteVM: %Rrc: %d -> %d (EMSTATE_GURU_MEDITATION)\n", rc, enmOldState, EMSTATE_GURU_MEDITATION));
    21042109                    pVCpu->em.s.enmState = EMSTATE_GURU_MEDITATION;
    21052110                    break;
     
    21122117            if (enmOldState != enmNewState)
    21132118            {
    2114 #ifdef DBGFTRACE_ENABLED
    2115                 RTTraceBufAddMsgF(pVM->CTX_SUFF(hTraceBuf), "em-outer %d: %d -> %d", rc, enmOldState, enmNewState);
    2116 #endif
     2119                VBOXVMMR3_EM_STATE_CHANGED(pVCpu, enmOldState, enmNewState, rc);
     2120
    21172121                /* Clear MWait flags. */
    21182122                if (   enmOldState == EMSTATE_HALTED
     
    21292133                }
    21302134            }
    2131 #ifdef DBGFTRACE_ENABLED
    21322135            else
    2133                 RTTraceBufAddMsgF(pVM->CTX_SUFF(hTraceBuf), "em-outer %d: %d", rc, enmOldState);
    2134 #endif
     2136                VBOXVMMR3_EM_STATE_UNCHANGED(pVCpu, enmNewState, rc);
    21352137
    21362138            STAM_PROFILE_ADV_STOP(&pVCpu->em.s.StatTotal, x); /* (skip this in release) */
     
    21382140
    21392141            /*
    2140              * Act on the state.
     2142             * Act on the new state.
    21412143             */
    2142             switch (pVCpu->em.s.enmState)
     2144            switch (enmNewState)
    21432145            {
    21442146                /*
  • trunk/src/VBox/VMM/VMMR3/EMHwaccm.cpp

    r40274 r40375  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4646#include <VBox/disopcode.h>
    4747#include <VBox/vmm/dbgf.h>
     48#include "VMMTracing.h"
    4849
    4950#include <iprt/asm.h>
     
    584585        {
    585586            rc = emR3ForcedActions(pVM, pVCpu, rc);
     587            VBOXVMMR3_EM_FF_ALL_RET(pVCpu, rc);
    586588            if (    rc != VINF_SUCCESS
    587589                &&  rc != VINF_EM_RESCHEDULE_HWACC)
  • trunk/src/VBox/VMM/VMMR3/EMRaw.cpp

    r40371 r40375  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3030#include <VBox/vmm/iom.h>
    3131#include <VBox/vmm/dbgf.h>
    32 #include <VBox/vmm/dbgftrace.h>
    3332#include <VBox/vmm/pgm.h>
    3433#ifdef VBOX_WITH_REM
     
    4948#include <VBox/disopcode.h>
    5049#include <VBox/vmm/dbgf.h>
     50#include "VMMTracing.h"
    5151
    5252#include <VBox/log.h>
     
    173173        {
    174174            rc = emR3RawForcedActions(pVM, pVCpu, pCtx);
     175            VBOXVMMR3_EM_FF_RAW_RET(pVCpu, rc);
    175176            if (rc != VINF_SUCCESS)
    176177                return rc;
     
    12011202VMMR3DECL(int) EMR3CheckRawForcedActions(PVM pVM, PVMCPU pVCpu)
    12021203{
    1203     return emR3RawForcedActions(pVM, pVCpu, pVCpu->em.s.pCtx);
     1204    int rc = emR3RawForcedActions(pVM, pVCpu, pVCpu->em.s.pCtx);
     1205    VBOXVMMR3_EM_FF_RAW_RET(pVCpu, rc);
     1206    return rc;
    12041207}
    12051208
     
    12221225     * Also note that SELMR3UpdateFromCPUM may trigger VM_FF_SELM_SYNC_TSS.
    12231226     */
    1224 
     1227    VBOXVMMR3_EM_FF_RAW(pVCpu, pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions);
    12251228
    12261229    /*
     
    13841387            ||  VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK))
    13851388        {
    1386 #ifdef DBGFTRACE_ENABLED
    1387             RTTraceBufAddMsgF(pVM->CTX_SUFF(hTraceBuf), "em-raw ff %08x/%08x pre", pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions);
    1388 #endif
    13891389            rc = emR3RawForcedActions(pVM, pVCpu, pCtx);
     1390            VBOXVMMR3_EM_FF_RAW_RET(pVCpu, rc);
    13901391            if (rc != VINF_SUCCESS)
    13911392                break;
     
    14181419            {
    14191420                rc = emR3RawForcedActions(pVM, pVCpu, pCtx);
     1421                VBOXVMMR3_EM_FF_RAW_RET(pVCpu, rc);
    14201422                if (rc != VINF_SUCCESS)
    14211423                {
     
    14511453        {
    14521454            STAM_PROFILE_START(&pVCpu->em.s.StatRAWExec, c);
     1455            VBOXVMMR3_EM_RAW_RUN_PRE(pVCpu, pCtx);
    14531456            rc = VMMR3RawRunGC(pVM, pVCpu);
     1457            VBOXVMMR3_EM_RAW_RUN_RET(pVCpu, pCtx, rc);
    14541458            STAM_PROFILE_STOP(&pVCpu->em.s.StatRAWExec, c);
    1455 #ifdef DBGFTRACE_ENABLED
    1456             RTTraceBufAddMsgF(pVM->CTX_SUFF(hTraceBuf), "em-raw run => %d", rc);
    1457 #endif
    14581459        }
    14591460        else
     
    15491550        {
    15501551            Assert(pCtx->eflags.Bits.u1VM || (pCtx->ss & X86_SEL_RPL) != 1);
    1551 #ifdef DBGFTRACE_ENABLED
    1552             RTTraceBufAddMsgF(pVM->CTX_SUFF(hTraceBuf), "em-raw ff %08x/%08x post", pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions);
    1553 #endif
    15541552
    15551553            STAM_REL_PROFILE_ADV_SUSPEND(&pVCpu->em.s.StatRAWTotal, a);
    15561554            rc = emR3ForcedActions(pVM, pVCpu, rc);
     1555            VBOXVMMR3_EM_FF_ALL_RET(pVCpu, rc);
    15571556            STAM_REL_PROFILE_ADV_RESUME(&pVCpu->em.s.StatRAWTotal, a);
    15581557            if (    rc != VINF_SUCCESS
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