VirtualBox

Changeset 37591 in vbox for trunk/include


Ignore:
Timestamp:
Jun 22, 2011 3:58:22 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72437
Message:

RTLog,VMM,Main,SUPDrv: Restrict VM release logging by group - major support driver version change.

Location:
trunk/include/iprt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/err.h

    r37233 r37591  
    16401640/** @} */
    16411641
     1642/** @name RTDvm status codes
     1643 * @{ */
     1644/** The internal logger revision did not match. */
     1645#define VERR_LOG_REVISION_MISMATCH                  (-22300)
     1646/** @} */
     1647
    16421648/* SED-END */
    16431649
  • trunk/include/iprt/log.h

    r36830 r37591  
    264264    uint32_t                offScratch;
    265265    /** This is set if a prefix is pending. */
    266     uint32_t                fPendingPrefix;
     266    bool                    fPendingPrefix;
     267    bool                    afAlignment[3];
    267268    /** Pointer to the logger function.
    268269     * This is actually pointer to a wrapper which will push a pointer to the
     
    291292#ifndef IN_RC
    292293
    293 /** Pointer to file logging bits for the logger. */
    294 typedef struct RTLOGGERFILE *PRTLOGGERFILE;
     294/** Pointer to internal logger bits. */
     295typedef struct RTLOGGERINTERNAL *PRTLOGGERINTERNAL;
    295296
    296297/**
     
    301302    /** Pointer to temporary scratch buffer.
    302303     * This is used to format the log messages. */
    303     char                    achScratch[32768];
     304    char                    achScratch[49152];
    304305    /** Current scratch buffer position. */
    305306    uint32_t                offScratch;
    306     /** This is set if a prefix is pending. */
    307     uint32_t                fPendingPrefix;
    308     /** Pointer to the logger function.
    309      * This is actually pointer to a wrapper which will push a pointer to the
    310      * instance pointer onto the stack before jumping to the real logger function.
    311      * A very unfortunate hack to work around the missing variadic macro support in C++.
    312      * (The memory is (not R0) allocated using RTMemExecAlloc().) */
    313     PFNRTLOGGER             pfnLogger;
    314     /** Pointer to the flush function. */
    315     PFNRTLOGFLUSH           pfnFlush;
    316     /** Custom prefix callback. */
    317     PFNRTLOGPREFIX          pfnPrefix;
    318     /** Prefix callback argument. */
    319     void                   *pvPrefixUserArg;
    320     /** Spinning mutex semaphore. */
    321     RTSEMSPINMUTEX          hSpinMtx;
    322307    /** Magic number. */
    323308    uint32_t                u32Magic;
     
    326311    /** Destination flags - RTLOGDEST. */
    327312    uint32_t                fDestFlags;
    328     /** Currently unused field. */
    329     uint32_t                uUnused;
    330     /** Pointer to the file related logging information.
     313    /** Pointer to the internal bits of the logger.
    331314     * (The memory is allocated in the same block as RTLOGGER.) */
    332     PRTLOGGERFILE           pFile;
    333     /** Pointer to the group name array.
    334      * (The data is readonly and provided by the user.) */
    335     const char * const     *papszGroups;
    336     /** The max number of groups that there is room for in afGroups and papszGroups.
    337      * Used by RTLogCopyGroupAndFlags(). */
    338     uint32_t                cMaxGroups;
     315    PRTLOGGERINTERNAL       pInt;
     316    /** Pointer to the logger function (used in non-C99 mode only).
     317     *
     318     * This is actually pointer to a wrapper which will push a pointer to the
     319     * instance pointer onto the stack before jumping to the real logger function.
     320     * A very unfortunate hack to work around the missing variadic macro
     321     * support in older C++/C standards.  (The memory is allocated using
     322     * RTMemExecAlloc(), except for agnostic R0 code.) */
     323    PFNRTLOGGER             pfnLogger;
    339324    /** Number of groups in the afGroups and papszGroups members. */
    340325    uint32_t                cGroups;
     
    346331
    347332/** RTLOGGER::u32Magic value. (Avram Noam Chomsky) */
    348 #define RTLOGGER_MAGIC      0x19281207
     333# define RTLOGGER_MAGIC     UINT32_C(0x19281207)
    349334
    350335#endif /* !IN_RC */
     
    372357    /** Flush the file to disk when flushing the buffer. */
    373358    RTLOGFLAGS_FLUSH                = 0x00000200,
     359    /** Restrict the number of log entries per group. */
     360    RTLOGFLAGS_RESTRICT_GROUPS      = 0x00000400,
    374361    /** New lines should be prefixed with the write and read lock counts. */
    375362    RTLOGFLAGS_PREFIX_LOCK_COUNTS   = 0x00008000,
     
    427414    /** Flow logging. */
    428415    RTLOGGRPFLAGS_FLOW         = 0x00000080,
     416    /** Restrict the number of log entries. */
     417    RTLOGGRPFLAGS_RESTRICT     = 0x00000100,
    429418
    430419    /** Lelik logging. */
    431     RTLOGGRPFLAGS_LELIK        = 0x00000100,
     420    RTLOGGRPFLAGS_LELIK        = 0x00010000,
    432421    /** Michael logging. */
    433     RTLOGGRPFLAGS_MICHAEL      = 0x00000200,
    434     /** dmik logging. */
    435     RTLOGGRPFLAGS_DMIK         = 0x00000400,
     422    RTLOGGRPFLAGS_MICHAEL      = 0x00020000,
    436423    /** sunlover logging. */
    437     RTLOGGRPFLAGS_SUNLOVER     = 0x00000800,
     424    RTLOGGRPFLAGS_SUNLOVER     = 0x00040000,
    438425    /** Achim logging. */
    439     RTLOGGRPFLAGS_ACHIM        = 0x00001000,
     426    RTLOGGRPFLAGS_ACHIM        = 0x00080000,
    440427    /** Sander logging. */
    441     RTLOGGRPFLAGS_SANDER       = 0x00002000,
     428    RTLOGGRPFLAGS_SANDER       = 0x00100000,
    442429    /** Klaus logging. */
    443     RTLOGGRPFLAGS_KLAUS        = 0x00004000,
     430    RTLOGGRPFLAGS_KLAUS        = 0x00200000,
    444431    /** Frank logging. */
    445     RTLOGGRPFLAGS_FRANK        = 0x00008000,
     432    RTLOGGRPFLAGS_FRANK        = 0x00400000,
    446433    /** bird logging. */
    447     RTLOGGRPFLAGS_BIRD         = 0x00010000,
     434    RTLOGGRPFLAGS_BIRD         = 0x00800000,
    448435    /** aleksey logging. */
    449     RTLOGGRPFLAGS_ALEKSEY      = 0x00020000,
     436    RTLOGGRPFLAGS_ALEKSEY      = 0x01000000,
    450437    /** dj logging. */
    451     RTLOGGRPFLAGS_DJ           = 0x00040000,
     438    RTLOGGRPFLAGS_DJ           = 0x02000000,
    452439    /** NoName logging. */
    453     RTLOGGRPFLAGS_NONAME       = 0x00080000
     440    RTLOGGRPFLAGS_NONAME       = 0x04000000
    454441} RTLOGGRPFLAGS;
    455442
     
    621608 */
    622609#define LogMichael(a)   LogIt(LOG_INSTANCE, RTLOGGRPFLAGS_MICHAEL,  LOG_GROUP, a)
    623 
    624 /** @def LogDmik
    625  * dmik logging.
    626  */
    627 #define LogDmik(a)      LogIt(LOG_INSTANCE, RTLOGGRPFLAGS_DMIK,     LOG_GROUP, a)
    628610
    629611/** @def LogSunlover
     
    10641046#define LogRelMichael(a)   LogRelIt(LOG_REL_INSTANCE, RTLOGGRPFLAGS_MICHAEL,  LOG_GROUP, a)
    10651047
    1066 /** @def LogRelDmik
    1067  * dmik logging.
    1068  */
    1069 #define LogRelDmik(a)      LogRelIt(LOG_REL_INSTANCE, RTLOGGRPFLAGS_DMIK,     LOG_GROUP, a)
    1070 
    10711048/** @def LogRelSunlover
    10721049 * sunlover logging.
     
    15321509 * @param   pLogger             Where to create the logger instance.
    15331510 * @param   cbLogger            The amount of memory available for the logger instance.
    1534  * @param   pfnLogger           Pointer to logger wrapper function for the clone.
    1535  * @param   pfnFlush            Pointer to flush function for the clone.
    1536  * @param   fFlags              Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
     1511 * @param   pLoggerR0Ptr        The ring-0 address corresponding to @a pLogger.
     1512 * @param   pfnLoggerR0Ptr      Pointer to logger wrapper function.
     1513 * @param   pfnFlushR0Ptr       Pointer to flush function.
     1514 * @param   fFlags              Logger instance flags, a combination of the RTLOGFLAGS_* values.
    15371515 * @param   fDestFlags          The destination flags.
    15381516 */
    1539 RTDECL(int) RTLogCreateForR0(PRTLOGGER pLogger, size_t cbLogger, PFNRTLOGGER pfnLogger, PFNRTLOGFLUSH pfnFlush, uint32_t fFlags, uint32_t fDestFlags);
     1517RTDECL(int) RTLogCreateForR0(PRTLOGGER pLogger, size_t cbLogger,
     1518                             RTR0PTR pLoggerR0Ptr, RTR0PTR pfnLoggerR0Ptr, RTR0PTR pfnFlushR0Ptr,
     1519                             uint32_t fFlags, uint32_t fDestFlags);
     1520
     1521/**
     1522 * Calculates the minimum size of a ring-0 logger instance.
     1523 *
     1524 * @returns The minimum size.
     1525 * @param   cGroups             The number of groups.
     1526 * @param   fFlags              Relevant flags.
     1527 */
     1528RTDECL(size_t) RTLogCalcSizeForR0(uint32_t cGroups, uint32_t fFlags);
    15401529
    15411530/**
     
    15981587
    15991588/**
     1589 * Same as RTLogSetCustomPrefixCallback for loggers created by
     1590 * RTLogCreateForR0.
     1591 *
     1592 * @returns IPRT status code.
     1593 * @param   pLogger             The logger instance.
     1594 * @param   pLoggerR0Ptr        The ring-0 address corresponding to @a pLogger.
     1595 * @param   pfnCallbackR0Ptr    The callback.
     1596 * @param   pvUserR0Ptr         The user argument for the callback.
     1597 *  */
     1598RTDECL(int) RTLogSetCustomPrefixCallbackForR0(PRTLOGGER pLogger, RTR0PTR pLoggerR0Ptr,
     1599                                              RTR0PTR pfnCallbackR0Ptr, RTR0PTR pvUserR0Ptr);
     1600
     1601/**
    16001602 * Copies the group settings and flags from logger instance to another.
    16011603 *
    16021604 * @returns IPRT status code.
    16031605 * @param   pDstLogger      The destination logger instance.
     1606 * @param   pDstLoggerR0Ptr The ring-0 address corresponding to @a pDstLogger.
    16041607 * @param   pSrcLogger      The source logger instance. If NULL the default one is used.
    16051608 * @param   fFlagsOr        OR mask for the flags.
    16061609 * @param   fFlagsAnd       AND mask for the flags.
    16071610 */
    1608 RTDECL(int) RTLogCopyGroupsAndFlags(PRTLOGGER pDstLogger, PCRTLOGGER pSrcLogger, unsigned fFlagsOr, unsigned fFlagsAnd);
     1611RTDECL(int) RTLogCopyGroupsAndFlagsForR0(PRTLOGGER pDstLogger, RTR0PTR pDstLoggerR0Ptr,
     1612                                         PCRTLOGGER pSrcLogger, uint32_t fFlagsOr, uint32_t fFlagsAnd);
    16091613
    16101614/**
     
    16531657 */
    16541658RTDECL(bool) RTLogSetBuffering(PRTLOGGER pLogger, bool fBuffered);
     1659
     1660/**
     1661 * Sets the max number of entries per group.
     1662 *
     1663 * @returns Old restriction.
     1664 *
     1665 * @param   pLogger             The logger instance (NULL is an alias for the
     1666 *                              default logger).
     1667 * @param   cMaxEntriesPerGroup The max number of entries per group.
     1668 *
     1669 * @remarks Lowering the limit of an active logger may quietly mute groups.
     1670 *          Raising it may reactive already muted groups.
     1671 */
     1672RTDECL(uint32_t) RTLogSetGroupLimit(PRTLOGGER pLogger, uint32_t cMaxEntriesPerGroup);
    16551673
    16561674#ifndef IN_RC
  • trunk/include/iprt/mangling.h

    r37409 r37591  
    640640# define RTLogBackdoorPrintf                            RT_MANGLER(RTLogBackdoorPrintf) /* r0drv-guest */
    641641# define RTLogBackdoorPrintfV                           RT_MANGLER(RTLogBackdoorPrintfV) /* r0drv-guest */
     642# define RTLogCalcSizeForR0                             RT_MANGLER(RTLogCalcSizeForR0)
    642643# define RTLogCloneRC                                   RT_MANGLER(RTLogCloneRC)
    643644# define RTLogComPrintf                                 RT_MANGLER(RTLogComPrintf)
    644645# define RTLogComPrintfV                                RT_MANGLER(RTLogComPrintfV)
    645 # define RTLogCopyGroupsAndFlags                        RT_MANGLER(RTLogCopyGroupsAndFlags)
     646# define RTLogCopyGroupsAndFlagsForR0                   RT_MANGLER(RTLogCopyGroupsAndFlagsForR0)
    646647# define RTLogCreate                                    RT_MANGLER(RTLogCreate)
    647648# define RTLogCreateEx                                  RT_MANGLER(RTLogCreateEx)
     
    677678# define RTLogSetBuffering                              RT_MANGLER(RTLogSetBuffering)
    678679# define RTLogSetCustomPrefixCallback                   RT_MANGLER(RTLogSetCustomPrefixCallback)
     680# define RTLogSetCustomPrefixCallbackForR0              RT_MANGLER(RTLogSetCustomPrefixCallbackForR0)
    679681# define RTLogSetDefaultInstance                        RT_MANGLER(RTLogSetDefaultInstance)
    680682# define RTLogSetDefaultInstanceThread                  RT_MANGLER(RTLogSetDefaultInstanceThread) /* r0drv */
     683# define RTLogSetGroupLimit                             RT_MANGLER(RTLogSetGroupLimit)
    681684# define RTLogWriteCom                                  RT_MANGLER(RTLogWriteCom)
    682685# define RTLogWriteCom                                  RT_MANGLER(RTLogWriteCom)
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