VirtualBox

Changeset 53801 in vbox


Ignore:
Timestamp:
Jan 14, 2015 1:31:53 PM (10 years ago)
Author:
vboxsync
Message:

Devices: use LogRelMax were appropriate

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r53268 r53801  
    683683         * Too many variables.
    684684         */
    685         static unsigned s_cWarnings = 0;
    686         if (s_cWarnings++ < 5)
    687             LogRel(("EFI: Too many variables (%RTuuid::'%s' fAttrib=%#x cbValue=%#x)\n", &pThis->NVRAM.VarOpBuf.uuid,
    688                     pThis->NVRAM.VarOpBuf.szName, pThis->NVRAM.VarOpBuf.fAttributes, pThis->NVRAM.VarOpBuf.cbValue));
     685        LogRelMax(5, ("EFI: Too many variables (%RTuuid::'%s' fAttrib=%#x cbValue=%#x)\n", &pThis->NVRAM.VarOpBuf.uuid,
     686                  pThis->NVRAM.VarOpBuf.szName, pThis->NVRAM.VarOpBuf.fAttributes, pThis->NVRAM.VarOpBuf.cbValue));
    689687        pThis->NVRAM.u32Status = EFI_VARIABLE_OP_STATUS_ERROR;
    690688        Log(("nvramWriteVariableOpAdd: Too many variabled.\n"));
     
    15291527            {
    15301528                /* For now, just log it. */
    1531                 static uint64_t s_cDbgPointLogged = 0;
    1532                 if (s_cDbgPointLogged < 1024)
    1533                 {
    1534                     s_cDbgPointLogged++;
    1535                     LogRel(("EFI: debug point %s\n", efiDbgPointName((EFIDBGPOINT)u32)));
    1536                 }
     1529                LogRelMax(1024, ("EFI: debug point %s\n", efiDbgPointName((EFIDBGPOINT)u32)));
    15371530                rc = VINF_SUCCESS;
    15381531            }
  • trunk/src/VBox/Devices/PC/DevAPIC.cpp

    r52670 r53801  
    11621162            {
    11631163                /** @todo implement APIC_DM_FIXED! */
    1164                 static unsigned s_c = 0;
    1165                 if (s_c++ < 5)
    1166                     LogRel(("delivery type APIC_DM_FIXED not implemented. u8Pin=%d u8Level=%d\n", u8Pin, u8Level));
     1164                LogRelMax(5, ("delivery type APIC_DM_FIXED not implemented. u8Pin=%d u8Level=%d\n", u8Pin, u8Level));
    11671165                return  VINF_SUCCESS;
    11681166            }
  • trunk/src/VBox/Devices/PC/DevHPET.cpp

    r51526 r53801  
    446446        || iTimerNo >= RT_ELEMENTS(pThis->aTimers) )                /* in practice, the number of configured timers */
    447447    {                                                               /* will always be <= aTimers elements. */
    448         static unsigned s_cOccurences = 0;
    449         if (s_cOccurences++ < 10)
    450             LogRel(("HPET: using timer above configured range: %d\n", iTimerNo));
     448        LogRelMax(10, ("HPET: using timer above configured range: %d\n", iTimerNo));
    451449        *pu32Value = 0;
    452450        return VINF_SUCCESS;
     
    484482        default:
    485483        {
    486             static unsigned s_cOccurences = 0;
    487             if (s_cOccurences++ < 10)
    488                 LogRel(("invalid HPET register read %d on %d\n", iTimerReg, pHpetTimer->idxTimer));
     484            LogRelMax(10, ("invalid HPET register read %d on %d\n", iTimerReg, pHpetTimer->idxTimer));
    489485            u32Value = 0;
    490486            break;
     
    515511        || iTimerNo >= RT_ELEMENTS(pThis->aTimers) )    /* Parfait - see above. */
    516512    {
    517         static unsigned s_cOccurences = 0;
    518         if (s_cOccurences++ < 10)
    519             LogRel(("HPET: using timer above configured range: %d\n", iTimerNo));
     513        LogRelMax(10, ("HPET: using timer above configured range: %d\n", iTimerNo));
    520514        return VINF_SUCCESS;
    521515    }
     
    546540            if ((u32NewValue & HPET_TN_INT_TYPE) == HPET_TIMER_TYPE_LEVEL)
    547541            {
    548                 static unsigned s_cOccurences = 0;
    549                 if (s_cOccurences++ < 10)
    550                     LogRel(("level-triggered config not yet supported\n"));
     542                LogRelMax(10, ("level-triggered config not yet supported\n"));
    551543                AssertFailed();
    552544            }
     
    559551
    560552        case HPET_TN_CFG + 4: /* Interrupt capabilities - read only. */
    561         {
    562553            Log(("write HPET_TN_CFG + 4, useless\n"));
    563554            break;
    564         }
    565555
    566556        case HPET_TN_CMP: /* lower bits of comparator register */
     
    603593
    604594        case HPET_TN_ROUTE:
    605         {
    606595            Log(("write HPET_TN_ROUTE\n"));
    607596            break;
    608         }
    609597
    610598        case HPET_TN_ROUTE + 4:
    611         {
    612599            Log(("write HPET_TN_ROUTE + 4\n"));
    613600            break;
    614         }
    615601
    616602        default:
    617         {
    618             static unsigned s_cOccurences = 0;
    619             if (s_cOccurences++ < 10)
    620                 LogRel(("invalid timer register write: %d\n", iTimerReg));
    621             break;
    622         }
     603            LogRelMax(10, ("invalid timer register write: %d\n", iTimerReg));
     604            break;
    623605    }
    624606
     
    814796            Log(("write HPET_STATUS + 4: %x\n", u32NewValue));
    815797            if (u32NewValue != 0)
    816             {
    817                 static unsigned s_cOccurrences = 0;
    818                 if (s_cOccurrences++ < 10)
    819                     LogRel(("Writing HPET_STATUS + 4 with non-zero, ignored\n"));
    820             }
     798                LogRelMax(10, ("Writing HPET_STATUS + 4 with non-zero, ignored\n"));
    821799            break;
    822800        }
     
    841819
    842820        default:
    843         {
    844             static unsigned s_cOccurences = 0;
    845             if (s_cOccurences++ < 10)
    846                 LogRel(("invalid HPET config write: %x\n", idxReg));
    847             break;
    848         }
     821            LogRelMax(10, ("invalid HPET config write: %x\n", idxReg));
     822            break;
    849823    }
    850824
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r53767 r53801  
    744744        if (!pEntry)
    745745        {
    746             static int g_cLogEntries = 0;
    747             if (g_cLogEntries++ < 10)
    748                 LogRel(("VMM: Facility table is full - facility=%u status=%u.\n", pStatus->facility, pStatus->status));
     746            LogRelMax(10, ("VMM: Facility table is full - facility=%u status=%u.\n", pStatus->facility, pStatus->status));
    749747            return VERR_OUT_OF_RESOURCES;
    750748        }
     
    27262724        else
    27272725        {
    2728             static int s_cRelWarn;
    2729             if (s_cRelWarn < 10)
    2730             {
    2731                 s_cRelWarn++;
    2732                 LogRel(("VMMDev: the guest has not yet reported to us -- refusing operation of request #%d\n",
     2726            LogRelMax(10, ("VMMDev: the guest has not yet reported to us -- refusing operation of request #%d\n",
    27332727                        requestHeader.requestType));
    2734             }
    27352728            requestHeader.rc = VERR_NOT_SUPPORTED;
    27362729        }
     
    27382731    else
    27392732    {
    2740         static int s_cRelWarn;
    2741         if (s_cRelWarn < 50)
    2742         {
    2743             s_cRelWarn++;
    2744             LogRel(("VMMDev: request packet too big (%x). Refusing operation.\n", requestHeader.size));
    2745         }
     2733        LogRelMax(50, ("VMMDev: request packet too big (%x). Refusing operation.\n", requestHeader.size));
    27462734        requestHeader.rc = VERR_NOT_SUPPORTED;
    27472735    }
  • trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp

    r50982 r53801  
    652652    if (cParms > VMMDEV_MAX_HGCM_PARMS)
    653653    {
    654         static int s_cRelWarn;
    655         if (s_cRelWarn < 50)
    656         {
    657             s_cRelWarn++;
    658             LogRel(("VMMDev: request packet with too many parameters (%d). Refusing operation.\n", cParms));
    659         }
     654        LogRelMax(50, ("VMMDev: request packet with too many parameters (%d). Refusing operation.\n", cParms));
    660655        return VERR_INVALID_PARAMETER;
    661656    }
     
    12011196    if (cParms > VMMDEV_MAX_HGCM_PARMS)
    12021197    {
    1203         static int s_cRelWarn;
    1204         if (s_cRelWarn < 50)
    1205         {
    1206             s_cRelWarn++;
    1207             LogRel(("VMMDev: request packet with too many parameters (%d). Refusing operation.\n", cParms));
    1208         }
     1198        LogRelMax(50, ("VMMDev: request packet with too many parameters (%d). Refusing operation.\n", cParms));
    12091199        return VERR_INVALID_PARAMETER;
    12101200    }
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