VirtualBox

Ignore:
Timestamp:
Jan 28, 2020 7:52:56 PM (5 years ago)
Author:
vboxsync
Message:

VMM/PGMPool: Instrumenting code for debugging OS X issue. bugref:9627

File:
1 edited

Legend:

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

    r82888 r82895  
    20262026 * @param   pPool       The pool.
    20272027 * @param   iUser       The user index.
    2028  */
    2029 static int pgmPoolCacheFreeOne(PPGMPOOL pPool, uint16_t iUser)
     2028 * @param   pszTmpCaller OS X debugging.
     2029 */
     2030static int pgmPoolCacheFreeOne(PPGMPOOL pPool, uint16_t iUser, const char *pszTmpCaller)
    20302031{
    20312032    const PVMCC pVM = pPool->CTX_SUFF(pVM);
     
    20562057*/
    20572058        Assert(iToFree != iUser);
    2058         AssertReleaseMsg(iToFree != NIL_PGMPOOL_IDX, ("iToFree=%#x (%#x)\n%.1024Rhxd\n", iToFree, pPool->iAgeTail, pPool));
     2059        if (RT_LIKELY(iToFree != NIL_PGMPOOL_IDX)) /* Temporary OS X debugging */
     2060        { /* likely */ }
     2061        else
     2062        {
     2063            size_t cbPool = RT_UOFFSETOF_DYN(PGMPOOL, aPages[pPool->cMaxPages])
     2064                          + pPool->cMaxUsers * sizeof(PGMPOOLUSER)
     2065                          + pPool->cMaxPhysExts * sizeof(PGMPOOLPHYSEXT);
     2066            uint8_t *pbLastPage = (uint8_t *)pPool + ((cbPool - 1) & ~(uintptr_t)PAGE_OFFSET_MASK);
     2067            AssertReleaseMsg(iToFree != NIL_PGMPOOL_IDX, ("%s: iToFree=%#x (iAgeTail=%#x) iUser=%#x iLoop=%u - pPool=%p (LB %#zx):\n"
     2068                                                          "%.512Rhxd\n"
     2069                                                          "pLastPage=%p:\n"
     2070                                                          "%.4096Rhxd\n",
     2071                                                          pszTmpCaller, iToFree, pPool->iAgeTail, iUser, iLoop,
     2072                                                          pPool, cbPool, pPool, pbLastPage, pbLastPage));
     2073        }
    20592074        pPage = &pPool->aPages[iToFree];
    20602075
     
    27892804 * @param   pPool       The pool.
    27902805 * @param   iUser       The user index.
    2791  */
    2792 static int pgmPoolTrackFreeOneUser(PPGMPOOL pPool, uint16_t iUser)
     2806 * @param   pszTmpCaller Temporary OS X debugging.
     2807 */
     2808static int pgmPoolTrackFreeOneUser(PPGMPOOL pPool, uint16_t iUser, const char *pszTmpCaller)
    27932809{
    27942810    STAM_COUNTER_INC(&pPool->StatTrackFreeUpOneUser);
     
    28002816    do
    28012817    {
    2802         int rc2 = pgmPoolCacheFreeOne(pPool, iUser);
     2818        int rc2 = pgmPoolCacheFreeOne(pPool, iUser, pszTmpCaller);
    28032819        if (RT_FAILURE(rc2) && rc == VINF_SUCCESS)
    28042820            rc = rc2;
     
    28542870        if (i == NIL_PGMPOOL_USER_INDEX)
    28552871        {
    2856             rc = pgmPoolTrackFreeOneUser(pPool, iUser);
     2872            rc = pgmPoolTrackFreeOneUser(pPool, iUser, __FUNCTION__);
    28572873            if (RT_FAILURE(rc))
    28582874                return rc;
     
    29402956    if (i == NIL_PGMPOOL_USER_INDEX)
    29412957    {
    2942         int rc = pgmPoolTrackFreeOneUser(pPool, iUser);
     2958        int rc = pgmPoolTrackFreeOneUser(pPool, iUser, __FUNCTION__);
    29432959        if (RT_FAILURE(rc))
    29442960            return rc;
     
    49704986     * If the pool isn't full grown yet, expand it.
    49714987     */
     4988const char *pszTmp = "pgmPoolMakeMoreFreePages/no-growth";
    49724989    if (pPool->cCurPages < pPool->cMaxPages)
    49734990    {
     
    49835000        if (pPool->iFreeHead != NIL_PGMPOOL_IDX)
    49845001            return VINF_SUCCESS;
     5002pszTmp = "pgmPoolMakeMoreFreePages/grew-it";
    49855003    }
    49865004
     
    49885006     * Free one cached page.
    49895007     */
    4990     return pgmPoolCacheFreeOne(pPool, iUser);
     5008    return pgmPoolCacheFreeOne(pPool, iUser, pszTmp);
    49915009}
    49925010
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