VirtualBox

Changeset 7448 in vbox


Ignore:
Timestamp:
Mar 14, 2008 6:04:46 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28886
Message:

Runtime/Logger: added "LOG_TO_BACKDOOR_FULL" for guest R3 executables to control what is (debug) logged to the backdoor logger using the usual VBOX_LOG environment variable

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r7386 r7448  
    26832683TEMPLATE_VBOXGUESTR3EXE_BLD_TRG_ARCH  = x86
    26842684TEMPLATE_VBOXGUESTR3EXE_BLD_TRG_CPU   = blend
    2685 TEMPLATE_VBOXGUESTR3EXE_DEFS     := IN_GUEST IN_GUEST_R3 IN_RT_R3 LOG_TO_BACKDOOR \
     2685TEMPLATE_VBOXGUESTR3EXE_DEFS     := IN_GUEST IN_GUEST_R3 IN_RT_R3 LOG_TO_BACKDOOR_FULL \
    26862686                                    $(filter-out $(ARCH_BITS_DEFS),$(TEMPLATE_VBOXR3EXE_DEFS)) HC_ARCH_BITS=32 GC_ARCH_BITS=32
    26872687if1of ($(BUILD_TARGET),l4 linux) # As few libs as possible on linux.
  • trunk/include/iprt/log.h

    r7170 r7448  
    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
    402408
    403409/** @def LogIt
     
    405411 */
    406412#ifdef LOG_ENABLED
    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) \
     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) \
    413420    do \
    414421    { \
     
    421428        } \
    422429    } while (0)
    423 # endif
     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 */
    424444#else
    425445# define LogIt(pvInst, fFlags, iGroup, fmtargs) do { } while (0)
     
    708728 * Write to specific logger if group enabled.
    709729 */
    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) \
     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) \
    714735    do \
    715736    { \
     
    719740        LogIt(LOG_INSTANCE, fFlags, iGroup, fmtargs); \
    720741    } while (0)
    721 #else
    722 # define LogRelIt(pvInst, fFlags, iGroup, fmtargs) \
     742# else
     743#  define LogRelIt(pvInst, fFlags, iGroup, fmtargs) \
    723744   do \
    724745   { \
     
    732753       LogIt(LOG_INSTANCE, fFlags, iGroup, fmtargs); \
    733754  } while (0)
    734 #endif
     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 */
    735762
    736763
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