VirtualBox

Changeset 4731 in vbox for trunk


Ignore:
Timestamp:
Sep 12, 2007 12:06:50 PM (17 years ago)
Author:
vboxsync
Message:

Linux guest backdoor logging, part 2 (or 3?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestLog.h

    r4071 r4731  
    2020#define __VBOXGUESTLOG__H
    2121
     22#if defined(RT_OS_LINUX)
     23
     24/* Since I don't know the background for the stuff below, I prefer not to change
     25   it.  I don't need it or want it for backdoor logging inside the Linux
     26   Guest Additions kernel modules though. */
     27# include <VBox/log.h>
     28# define LogRelPrint(a) \
     29      do { \
     30          RTLogWriteUser (a, strlen(a)); \
     31      } while (0)
     32
     33# define LogRelPrintQuote(a) \
     34      do { \
     35          LogRelPrint (#a); \
     36      } while (0)
     37
     38# define LogRelPrintFunc(a) \
     39      do { \
     40          LogRelPrint (__PRETTY_FUNCTION__); \
     41          LogRelPrint (": "); \
     42          LogRelPrint (a); \
     43      } while (0)
     44
     45# define LogFunc(a) \
     46      do { \
     47          Log(("%s: ", __PRETTY_FUNCTION__)); \
     48          Log(a); \
     49      } while (0)
     50
     51#else  /* RT_OS_LINUX not defined */
    2252/* Save LOG_ENABLED state, because "VBox/rt/log.h"
    2353 * may undefine it for IN_RING0 code.
    2454 */
    25 #if (defined(DEBUG) && !defined(NO_LOGGING)) || defined(LOG_ENABLED)
    26 # define __LOG_ENABLED_SAVED__
    27 #endif
     55# if (defined(DEBUG) && !defined(NO_LOGGING)) || defined(LOG_ENABLED)
     56#  define __LOG_ENABLED_SAVED__
     57# endif
    2858
    29 #if (defined(DEBUG) && !defined(NO_LOGGING)) || defined(LOG_ENABLED)
    30 # ifdef VBOX_GUEST
    31 #  include <VBox/log.h>
    32 #  undef Log
    33 #  define Log(a)  RTLogBackdoorPrintf a
     59# if (defined(DEBUG) && !defined(NO_LOGGING)) || defined(LOG_ENABLED)
     60#  ifdef VBOX_GUEST
     61#   include <VBox/log.h>
     62#   undef Log
     63#   define Log(a)  RTLogBackdoorPrintf a
     64#  else
     65#   define Log(a)  DbgPrint a
     66#  endif
    3467# else
    35 #  define Log(a)  DbgPrint a
     68#  define Log(a)
    3669# endif
    37 #else
    38 # define Log(a)
    39 #endif
    4070
    41 #ifdef __LOG_ENABLED_SAVED__
    42 # define LOG_ENABLED
    43 # undef __LOG_ENABLED_SAVED__
    44 #endif
     71# ifdef __LOG_ENABLED_SAVED__
     72#  define LOG_ENABLED
     73#  undef __LOG_ENABLED_SAVED__
     74# endif
     75
     76#endif  /* RT_OS_LINUX not defined */
    4577
    4678#endif /* __VBOXGUESTLOG__H */
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