VirtualBox

Changeset 7602 in vbox


Ignore:
Timestamp:
Mar 27, 2008 5:25:37 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
29102
Message:

Runtime: switch guest R3 logging from backdoor to normal (with RTLOGDEST_USER), except for the mini runtime. Remove LOG_TO_BACKDOOR_FULL.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r7571 r7602  
    26852685TEMPLATE_VBOXGUESTR3EXE_BLD_TRG_ARCH  = x86
    26862686TEMPLATE_VBOXGUESTR3EXE_BLD_TRG_CPU   = blend
    2687 TEMPLATE_VBOXGUESTR3EXE_DEFS     := IN_GUEST IN_GUEST_R3 IN_RT_R3 LOG_TO_BACKDOOR_FULL \
    2688                                     $(filter-out $(ARCH_BITS_DEFS),$(TEMPLATE_VBOXR3EXE_DEFS)) HC_ARCH_BITS=32 GC_ARCH_BITS=32
     2687TEMPLATE_VBOXGUESTR3EXE_DEFS     := IN_GUEST IN_GUEST_R3 IN_RT_R3 \
     2688                                    $(filter-out $(ARCH_BITS_DEFS),$(TEMPLATE_VBOXR3EXE_DEFS)) \
     2689                                    HC_ARCH_BITS=32 GC_ARCH_BITS=32
    26892690if1of ($(BUILD_TARGET),l4 linux) # As few libs as possible on linux.
    26902691 TEMPLATE_VBOXGUESTR3EXE_LIBS     = pthread rt m
     
    27452746TEMPLATE_VBOXGUESTR3XF86MOD_LIBS     = \
    27462747        $(VBOX_LIB_VBGL_R3_XFREE86)
     2748TEMPLATE_VBOXGUESTR3XF86MOD_DEFS     = $(TEMPLATE_VBOXGUESTR3DLL_DEFS) LOG_TO_BACKDOOR
    27472749
    27482750
     
    27572759TEMPLATE_VBOXGUESTR3XORGMOD_LIBS.linux              = $(NO_SUCH_VARIABLE)
    27582760TEMPLATE_VBOXGUESTR3XORGMOD_CFLAGS                  = $(TEMPLATE_VBOXGUESTR3DLL_CFLAGS) -std=c99
     2761TEMPLATE_VBOXGUESTR3XORGMOD_DEFS = $(TEMPLATE_VBOXGUESTR3DLL_DEFS) LOG_TO_BACKDOOR
    27592762if1of ($(BUILD_TARGET), linux l4)
    27602763 TEMPLATE_VBOXGUESTR3XORGMOD_LDFLAGS = $(TEMPLATE_VBOXGUESTR3DLL_LDFLAGS) -s
  • trunk/include/iprt/log.h

    r7448 r7602  
    400400#endif
    401401
    402 /*
    403  * If we are doing full backdoor logging disable the weaker form
    404  */
    405 #if defined(LOG_TO_BACKDOOR_FULL)
    406 # undef LOG_TO_BACKDOOR
    407 #endif
    408402
    409403/** @def LogIt
     
    411405 */
    412406#ifdef LOG_ENABLED
    413 # if !defined(LOG_TO_BACKDOOR_FULL) || defined(LOG_NO_BACKDOOR)
    414 #  if defined(RT_ARCH_AMD64) || defined(LOG_USE_C99)
    415 #   define _LogRemoveParentheseis(...)               __VA_ARGS__
    416 #   define _LogIt(pvInst, fFlags, iGroup, ...)       RTLogLoggerEx((PRTLOGGER)pvInst, fFlags, iGroup, __VA_ARGS__)
    417 #   define LogIt(pvInst, fFlags, iGroup, fmtargs)    _LogIt(pvInst, fFlags, iGroup, _LogRemoveParentheseis fmtargs)
    418 #  else
    419 #   define LogIt(pvInst, fFlags, iGroup, fmtargs) \
     407# if defined(RT_ARCH_AMD64) || defined(LOG_USE_C99)
     408#  define _LogRemoveParentheseis(...)               __VA_ARGS__
     409#  define _LogIt(pvInst, fFlags, iGroup, ...)       RTLogLoggerEx((PRTLOGGER)pvInst, fFlags, iGroup, __VA_ARGS__)
     410#  define LogIt(pvInst, fFlags, iGroup, fmtargs)    _LogIt(pvInst, fFlags, iGroup, _LogRemoveParentheseis fmtargs)
     411# else
     412#  define LogIt(pvInst, fFlags, iGroup, fmtargs) \
    420413    do \
    421414    { \
     
    428421        } \
    429422    } while (0)
    430 #  endif
    431 # else  /* LOG_TO_BACKDOOR_FULL defined */
    432 #  define LogIt(pvInst, fFlags, iGroup, fmtargs) \
    433     do \
    434     { \
    435         register PRTLOGGER LogIt_pLogger = (PRTLOGGER)(pvInst) ? (PRTLOGGER)(pvInst) : RTLogDefaultInstance(); \
    436         if (LogIt_pLogger) \
    437         { \
    438             register unsigned LogIt_fFlags = LogIt_pLogger->afGroups[(unsigned)(iGroup) < LogIt_pLogger->cGroups ? (unsigned)(iGroup) : 0]; \
    439             if ((LogIt_fFlags & ((fFlags) | RTLOGGRPFLAGS_ENABLED)) == ((fFlags) | RTLOGGRPFLAGS_ENABLED)) \
    440                 RTLogBackdoorPrintf fmtargs; \
    441         } \
    442     } while (0)
    443 # endif  /* LOG_TO_BACKDOOR_FULL defined */
     423# endif
    444424#else
    445425# define LogIt(pvInst, fFlags, iGroup, fmtargs) do { } while (0)
     
    728708 * Write to specific logger if group enabled.
    729709 */
    730 #if !defined(LOG_TO_BACKDOOR_FULL) || defined(LOG_NO_BACKDOOR)
    731 # if defined(RT_ARCH_AMD64) || defined(LOG_USE_C99)
    732 #  define _LogRelRemoveParentheseis(...)                __VA_ARGS__
    733 #   define _LogRelIt(pvInst, fFlags, iGroup, ...)       RTLogLoggerEx((PRTLOGGER)pvInst, fFlags, iGroup, __VA_ARGS__)
    734 #   define LogRelIt(pvInst, fFlags, iGroup, fmtargs) \
     710#if defined(RT_ARCH_AMD64) || defined(LOG_USE_C99)
     711# define _LogRelRemoveParentheseis(...)                __VA_ARGS__
     712#  define _LogRelIt(pvInst, fFlags, iGroup, ...)       RTLogLoggerEx((PRTLOGGER)pvInst, fFlags, iGroup, __VA_ARGS__)
     713#  define LogRelIt(pvInst, fFlags, iGroup, fmtargs) \
    735714    do \
    736715    { \
     
    740719        LogIt(LOG_INSTANCE, fFlags, iGroup, fmtargs); \
    741720    } while (0)
    742 # else
    743 #  define LogRelIt(pvInst, fFlags, iGroup, fmtargs) \
     721#else
     722# define LogRelIt(pvInst, fFlags, iGroup, fmtargs) \
    744723   do \
    745724   { \
     
    753732       LogIt(LOG_INSTANCE, fFlags, iGroup, fmtargs); \
    754733  } while (0)
    755 # endif
    756 #else /* LOG_TO_BACKDOOR_FULL defined and LOG_NO_BACKDOOR not defined */
    757 # define LogRelIt(pvInst, fFlags, iGroup, fmtargs) \
    758    do { \
    759        RTLogBackdoorPrintf fmtargs; \
    760    } while (0)
    761 #endif /* LOG_TO_BACKDOOR_FULL defined and LOG_NO_BACKDOOR not defined */
     734#endif
    762735
    763736
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp

    r7539 r7602  
    3838#include <iprt/thread.h>
    3939#include <VBox/VBoxGuest.h>
     40#include <VBox/log.h>
    4041#include "VBGLR3Internal.h"
    4142
     
    162163#endif
    163164
     165    /* Create release logger */
     166    PRTLOGGER loggerRelease;
     167    static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES;
     168    int rrc = RTLogCreate(&loggerRelease, 0, NULL, "VBOXGUEST_RELEASE_LOG",
     169                         RT_ELEMENTS(s_apszGroups), &s_apszGroups[0],
     170                         RTLOGDEST_USER, "VBox.log");
     171    /* This may legitimately fail if we are using the mini-runtime. */
     172    if (RT_SUCCESS(rrc))
     173        RTLogRelSetDefaultInstance(loggerRelease);
     174
    164175    return VINF_SUCCESS;
    165176}
  • trunk/src/VBox/Runtime/VBox/log-vbox.cpp

    r7169 r7602  
    284284    PRTLOGGER pLogger;
    285285#ifdef IN_RING3
    286 # ifndef LOG_TO_BACKDOOR
     286# ifndef IN_GUEST_R3
    287287    char szExecName[RTPATH_MAX];
    288288    if (!RTProcGetExecutableName(szExecName, sizeof(szExecName)))
     
    369369    }
    370370
    371 # else  /* LOG_TO_BACKDOOR */
     371# else  /* IN_GUEST_R3 */
    372372    /* The user destination is backdoor logging. */
    373373    int rc = RTLogCreate(&pLogger, 0, NULL, "VBOX_LOG",
    374374                         RT_ELEMENTS(g_apszGroups), &g_apszGroups[0],
    375375                         RTLOGDEST_USER, "VBox.log");
    376 # endif /* LOG_TO_BACKDOOR */
     376# endif /* IN_GUEST_R3 */
    377377
    378378#else /* IN_RING0 */
    379379    int rc = RTLogCreate(&pLogger, 0, NULL, "VBOX_LOG", RT_ELEMENTS(g_apszGroups), &g_apszGroups[0],
    380 # ifdef LOG_TO_BACKDOOR
     380# ifdef LOG_TO_BACKDOOR  /** @todo look at guest ring 0 logging */
    381381                         RTLOGDEST_USER,
    382382# else
  • trunk/src/VBox/Runtime/VBox/logbackdoor-redirect.cpp

    r6551 r7602  
    3131*******************************************************************************/
    3232#include <VBox/log.h>
     33#include <VBox/err.h>
    3334
    3435
     
    4748}
    4849
     50/* All logging goes to the backdoor logger anyway. */
     51RTDECL(PRTLOGGER) RTLogRelSetDefaultInstance(PRTLOGGER pLogger)
     52{
     53    return NULL;
     54}
    4955
    5056RTDECL(void) RTLogRelPrintf(const char *pszFormat, ...)
     
    8591}
    8692
     93/* Do nothing. */
     94RTDECL(int) RTLogCreate(PRTLOGGER *ppLogger, RTUINT fFlags, const char *pszGroupSettings,
     95                        const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups,
     96                        RTUINT fDestFlags, const char *pszFilenameFmt, ...)
     97{
     98    return VERR_NOT_IMPLEMENTED;
     99}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette