VirtualBox

Changeset 16654 in vbox for trunk


Ignore:
Timestamp:
Feb 11, 2009 10:00:43 AM (16 years ago)
Author:
vboxsync
Message:

Symbolic PGMPOOLKIND logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r16644 r16654  
    6363#ifndef IN_RING3
    6464DECLEXPORT(int) pgmPoolAccessHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPHYS GCPhysFault, void *pvUser);
     65#endif
     66#ifdef LOG_ENABLED
     67static char *pgmPoolPoolKindToStr(uint8_t enmKind);
    6568#endif
    6669__END_DECLS
     
    15081511    }
    15091512
    1510     Log3(("pgmPoolCacheAlloc: Missed GCPhys=%RGp enmKind=%d\n", GCPhys, enmKind));
     1513    Log3(("pgmPoolCacheAlloc: Missed GCPhys=%RGp enmKind=%s\n", GCPhys, pgmPoolPoolKindToStr(enmKind)));
    15111514    STAM_COUNTER_INC(&pPool->StatCacheMisses);
    15121515    return VERR_FILE_NOT_FOUND;
     
    15311534        pPage->fCached = true;
    15321535        pgmPoolHashInsert(pPool, pPage);
    1533         Log3(("pgmPoolCacheInsert: Caching %p:{.Core=%RHp, .idx=%d, .enmKind=%d, GCPhys=%RGp}\n",
    1534               pPage, pPage->Core.Key, pPage->idx, pPage->enmKind, pPage->GCPhys));
     1536        Log3(("pgmPoolCacheInsert: Caching %p:{.Core=%RHp, .idx=%d, .enmKind=%s, GCPhys=%RGp}\n",
     1537              pPage, pPage->Core.Key, pPage->idx, pgmPoolPoolKindToStr(pPage->enmKind), pPage->GCPhys));
    15351538        STAM_COUNTER_INC(&pPool->StatCacheCacheable);
    15361539    }
    15371540    else
    15381541    {
    1539         Log3(("pgmPoolCacheInsert: Not caching %p:{.Core=%RHp, .idx=%d, .enmKind=%d, GCPhys=%RGp}\n",
    1540               pPage, pPage->Core.Key, pPage->idx, pPage->enmKind, pPage->GCPhys));
     1542        Log3(("pgmPoolCacheInsert: Not caching %p:{.Core=%RHp, .idx=%d, .enmKind=%s, GCPhys=%RGp}\n",
     1543              pPage, pPage->Core.Key, pPage->idx, pgmPoolPoolKindToStr(pPage->enmKind), pPage->GCPhys));
    15411544        STAM_COUNTER_INC(&pPool->StatCacheUncacheable);
    15421545    }
     
    41544157    int rc = VINF_SUCCESS;
    41554158    STAM_PROFILE_START(&pPool->StatFlushPage, f);
    4156     LogFlow(("pgmPoolFlushPage: pPage=%p:{.Key=%RHp, .idx=%d, .enmKind=%d, .GCPhys=%RGp}\n",
    4157              pPage, pPage->Core.Key, pPage->idx, pPage->enmKind, pPage->GCPhys));
     4159    LogFlow(("pgmPoolFlushPage: pPage=%p:{.Key=%RHp, .idx=%d, .enmKind=%s, .GCPhys=%RGp}\n",
     4160             pPage, pPage->Core.Key, pPage->idx, pgmPoolPoolKindToStr(pPage->enmKind), pPage->GCPhys));
    41584161
    41594162    /*
     
    41624165    if (pPage->idx < PGMPOOL_IDX_FIRST)
    41634166    {
    4164         Log(("pgmPoolFlushPage: special root page, rejected. enmKind=%d idx=%d\n", pPage->enmKind, pPage->idx));
     4167        Log(("pgmPoolFlushPage: special root page, rejected. enmKind=%s idx=%d\n", pgmPoolPoolKindToStr(pPage->enmKind), pPage->idx));
    41654168        return VINF_SUCCESS;
    41664169    }
     
    41754178                  ("Can't free the shadow CR3! (%RHp vs %RHp kind=%d\n", PGMGetHyperCR3(pPool->CTX_SUFF(pVM)), pPage->Core.Key, pPage->enmKind));
    41764179#endif
    4177         Log(("pgmPoolFlushPage: current active shadow CR3, rejected. enmKind=%d idx=%d\n", pPage->enmKind, pPage->idx));
     4180        Log(("pgmPoolFlushPage: current active shadow CR3, rejected. enmKind=%s idx=%d\n", pgmPoolPoolKindToStr(pPage->enmKind), pPage->idx));
    41784181        return VINF_SUCCESS;
    41794182    }
     
    42504253{
    42514254    STAM_PROFILE_START(&pPool->StatFree, a);
    4252     LogFlow(("pgmPoolFreeByPage: pPage=%p:{.Key=%RHp, .idx=%d, enmKind=%d} iUser=%#x iUserTable=%#x\n",
    4253              pPage, pPage->Core.Key, pPage->idx, pPage->enmKind, iUser, iUserTable));
     4255    LogFlow(("pgmPoolFreeByPage: pPage=%p:{.Key=%RHp, .idx=%d, enmKind=%s} iUser=%#x iUserTable=%#x\n",
     4256             pPage, pPage->Core.Key, pPage->idx, pgmPoolPoolKindToStr(pPage->enmKind), iUser, iUserTable));
    42544257    Assert(pPage->idx >= PGMPOOL_IDX_FIRST);
    42554258#ifdef PGMPOOL_WITH_USER_TRACKING
     
    43394342    PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
    43404343    STAM_PROFILE_ADV_START(&pPool->StatAlloc, a);
    4341     LogFlow(("pgmPoolAlloc: GCPhys=%RGp enmKind=%d iUser=%#x iUserTable=%#x\n", GCPhys, enmKind, iUser, iUserTable));
     4344    LogFlow(("pgmPoolAlloc: GCPhys=%RGp enmKind=%s iUser=%#x iUserTable=%#x\n", GCPhys, pgmPoolPoolKindToStr(enmKind), iUser, iUserTable));
    43424345    *ppPage = NULL;
    43434346    /** @todo CSAM/PGMPrefetchPage messes up here during CSAMR3CheckGates
     
    44814484    PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
    44824485    PPGMPOOLPAGE pPage = pgmPoolGetPage(pPool, HCPhys);
    4483     Log3(("pgmPoolGetPageByHCPhys: HCPhys=%RHp -> %p:{.idx=%d .GCPhys=%RGp .enmKind=%d}\n",
    4484           HCPhys, pPage, pPage->idx, pPage->GCPhys, pPage->enmKind));
     4486    Log3(("pgmPoolGetPageByHCPhys: HCPhys=%RHp -> %p:{.idx=%d .GCPhys=%RGp .enmKind=%s}\n",
     4487          HCPhys, pPage, pPage->idx, pPage->GCPhys, pgmPoolPoolKindToStr(pPage->enmKind)));
    44854488    return pPage;
    44864489}
     
    45014504}
    45024505
     4506#ifdef LOG_ENABLED
     4507static char *pgmPoolPoolKindToStr(uint8_t enmKind)
     4508{
     4509    switch(enmKind)
     4510    {
     4511    case PGMPOOLKIND_INVALID:
     4512        return "PGMPOOLKIND_INVALID";
     4513    case PGMPOOLKIND_FREE:
     4514        return "PGMPOOLKIND_FREE";
     4515    case PGMPOOLKIND_32BIT_PT_FOR_PHYS:
     4516        return "PGMPOOLKIND_32BIT_PT_FOR_PHYS";
     4517    case PGMPOOLKIND_32BIT_PT_FOR_32BIT_PT:
     4518        return "PGMPOOLKIND_32BIT_PT_FOR_32BIT_PT";
     4519    case PGMPOOLKIND_32BIT_PT_FOR_32BIT_4MB:
     4520        return "PGMPOOLKIND_32BIT_PT_FOR_32BIT_4MB";
     4521    case PGMPOOLKIND_PAE_PT_FOR_PHYS:
     4522        return "PGMPOOLKIND_PAE_PT_FOR_PHYS";
     4523    case PGMPOOLKIND_PAE_PT_FOR_32BIT_PT:
     4524        return "PGMPOOLKIND_PAE_PT_FOR_32BIT_PT";
     4525    case PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB:
     4526        return "PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB";
     4527    case PGMPOOLKIND_PAE_PT_FOR_PAE_PT:
     4528        return "PGMPOOLKIND_PAE_PT_FOR_PAE_PT";
     4529    case PGMPOOLKIND_PAE_PT_FOR_PAE_2MB:
     4530        return "PGMPOOLKIND_PAE_PT_FOR_PAE_2MB";
     4531    case PGMPOOLKIND_32BIT_PD:
     4532        return "PGMPOOLKIND_32BIT_PD";
     4533    case PGMPOOLKIND_32BIT_PD_PHYS:
     4534        return "PGMPOOLKIND_32BIT_PD_PHYS";
     4535    case PGMPOOLKIND_PAE_PD0_FOR_32BIT_PD:
     4536        return "PGMPOOLKIND_PAE_PD0_FOR_32BIT_PD";
     4537    case PGMPOOLKIND_PAE_PD1_FOR_32BIT_PD:
     4538        return "PGMPOOLKIND_PAE_PD1_FOR_32BIT_PD";
     4539    case PGMPOOLKIND_PAE_PD2_FOR_32BIT_PD:
     4540        return "PGMPOOLKIND_PAE_PD2_FOR_32BIT_PD";
     4541    case PGMPOOLKIND_PAE_PD3_FOR_32BIT_PD:
     4542        return "PGMPOOLKIND_PAE_PD3_FOR_32BIT_PD";
     4543    case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
     4544        return "PGMPOOLKIND_PAE_PD_FOR_PAE_PD";
     4545    case PGMPOOLKIND_PAE_PD_PHYS:
     4546        return "PGMPOOLKIND_PAE_PD_PHYS";
     4547    case PGMPOOLKIND_PAE_PDPT_FOR_32BIT:
     4548        return "PGMPOOLKIND_PAE_PDPT_FOR_32BIT";
     4549    case PGMPOOLKIND_PAE_PDPT:
     4550        return "PGMPOOLKIND_PAE_PDPT";
     4551    case PGMPOOLKIND_PAE_PDPT_PHYS:
     4552        return "PGMPOOLKIND_PAE_PDPT_PHYS";
     4553    case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
     4554        return "PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT";
     4555    case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
     4556        return "PGMPOOLKIND_64BIT_PDPT_FOR_PHYS";
     4557    case PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD:
     4558        return "PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD";
     4559    case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
     4560        return "PGMPOOLKIND_64BIT_PD_FOR_PHYS";
     4561    case PGMPOOLKIND_64BIT_PML4:
     4562        return "PGMPOOLKIND_64BIT_PML4";
     4563    case PGMPOOLKIND_EPT_PDPT_FOR_PHYS:
     4564        return "PGMPOOLKIND_EPT_PDPT_FOR_PHYS";
     4565    case PGMPOOLKIND_EPT_PD_FOR_PHYS:
     4566        return "PGMPOOLKIND_EPT_PD_FOR_PHYS";
     4567    case PGMPOOLKIND_EPT_PT_FOR_PHYS:
     4568        return "PGMPOOLKIND_EPT_PT_FOR_PHYS";
     4569#ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY
     4570    case PGMPOOLKIND_ROOT_32BIT_PD:
     4571        return "PGMPOOLKIND_ROOT_32BIT_PD";
     4572    case PGMPOOLKIND_ROOT_PAE_PD:
     4573        return "PGMPOOLKIND_ROOT_PAE_PD";
     4574    case PGMPOOLKIND_ROOT_PDPT:
     4575        return "PGMPOOLKIND_ROOT_PDPT";
     4576#endif
     4577    case PGMPOOLKIND_ROOT_NESTED:
     4578        return "PGMPOOLKIND_ROOT_NESTED";
     4579    }
     4580    return "Unknown kind!";
     4581}
     4582#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