Changeset 37591 in vbox for trunk/src/VBox/VMM/VMMR3/VMM.cpp
- Timestamp:
- Jun 22, 2011 3:58:22 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r37452 r37591 339 339 { 340 340 int rc; 341 #define RTLogCalcSizeForR0(cGroups, fFlags) (RT_OFFSETOF(VMMR0LOGGER, Logger.afGroups[cGroups]) + PAGE_SIZE) 341 342 342 343 /* … … 354 355 355 356 # ifdef VBOX_WITH_R0_LOGGING 357 size_t const cbLogger = RTLogCalcSizeForR0(pLogger->cGroups, 0); 356 358 for (VMCPUID i = 0; i < pVM->cCpus; i++) 357 359 { 358 360 PVMCPU pVCpu = &pVM->aCpus[i]; 359 360 rc = MMR3HyperAllocOnceNoRelEx(pVM, RT_OFFSETOF(VMMR0LOGGER, Logger.afGroups[pLogger->cGroups]), 361 0, MM_TAG_VMM, MMHYPER_AONR_FLAGS_KERNEL_MAPPING, 361 rc = MMR3HyperAllocOnceNoRelEx(pVM, cbLogger, PAGE_SIZE, MM_TAG_VMM, MMHYPER_AONR_FLAGS_KERNEL_MAPPING, 362 362 (void **)&pVCpu->vmm.s.pR0LoggerR3); 363 363 if (RT_FAILURE(rc)) 364 364 return rc; 365 pVCpu->vmm.s.pR0LoggerR3->pVM = pVM->pVMR0;365 pVCpu->vmm.s.pR0LoggerR3->pVM = pVM->pVMR0; 366 366 //pVCpu->vmm.s.pR0LoggerR3->fCreated = false; 367 pVCpu->vmm.s.pR0LoggerR3->cbLogger = RT_OFFSETOF(RTLOGGER, afGroups[pLogger->cGroups]);367 pVCpu->vmm.s.pR0LoggerR3->cbLogger = cbLogger; 368 368 pVCpu->vmm.s.pR0LoggerR0 = MMHyperR3ToR0(pVM, pVCpu->vmm.s.pR0LoggerR3); 369 369 } … … 861 861 pVM->vmm.s.pRCLoggerRC = MMHyperR3ToRC(pVM, pVM->vmm.s.pRCLoggerR3); 862 862 rc = RTLogCloneRC(NULL /* default */, pVM->vmm.s.pRCLoggerR3, pVM->vmm.s.cbRCLogger, 863 RCPtrLoggerWrapper, 863 RCPtrLoggerWrapper, RCPtrLoggerFlush, RTLOGFLAGS_BUFFERED); 864 864 AssertReleaseMsgRC(rc, ("RTLogCloneRC failed! rc=%Rra\n", rc)); 865 865 } … … 874 874 pVM->vmm.s.pRCRelLoggerRC = MMHyperR3ToRC(pVM, pVM->vmm.s.pRCRelLoggerR3); 875 875 rc = RTLogCloneRC(RTLogRelDefaultInstance(), pVM->vmm.s.pRCRelLoggerR3, pVM->vmm.s.cbRCRelLogger, 876 RCPtrLoggerWrapper, 876 RCPtrLoggerWrapper, RCPtrLoggerFlush, RTLOGFLAGS_BUFFERED); 877 877 AssertReleaseMsgRC(rc, ("RTLogCloneRC failed! rc=%Rra\n", rc)); 878 878 } … … 884 884 * in ring-0. Only initialize it once. 885 885 */ 886 PRTLOGGER const pDefault = RTLogRelDefaultInstance(); 886 887 for (VMCPUID i = 0; i < pVM->cCpus; i++) 887 888 { … … 900 901 AssertReleaseMsgRCReturn(rc, ("vmmR0LoggerFlush not found! rc=%Rra\n", rc), rc); 901 902 902 rc = RTLogCreateForR0(&pR0LoggerR3->Logger, pR0LoggerR3->cbLogger, 903 *(PFNRTLOGGER *)&pfnLoggerWrapper, *(PFNRTLOGFLUSH *)&pfnLoggerFlush,903 rc = RTLogCreateForR0(&pR0LoggerR3->Logger, pR0LoggerR3->cbLogger, pVCpu->vmm.s.pR0LoggerR0, 904 pfnLoggerWrapper, pfnLoggerFlush, 904 905 RTLOGFLAGS_BUFFERED, RTLOGDEST_DUMMY); 905 906 AssertReleaseMsgRCReturn(rc, ("RTLogCreateForR0 failed! rc=%Rra\n", rc), rc); … … 908 909 rc = PDMR3LdrGetSymbolR0(pVM, VMMR0_MAIN_MODULE_NAME, "vmmR0LoggerPrefix", &pfnLoggerPrefix); 909 910 AssertReleaseMsgRCReturn(rc, ("vmmR0LoggerPrefix not found! rc=%Rra\n", rc), rc); 910 rc = RTLogSetCustomPrefixCallback (&pR0LoggerR3->Logger, *(PFNRTLOGPREFIX *)&pfnLoggerPrefix, NULL);911 rc = RTLogSetCustomPrefixCallbackForR0(&pR0LoggerR3->Logger, pVCpu->vmm.s.pR0LoggerR0, pfnLoggerPrefix, NULL); 911 912 AssertReleaseMsgRCReturn(rc, ("RTLogSetCustomPrefixCallback failed! rc=%Rra\n", rc), rc); 912 913 … … 917 918 } 918 919 919 rc = RTLogCopyGroupsAndFlags(&pR0LoggerR3->Logger, NULL /* default */, pVM->vmm.s.pRCLoggerR3->fFlags, RTLOGFLAGS_BUFFERED); 920 rc = RTLogCopyGroupsAndFlagsForR0(&pR0LoggerR3->Logger, pVCpu->vmm.s.pR0LoggerR0, pDefault, 921 UINT32_MAX, RTLOGFLAGS_BUFFERED); 920 922 AssertRC(rc); 921 923 }
Note:
See TracChangeset
for help on using the changeset viewer.