VirtualBox

Changeset 6914 in vbox for trunk


Ignore:
Timestamp:
Feb 11, 2008 11:17:43 PM (17 years ago)
Author:
vboxsync
Message:

Replaced PGMR3DumpMappings by info handler.

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

Legend:

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

    r6913 r6914  
    941941        DBGFR3InfoRegisterInternal(pVM, "handlers",
    942942                                   "Dumps physical, virtual and hyper virtual handlers. "
    943                                    "Pass 'phys', 'virt', 'hyper' as argument if only one kind is wanted. "
    944                                    "Add 'nost' if the statistics are unwanted.",
     943                                   "Pass 'phys', 'virt', 'hyper' as argument if only one kind is wanted."
     944                                   "Add 'nost' if the statistics are unwanted, use together with 'all' or explicit selection.",
    945945                                   pgmR3InfoHandlers);
     946        DBGFR3InfoRegisterInternal(pVM, "mappings",
     947                                   "Dumps guest mappings.",
     948                                   pgmR3MapInfo);
    946949
    947950        STAM_REL_REG(pVM, &pVM->pgm.s.cGuestModeChanges, STAMTYPE_COUNTER, "/PGM/cGuestModeChanges", STAMUNIT_OCCURENCES, "Number of guest mode changes.");
     
    16921695    AssertRC(rc);
    16931696#ifdef DEBUG
    1694     PGMR3DumpMappings(pVM);
     1697    DBGFR3InfoLog(pVM, "mappings", NULL);
     1698    DBGFR3InfoLog(pVM, "handlers", "all nostat");
    16951699#endif
    16961700
  • trunk/src/VBox/VMM/PGMHandler.cpp

    r6913 r6914  
    515515     * Test input.
    516516     */
    517     PGMHANDLERINFOARG Args = { pHlp, true };
     517    PGMHANDLERINFOARG Args = { pHlp, /* .fStats = */ true };
    518518    bool fPhysical = !pszArgs  || !*pszArgs;
    519519    bool fVirtual = fPhysical;
     
    521521    if (!fPhysical)
    522522    {
    523         fPhysical = strstr(pszArgs, "phys") != NULL;
    524         fVirtual = strstr(pszArgs, "virt") != NULL;
    525         fHyper = strstr(pszArgs, "hyper") != NULL;
     523        bool fAll = strstr(pszArgs, "all") != NULL;
     524        fPhysical   = fAll || strstr(pszArgs, "phys") != NULL;
     525        fVirtual    = fAll || strstr(pszArgs, "virt") != NULL;
     526        fHyper      = fAll || strstr(pszArgs, "hyper")!= NULL;
    526527        Args.fStats = strstr(pszArgs, "nost") == NULL;
    527528    }
  • trunk/src/VBox/VMM/PGMInternal.h

    r6913 r6914  
    24682468__BEGIN_DECLS
    24692469
     2470int             pgmLock(PVM pVM);
     2471void            pgmUnlock(PVM pVM);
     2472
    24702473PGMGCDECL(int)  pgmGCGuestPDWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, void *pvFault, RTGCPHYS GCPhysFault, void *pvUser);
    24712474PGMDECL(int)    pgmPhysRomWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, void *pvFault, RTGCPHYS GCPhysFault, void *pvUser);
     2475int             pgmR3ChangeMode(PVM pVM, PGMMODE enmGuestMode);
     2476
    24722477int             pgmR3SyncPTResolveConflict(PVM pVM, PPGMMAPPING pMapping, PVBOXPD pPDSrc, int iPDOld);
    24732478PPGMMAPPING     pgmGetMapping(PVM pVM, RTGCPTR GCPtr);
    24742479void            pgmR3MapRelocate(PVM pVM, PPGMMAPPING pMapping, int iPDOld, int iPDNew);
    2475 int             pgmR3ChangeMode(PVM pVM, PGMMODE enmGuestMode);
    2476 int             pgmLock(PVM pVM);
    2477 void            pgmUnlock(PVM pVM);
     2480DECLCALLBACK(void) pgmR3MapInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
    24782481
    24792482void            pgmR3HandlerPhysicalUpdateAll(PVM pVM);
  • trunk/src/VBox/VMM/PGMMap.cpp

    r6913 r6914  
    3838static void              pgmR3MapClearPDEs(PPGM pPGM, PPGMMAPPING pMap, int iOldPDE);
    3939static void              pgmR3MapSetPDEs(PVM pVM, PPGMMAPPING pMap, int iNewPDE);
    40 static DECLCALLBACK(int) pgmR3DumpMappingsPhysicalCB(PAVLROGCPHYSNODECORE pNode, void *pvUser);
    4140static int               pgmR3MapIntermediateCheckOne(PVM pVM, uintptr_t uAddress, unsigned cPages, PX86PT pPTDefault, PX86PTPAE pPTPaeDefault);
    4241static void              pgmR3MapIntermediateDoOne(PVM pVM, uintptr_t uAddress, RTHCPHYS HCPhys, unsigned cPages, PX86PT pPTDefault, PX86PTPAE pPTPaeDefault);
     
    10781077
    10791078/**
    1080  * Dumps one virtual handler range.
    1081  *
    1082  * @returns 0
    1083  * @param   pNode   Pointer to a PGMVIRTHANDLER.
    1084  * @param   pvUser  Pointer to command helper functions.
    1085  */
    1086 static DECLCALLBACK(int) pgmVirtHandlerDump(PAVLROGCPTRNODECORE pNode, void *pvUser)
    1087 {
    1088     PPGMVIRTHANDLER pCur = (PPGMVIRTHANDLER)pNode;
    1089 
    1090     switch (pCur->enmType)
    1091     {
    1092         case PGMVIRTHANDLERTYPE_WRITE:
    1093             RTLogPrintf("WRITE    %RGv-%RGv size %RGv %s\n", pCur->GCPtr, pCur->GCPtrLast, pCur->cb, pCur->pszDesc);
    1094             break;
    1095         case PGMVIRTHANDLERTYPE_ALL:
    1096             RTLogPrintf("ALL      %RGv-%RGv size %RGv %s\n", pCur->GCPtr, pCur->GCPtrLast, pCur->cb, pCur->pszDesc);
    1097             break;
    1098         case PGMVIRTHANDLERTYPE_HYPERVISOR:
    1099             RTLogPrintf("WRITEHYP %RGv-%RGv size %RGv %s\n", pCur->GCPtr, pCur->GCPtrLast, pCur->cb, pCur->pszDesc);
    1100             break;
    1101     }
    1102     if (pCur->enmType != PGMVIRTHANDLERTYPE_HYPERVISOR)
    1103         for (unsigned i = 0; i < pCur->cPages; i++)
    1104             RTLogPrintf("Physical page %#05d %VGp\n", i, pCur->aPhysToVirt[i].Core.Key);
    1105     return 0;
    1106 }
    1107 
    1108 /**
    1109  * Dumps the current mappings to the log
    1110  *
    1111  * @returns VBox status.
    1112  * @param   pVM         Pointer to the current VM (if any).
    1113  *
    1114  */
    1115 PGMR3DECL(void) PGMR3DumpMappings(PVM pVM)
    1116 {
    1117     /*
    1118      * Print message about the fixedness of the mappings and dump them.
    1119      */
    1120     RTLogPrintf(pVM->pgm.s.fMappingsFixed ? "\nThe mappings are FIXED.\n" : "\nThe mappings are FLOATING.\n");
    1121 
     1079 * Info callback for 'pgmhandlers'.
     1080 *
     1081 * @param   pHlp        The output helpers.
     1082 * @param   pszArgs     The arguments. phys or virt.
     1083 */
     1084DECLCALLBACK(void) pgmR3MapInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
     1085{
     1086    pHlp->pfnPrintf(pHlp, pVM->pgm.s.fMappingsFixed
     1087                    ? "\nThe mappings are FIXED.\n"
     1088                    : "\nThe mappings are FLOATING.\n");
    11221089    PPGMMAPPING pCur;
    11231090    for (pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3)
    1124         RTLogPrintf("%VGv - %VGv  %s\n", pCur->GCPtr, pCur->GCPtrLast, pCur->pszDesc);
    1125 
    1126 /** @todo The handler stuff is totally alien here. This should be converted into a 'info' function.
    1127  * There are now, just kill this. */
    1128     RTLogPrintf("\nVirtual handlers:\n");
    1129     RTAvlroGCPtrDoWithAll(&pVM->pgm.s.pTreesHC->VirtHandlers, true, pgmVirtHandlerDump, pVM);
    1130 
    1131     RTLogPrintf("\n"
    1132                 "Physical handlers: (PhysHandlers=%d (%#x))\n"
    1133                 "From     - To (incl) HandlerHC UserHC    HandlerHC UserHC    HandlerGC UserGC    Type     Description\n",
    1134                 pVM->pgm.s.pTreesHC->PhysHandlers, pVM->pgm.s.pTreesHC->PhysHandlers);
    1135     RTAvlroGCPhysDoWithAll(&pVM->pgm.s.pTreesHC->PhysHandlers, true, pgmR3DumpMappingsPhysicalCB, NULL);
    1136 }
    1137 
    1138 
    1139 /**
    1140  * Dumps one physical handler range.
    1141  *
    1142  * @returns 0
    1143  * @param   pNode   Pointer to a PGMPHYSHANDLER.
    1144  * @param   pvUser  Ignored.
    1145  */
    1146 static DECLCALLBACK(int) pgmR3DumpMappingsPhysicalCB(PAVLROGCPHYSNODECORE pNode, void *pvUser)
    1147 {
    1148     PPGMPHYSHANDLER pCur = (PPGMPHYSHANDLER)pNode; NOREF(pvUser);
    1149     const char *pszType;
    1150     switch (pCur->enmType)
    1151     {
    1152         case PGMPHYSHANDLERTYPE_MMIO:           pszType = "MMIO   "; break;
    1153         case PGMPHYSHANDLERTYPE_PHYSICAL_WRITE: pszType = "Write  "; break;
    1154         case PGMPHYSHANDLERTYPE_PHYSICAL_ALL:   pszType = "All    "; break;
    1155         default:                                pszType = "????"; break;
    1156     }
    1157     RTLogPrintf("%VGp - %VGp  %VHv  %VHv  %VHv  %VHv  %VGv  %VGv  %s  %s\n",
    1158                 pCur->Core.Key, pCur->Core.KeyLast, pCur->pfnHandlerR3, pCur->pvUserR3, pCur->pfnHandlerR0, pCur->pvUserR0,
    1159                 pCur->pfnHandlerGC, pCur->pvUserGC, pszType, pCur->pszDesc);
    1160     return 0;
    1161 }
    1162 
     1091        pHlp->pfnPrintf(pHlp, "%VGv - %VGv  %s\n", pCur->GCPtr, pCur->GCPtrLast, pCur->pszDesc);
     1092}
     1093
  • trunk/src/VBox/VMM/VMM.cpp

    r6528 r6914  
    25962596
    25972597    /*
    2598      * Dump useful state information.
    2599      */
    2600     /** @todo convert these dumpers to DBGFR3Info() handlers!!! */
    2601     pHlp->pfnPrintf(pHlp,
    2602                     "!!\n"
    2603                     "!! PGM Access Handlers & Stuff:\n"
    2604                     "!!\n");
    2605     PGMR3DumpMappings(pVM);
    2606 
    2607 
    2608     /*
    26092598     * Generic info dumper loop.
    26102599     */
     
    26152604    } const     aInfo[] =
    26162605    {
     2606        { "mappings",       NULL },
    26172607        { "hma",            NULL },
    26182608        { "cpumguest",      "verbose" },
     
    26302620        { "timers",         NULL },
    26312621        { "activetimers",   NULL },
    2632         { "handlers",       "phys virt stats" },
     2622        { "handlers",       "phys virt hyper stats" },
    26332623        { "cfgm",           NULL },
    26342624    };
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