VirtualBox

Changeset 90862 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 25, 2021 12:37:59 AM (3 years ago)
Author:
vboxsync
Message:

IPRT,SUPDrv,VMM,++: Bumped major support driver version. Added RTLogSetR0ProgramStart and make the VMM use it when configuring the ring-0 loggers. Removed pfnFlush from the parameter list of RTLogCreateEx[V]. bugref:10086

Location:
trunk/src/VBox
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp

    r90829 r90862  
    578578                           RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG | RTLOGFLAGS_USECRLF,
    579579                           s_szGroupSettings, RT_ELEMENTS(s_apszGroups), s_apszGroups, UINT32_MAX,
    580                            NULL /*pfnFlush*/, 0 /*cBufDescs*/, NULL /*paBufDescs*/, RTLOGDEST_STDOUT,
     580                           0 /*cBufDescs*/, NULL /*paBufDescs*/, RTLOGDEST_STDOUT,
    581581                           vboxTrayLogHeaderFooter, g_cHistory, g_uHistoryFileSize, g_uHistoryFileTime,
    582582                           RTErrInfoInitStatic(&ErrInfo), NULL /*pszFilenameFmt*/);
  • trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp

    r90829 r90862  
    316316    int rc = RTLogCreateEx(&g_pLoggerRelease, "VBOXSERVICE_RELEASE_LOG", fFlags, "all",
    317317                           RT_ELEMENTS(s_apszGroups), s_apszGroups, UINT32_MAX /*cMaxEntriesPerGroup*/,
    318                            NULL /*pfnFlush*/, 0 /*cBufDescs*/, NULL /*paBufDescs*/, RTLOGDEST_STDOUT | RTLOGDEST_USER,
     318                           0 /*cBufDescs*/, NULL /*paBufDescs*/, RTLOGDEST_STDOUT | RTLOGDEST_USER,
    319319                           vgsvcLogHeaderFooter, g_cHistory, g_uHistoryFileSize, g_uHistoryFileTime,
    320320                           NULL /*pErrInfo*/, "%s", pszLogFile ? pszLogFile : "");
  • trunk/src/VBox/Additions/darwin/VBoxClient/VBoxClient.cpp

    r90829 r90862  
    6161    int rc = RTLogCreateEx(&g_pLogger, "VBOXCLIENT_RELEASE_LOG", RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG, "all",
    6262                           RT_ELEMENTS(s_apszGroups), s_apszGroups, UINT32_MAX /*cMaxEntriesPerGroup*/,
    63                            NULL /*pfnFlush*/, 0 /*cBufDescs*/, NULL /*paBufDescs*/, RTLOGDEST_STDOUT,
     63                           0 /*cBufDescs*/, NULL /*paBufDescs*/, RTLOGDEST_STDOUT,
    6464                           NULL /*pfnPhase*/,
    6565                           pszLogFileName ? 10 : 0 /*cHistory*/,
  • trunk/src/VBox/Additions/linux/lightdm-greeter/vbox-greeter.cpp

    r90829 r90862  
    937937    int rc = RTLogCreateEx(&g_pLoggerRelease, "VBOXGREETER_RELEASE_LOG", fFlags, "all",
    938938                           RT_ELEMENTS(s_apszGroups), s_apszGroups, UINT32_MAX /*cMaxEntriesPerGroup*/,
    939                            NULL /*pfnFlush*/, 0 /*cBufDescs*/, NULL /*paBufDescs*/, RTLOGDEST_STDOUT,
     939                           0 /*cBufDescs*/, NULL /*paBufDescs*/, RTLOGDEST_STDOUT,
    940940                           vboxGreeterLogHeaderFooter, g_cHistory, g_uHistoryFileSize, g_uHistoryFileTime,
    941941                           NULL /*pErrInfo*/, pszLogFile);
  • trunk/src/VBox/Additions/x11/VBoxClient/logging.cpp

    r90829 r90862  
    265265    int rc = RTLogCreateEx(&g_pLoggerRelease, "VBOXCLIENT_RELEASE_LOG", fFlags, "all",
    266266                           RT_ELEMENTS(s_apszGroups), s_apszGroups, UINT32_MAX /*cMaxEntriesPerGroup*/,
    267                            NULL /*pfnFlush*/, 0 /*cBufDescs*/, NULL /*paBufDescs*/, RTLOGDEST_STDOUT | RTLOGDEST_USER,
     267                           0 /*cBufDescs*/, NULL /*paBufDescs*/, RTLOGDEST_STDOUT | RTLOGDEST_USER,
    268268                           vbClLogHeaderFooter, g_cHistory, g_uHistoryFileSize, g_uHistoryFileTime,
    269269                           NULL /*pErrInfo*/, "%s", pszLogFile ? pszLogFile : "");
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp

    r90859 r90862  
    301301    { "RTLogSetDefaultInstanceThread",          (void *)(uintptr_t)RTLogSetDefaultInstanceThread },
    302302    { "RTLogSetFlushCallback",                  (void *)(uintptr_t)RTLogSetFlushCallback },
     303    { "RTLogSetR0ProgramStart",                 (void *)(uintptr_t)RTLogSetR0ProgramStart },
    303304    { "RTLogSetR0ThreadNameF",                  (void *)(uintptr_t)RTLogSetR0ThreadNameF },
    304305    { "RTMemAllocExTag",                        (void *)(uintptr_t)RTMemAllocExTag },
     
    54635464
    54645465        case SUPLDRLOADEP_VMMR0:
    5465             if (pReq->u.In.EP.VMMR0.pvVMMR0 != pImage->pvImage)
    5466             {
    5467                 supdrvLdrUnlock(pDevExt);
    5468                 return supdrvLdrLoadError(VERR_INVALID_PARAMETER, pReq, "Invalid pvVMMR0 pointer: %p, expected %p", pReq->u.In.EP.VMMR0.pvVMMR0, pImage->pvImage);
    5469             }
    54705466            rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.EP.VMMR0.pvVMMR0EntryFast, false, pReq->u.In.abImage, "VMMR0EntryFast", pReq);
    54715467            if (RT_FAILURE(rc))
  • trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h

    r90859 r90862  
    223223 *          - Remove pvVMMR0 from SUPLDRLOAD.
    224224 */
    225 #define SUPDRV_IOC_VERSION                              0x00300005
     225#define SUPDRV_IOC_VERSION                              0x00310000
    226226
    227227/** SUP_IOCTL_COOKIE. */
     
    446446                struct
    447447                {
    448                     /** The module handle (i.e. address). */
    449                     RTR0PTR                 pvVMMR0;
    450448                    /** Address of VMMR0EntryFast function. */
    451449                    RTR0PTR                 pvVMMR0EntryFast;
  • trunk/src/VBox/HostDrivers/Support/SUPLibLdr.cpp

    r88377 r90862  
    635635    {
    636636        pLoadReq->u.In.eEPType                = SUPLDRLOADEP_VMMR0;
    637         pLoadReq->u.In.EP.VMMR0.pvVMMR0       = uImageBase;
    638         pLoadReq->u.In.EP.VMMR0.pvVMMR0EntryFast= (RTR0PTR)VMMR0EntryFast;
    639         pLoadReq->u.In.EP.VMMR0.pvVMMR0EntryEx  = (RTR0PTR)VMMR0EntryEx;
     637        pLoadReq->u.In.EP.VMMR0.pvVMMR0EntryFast = (RTR0PTR)VMMR0EntryFast;
     638        pLoadReq->u.In.EP.VMMR0.pvVMMR0EntryEx   = (RTR0PTR)VMMR0EntryEx;
    640639    }
    641640    else if (pszSrvReqHandler)
    642641    {
    643642        pLoadReq->u.In.eEPType                = SUPLDRLOADEP_SERVICE;
    644         pLoadReq->u.In.EP.Service.pfnServiceReq = (RTR0PTR)SrvReqHandler;
     643        pLoadReq->u.In.EP.Service.pfnServiceReq  = (RTR0PTR)SrvReqHandler;
    645644        pLoadReq->u.In.EP.Service.apvReserved[0] = NIL_RTR0PTR;
    646645        pLoadReq->u.In.EP.Service.apvReserved[1] = NIL_RTR0PTR;
  • trunk/src/VBox/Main/glue/VBoxLogRelCreate.cpp

    r90829 r90862  
    170170    g_pszLogEntity = pcszEntity;
    171171    int vrc = RTLogCreateEx(&pReleaseLogger, pcszEnvVarBase, fFlags, pcszGroupSettings, RT_ELEMENTS(s_apszGroups), s_apszGroups,
    172                             cMaxEntriesPerGroup,  NULL /*pfnFlush*/, 0 /*cBufDescs*/, NULL /*paBufDescs*/, fDestFlags,
     172                            cMaxEntriesPerGroup, 0 /*cBufDescs*/, NULL /*paBufDescs*/, fDestFlags,
    173173                            vboxHeaderFooter, cHistory, uHistoryFileSize, uHistoryFileTime,
    174174                            pErrInfo, pcszLogFile ? "%s" : NULL, pcszLogFile);
  • trunk/src/VBox/Main/src-helper-apps/OpenGLTest/OpenGLTestApp.cpp

    r90829 r90862  
    298298
    299299    int vrc = RTLogCreateEx(&loggerRelease, "VBOX_RELEASE_LOG", fFlags, "all", RT_ELEMENTS(s_apszGroups), s_apszGroups, UINT32_MAX,
    300                             NULL /*pfnFlush*/, 0 /*cBufDescs*/, NULL /*paBufDescs*/, enmLogDest,
     300                            0 /*cBufDescs*/, NULL /*paBufDescs*/, enmLogDest,
    301301                            NULL /*pfnBeginEnd*/, 0 /*cHistory*/, 0 /*cbHistoryFileMax*/, 0 /*uHistoryTimeMax*/,
    302302                            NULL /*pErrInfo*/, pszFilenameFmt, pszFilename, RTTimeMilliTS());
  • trunk/src/VBox/Runtime/common/log/log.cpp

    r90861 r90862  
    10091009RTDECL(int) RTLogCreateExV(PRTLOGGER *ppLogger, const char *pszEnvVarBase, uint64_t fFlags, const char *pszGroupSettings,
    10101010                           uint32_t cGroups, const char * const *papszGroups, uint32_t cMaxEntriesPerGroup,
    1011                            PFNRTLOGFLUSH pfnFlush, uint32_t cBufDescs, PRTLOGBUFFERDESC paBufDescs, uint32_t fDestFlags,
     1011                           uint32_t cBufDescs, PRTLOGBUFFERDESC paBufDescs, uint32_t fDestFlags,
    10121012                           PFNRTLOGPHASE pfnPhase, uint32_t cHistory, uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot,
    10131013                           PRTERRINFO pErrInfo, const char *pszFilenameFmt, va_list args)
     
    10951095        pLoggerInt->cbSelf                      = sizeof(RTLOGGERINTERNAL);
    10961096        pLoggerInt->hSpinMtx                    = NIL_RTSEMSPINMUTEX;
    1097         pLoggerInt->pfnFlush                    = pfnFlush;
     1097        pLoggerInt->pfnFlush                    = NULL;
    10981098        pLoggerInt->pfnPrefix                   = NULL;
    10991099        pLoggerInt->pvPrefixUserArg             = NULL;
     
    13451345    rc = RTLogCreateExV(ppLogger, pszEnvVarBase, fFlags, pszGroupSettings, cGroups, papszGroups,
    13461346                        UINT32_MAX /*cMaxEntriesPerGroup*/,
    1347                         NULL /*pfnFlush*/, 0 /*cBufDescs*/, NULL /*paBufDescs*/, fDestFlags,
     1347                        0 /*cBufDescs*/, NULL /*paBufDescs*/, fDestFlags,
    13481348                        NULL /*pfnPhase*/, 0 /*cHistory*/, 0 /*cbHistoryFileMax*/, 0 /*cSecsHistoryTimeSlot*/,
    13491349                        NULL /*pErrInfo*/, pszFilenameFmt, va);
     
    13561356RTDECL(int) RTLogCreateEx(PRTLOGGER *ppLogger, const char *pszEnvVarBase, uint64_t fFlags, const char *pszGroupSettings,
    13571357                          unsigned cGroups, const char * const *papszGroups, uint32_t cMaxEntriesPerGroup,
    1358                           PFNRTLOGFLUSH pfnFlush, uint32_t cBufDescs, PRTLOGBUFFERDESC paBufDescs, uint32_t fDestFlags,
     1358                          uint32_t cBufDescs, PRTLOGBUFFERDESC paBufDescs, uint32_t fDestFlags,
    13591359                          PFNRTLOGPHASE pfnPhase, uint32_t cHistory, uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot,
    13601360                          PRTERRINFO pErrInfo, const char *pszFilenameFmt, ...)
     
    13651365    va_start(va, pszFilenameFmt);
    13661366    rc = RTLogCreateExV(ppLogger, pszEnvVarBase, fFlags, pszGroupSettings, cGroups, papszGroups, cMaxEntriesPerGroup,
    1367                         pfnFlush, cBufDescs, paBufDescs, fDestFlags,
     1367                        cBufDescs, paBufDescs, fDestFlags,
    13681368                        pfnPhase, cHistory, cbHistoryFileMax, cSecsHistoryTimeSlot,
    13691369                        pErrInfo, pszFilenameFmt, va);
     
    20542054
    20552055#ifdef IN_RING0
     2056
    20562057RTR0DECL(int) RTLogSetR0ThreadNameF(PRTLOGGER pLogger, const char *pszNameFmt, ...)
    20572058{
     
    20782079}
    20792080RT_EXPORT_SYMBOL(RTLogSetR0ThreadNameF);
     2081
     2082
     2083RTR0DECL(int) RTLogSetR0ProgramStart(PRTLOGGER pLogger, uint64_t nsStart)
     2084{
     2085    PRTLOGGERINTERNAL pLoggerInt = (PRTLOGGERINTERNAL)pLogger;
     2086    int               rc;
     2087    if (pLoggerInt)
     2088    {
     2089        rc = rtlogLock(pLoggerInt);
     2090        if (RT_SUCCESS(rc))
     2091        {
     2092            pLoggerInt->nsR0ProgramStart = nsStart;
     2093            rtlogUnlock(pLoggerInt);
     2094        }
     2095    }
     2096    else
     2097        rc = VERR_INVALID_PARAMETER;
     2098    return rc;
     2099}
     2100RT_EXPORT_SYMBOL(RTLogSetR0ProgramStart);
     2101
    20802102#endif /* IN_RING0 */
    2081 
    20822103
    20832104/**
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r90859 r90862  
    392392 */
    393393static int vmmR0InitLoggerOne(PGVMCPU pGVCpu, bool fRelease, PVMMR0PERVCPULOGGER pR0Log, PVMMR3CPULOGGER pShared,
    394                               uint32_t cbBuf, char *pchBuf, RTR3PTR pchBufR3)
     394                              uint32_t cbBuf, char *pchBuf, RTR3PTR pchBufR3, uint64_t nsProgramStart)
    395395{
    396396    pR0Log->BufDesc.u32Magic    = RTLOGBUFFERDESC_MAGIC;
     
    412412    int rc = RTLogCreateEx(&pR0Log->pLogger, fRelease ? "VBOX_RELEASE_LOG" : "VBOX_LOG", RTLOG_F_NO_LOCKING | RTLOGFLAGS_BUFFERED,
    413413                           "all", RT_ELEMENTS(s_apszGroups), s_apszGroups, UINT32_MAX,
    414                            fRelease ? vmmR0LogRelFlush : vmmR0LogFlush, 1 /*cBufDescs*/, &pR0Log->BufDesc,
    415                            RTLOGDEST_DUMMY,
     414                           1 /*cBufDescs*/, &pR0Log->BufDesc, RTLOGDEST_DUMMY,
    416415                           NULL /*pfnPhase*/, 0 /*cHistory*/, 0 /*cbHistoryFileMax*/, 0 /*cSecsHistoryTimeSlot*/,
    417416                           NULL /*pErrInfo*/, NULL /*pszFilenameFmt*/);
     
    423422        pLogger->u64UserValue3 = (uintptr_t)pGVCpu;
    424423
    425         RTLogSetR0ThreadNameF(pLogger, "EMT-%u-R0", pGVCpu->idCpu);
    426     }
    427     else
    428         pR0Log->pLogger = NULL;
     424        rc = RTLogSetFlushCallback(pLogger, fRelease ? vmmR0LogRelFlush : vmmR0LogFlush);
     425        if (RT_SUCCESS(rc))
     426        {
     427            RTLogSetR0ThreadNameF(pLogger, "EMT-%u-R0", pGVCpu->idCpu);
     428            RTLogSetR0ProgramStart(pLogger, nsProgramStart);
     429            return VINF_SUCCESS;
     430        }
     431
     432        RTLogDestroy(pLogger);
     433    }
     434    pR0Log->pLogger = NULL;
    429435    return rc;
    430436}
     
    455461                PVMMR0PERVCPULOGGER pR0Log  = fRelease ? &pGVCpu->vmmr0.s.RelLogger : &pGVCpu->vmmr0.s.Logger;
    456462                PVMMR3CPULOGGER     pShared = fRelease ? &pGVCpu->vmm.s.RelLogger   : &pGVCpu->vmm.s.Logger;
    457                 rc = vmmR0InitLoggerOne(pGVCpu, fRelease, pR0Log, pShared, cbBuf, pchBuf + i * cbBuf, pchBufR3 + i * cbBuf);
     463                rc = vmmR0InitLoggerOne(pGVCpu, fRelease, pR0Log, pShared, cbBuf, pchBuf + i * cbBuf, pchBufR3 + i * cbBuf,
     464                                        pGVM->vmm.s.nsProgramStart);
    458465                if (RT_FAILURE(rc))
    459466                {
  • trunk/src/VBox/VMM/VMMR3/VMM.cpp

    r90840 r90862  
    207207    pVM->vmm.s.hEvtRendezvousRecursionPushCaller = NIL_RTSEMEVENT;
    208208    pVM->vmm.s.hEvtRendezvousRecursionPopCaller = NIL_RTSEMEVENT;
     209    pVM->vmm.s.nsProgramStart                   = RTTimeProgramStartNanoTS();
    209210
    210211#if 0 /* pointless when timers doesn't run on EMT */
  • trunk/src/VBox/VMM/include/VMMInternal.h

    r90836 r90862  
    285285    /** Buffer for storing the custom message for a ring-0 assertion. */
    286286    char                        szRing0AssertMsg2[256];
     287
     288    /** Used when setting up ring-0 logger. */
     289    uint64_t                    nsProgramStart;
    287290
    288291    /** Number of VMMR0_DO_HM_RUN or VMMR0_DO_NEM_RUN calls. */
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