VirtualBox

Changeset 37818 in vbox for trunk/src/VBox/VMM/VMMR3/VMM.cpp


Ignore:
Timestamp:
Jul 7, 2011 1:25:03 PM (13 years ago)
Author:
vboxsync
Message:

Fix logging from R0

File:
1 edited

Legend:

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

    r37699 r37818  
    884884     * in ring-0. Only initialize it once.
    885885     */
    886     PRTLOGGER const pDefault = RTLogRelDefaultInstance();
     886    PRTLOGGER const pDefault = RTLogDefaultInstance();
    887887    for (VMCPUID i = 0; i < pVM->cCpus; i++)
    888888    {
     
    901901                AssertReleaseMsgRCReturn(rc, ("vmmR0LoggerFlush not found! rc=%Rra\n", rc), rc);
    902902
    903                 rc = RTLogCreateForR0(&pR0LoggerR3->Logger, pR0LoggerR3->cbLogger, pVCpu->vmm.s.pR0LoggerR0,
     903                rc = RTLogCreateForR0(&pR0LoggerR3->Logger, pR0LoggerR3->cbLogger, pVCpu->vmm.s.pR0LoggerR0 + RT_OFFSETOF(VMMR0LOGGER, Logger),
    904904                                      pfnLoggerWrapper, pfnLoggerFlush,
    905905                                      RTLOGFLAGS_BUFFERED, RTLOGDEST_DUMMY);
     
    909909                rc = PDMR3LdrGetSymbolR0(pVM, VMMR0_MAIN_MODULE_NAME, "vmmR0LoggerPrefix", &pfnLoggerPrefix);
    910910                AssertReleaseMsgRCReturn(rc, ("vmmR0LoggerPrefix not found! rc=%Rra\n", rc), rc);
    911                 rc = RTLogSetCustomPrefixCallbackForR0(&pR0LoggerR3->Logger, pVCpu->vmm.s.pR0LoggerR0, pfnLoggerPrefix, NIL_RTR0PTR);
     911                rc = RTLogSetCustomPrefixCallbackForR0(&pR0LoggerR3->Logger, pVCpu->vmm.s.pR0LoggerR0 + RT_OFFSETOF(VMMR0LOGGER, Logger), pfnLoggerPrefix, NIL_RTR0PTR);
    912912                AssertReleaseMsgRCReturn(rc, ("RTLogSetCustomPrefixCallback failed! rc=%Rra\n", rc), rc);
    913913
     
    918918            }
    919919
    920             rc = RTLogCopyGroupsAndFlagsForR0(&pR0LoggerR3->Logger, pVCpu->vmm.s.pR0LoggerR0, pDefault,
    921                                               UINT32_MAX, RTLOGFLAGS_BUFFERED);
     920            rc = RTLogCopyGroupsAndFlagsForR0(&pR0LoggerR3->Logger, pVCpu->vmm.s.pR0LoggerR0 + RT_OFFSETOF(VMMR0LOGGER, Logger), pDefault,
     921                                              RTLOGFLAGS_BUFFERED, UINT32_MAX);
    922922            AssertRC(rc);
    923923        }
     
    12931293        if (    pR0LoggerR3
    12941294            &&  pR0LoggerR3->Logger.offScratch > 0)
    1295             RTLogFlushToLogger(&pR0LoggerR3->Logger, NULL);
     1295            RTLogFlushR0(NULL, &pR0LoggerR3->Logger);
    12961296#endif /* !LOG_ENABLED */
    12971297        if (rc != VINF_VMM_CALL_HOST)
     
    19801980        if (    pVCpu->vmm.s.pR0LoggerR3
    19811981            &&  pVCpu->vmm.s.pR0LoggerR3->Logger.offScratch > 0)
    1982             RTLogFlushToLogger(&pVCpu->vmm.s.pR0LoggerR3->Logger, NULL);
     1982            RTLogFlushR0(NULL, &pVCpu->vmm.s.pR0LoggerR3->Logger);
    19831983#endif
    19841984        if (rc != VINF_VMM_CALL_HOST)
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