Changeset 37591 in vbox for trunk/include
- Timestamp:
- Jun 22, 2011 3:58:22 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72437
- Location:
- trunk/include/iprt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/err.h
r37233 r37591 1640 1640 /** @} */ 1641 1641 1642 /** @name RTDvm status codes 1643 * @{ */ 1644 /** The internal logger revision did not match. */ 1645 #define VERR_LOG_REVISION_MISMATCH (-22300) 1646 /** @} */ 1647 1642 1648 /* SED-END */ 1643 1649 -
trunk/include/iprt/log.h
r36830 r37591 264 264 uint32_t offScratch; 265 265 /** This is set if a prefix is pending. */ 266 uint32_t fPendingPrefix; 266 bool fPendingPrefix; 267 bool afAlignment[3]; 267 268 /** Pointer to the logger function. 268 269 * This is actually pointer to a wrapper which will push a pointer to the … … 291 292 #ifndef IN_RC 292 293 293 /** Pointer to file logging bits for the logger. */294 typedef struct RTLOGGER FILE *PRTLOGGERFILE;294 /** Pointer to internal logger bits. */ 295 typedef struct RTLOGGERINTERNAL *PRTLOGGERINTERNAL; 295 296 296 297 /** … … 301 302 /** Pointer to temporary scratch buffer. 302 303 * This is used to format the log messages. */ 303 char achScratch[ 32768];304 char achScratch[49152]; 304 305 /** Current scratch buffer position. */ 305 306 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 the310 * 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;322 307 /** Magic number. */ 323 308 uint32_t u32Magic; … … 326 311 /** Destination flags - RTLOGDEST. */ 327 312 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. 331 314 * (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; 339 324 /** Number of groups in the afGroups and papszGroups members. */ 340 325 uint32_t cGroups; … … 346 331 347 332 /** RTLOGGER::u32Magic value. (Avram Noam Chomsky) */ 348 # define RTLOGGER_MAGIC 0x19281207333 # define RTLOGGER_MAGIC UINT32_C(0x19281207) 349 334 350 335 #endif /* !IN_RC */ … … 372 357 /** Flush the file to disk when flushing the buffer. */ 373 358 RTLOGFLAGS_FLUSH = 0x00000200, 359 /** Restrict the number of log entries per group. */ 360 RTLOGFLAGS_RESTRICT_GROUPS = 0x00000400, 374 361 /** New lines should be prefixed with the write and read lock counts. */ 375 362 RTLOGFLAGS_PREFIX_LOCK_COUNTS = 0x00008000, … … 427 414 /** Flow logging. */ 428 415 RTLOGGRPFLAGS_FLOW = 0x00000080, 416 /** Restrict the number of log entries. */ 417 RTLOGGRPFLAGS_RESTRICT = 0x00000100, 429 418 430 419 /** Lelik logging. */ 431 RTLOGGRPFLAGS_LELIK = 0x000 00100,420 RTLOGGRPFLAGS_LELIK = 0x00010000, 432 421 /** Michael logging. */ 433 RTLOGGRPFLAGS_MICHAEL = 0x00000200, 434 /** dmik logging. */ 435 RTLOGGRPFLAGS_DMIK = 0x00000400, 422 RTLOGGRPFLAGS_MICHAEL = 0x00020000, 436 423 /** sunlover logging. */ 437 RTLOGGRPFLAGS_SUNLOVER = 0x000 00800,424 RTLOGGRPFLAGS_SUNLOVER = 0x00040000, 438 425 /** Achim logging. */ 439 RTLOGGRPFLAGS_ACHIM = 0x000 01000,426 RTLOGGRPFLAGS_ACHIM = 0x00080000, 440 427 /** Sander logging. */ 441 RTLOGGRPFLAGS_SANDER = 0x00 002000,428 RTLOGGRPFLAGS_SANDER = 0x00100000, 442 429 /** Klaus logging. */ 443 RTLOGGRPFLAGS_KLAUS = 0x00 004000,430 RTLOGGRPFLAGS_KLAUS = 0x00200000, 444 431 /** Frank logging. */ 445 RTLOGGRPFLAGS_FRANK = 0x00 008000,432 RTLOGGRPFLAGS_FRANK = 0x00400000, 446 433 /** bird logging. */ 447 RTLOGGRPFLAGS_BIRD = 0x00 010000,434 RTLOGGRPFLAGS_BIRD = 0x00800000, 448 435 /** aleksey logging. */ 449 RTLOGGRPFLAGS_ALEKSEY = 0x0 0020000,436 RTLOGGRPFLAGS_ALEKSEY = 0x01000000, 450 437 /** dj logging. */ 451 RTLOGGRPFLAGS_DJ = 0x0 0040000,438 RTLOGGRPFLAGS_DJ = 0x02000000, 452 439 /** NoName logging. */ 453 RTLOGGRPFLAGS_NONAME = 0x0 0080000440 RTLOGGRPFLAGS_NONAME = 0x04000000 454 441 } RTLOGGRPFLAGS; 455 442 … … 621 608 */ 622 609 #define LogMichael(a) LogIt(LOG_INSTANCE, RTLOGGRPFLAGS_MICHAEL, LOG_GROUP, a) 623 624 /** @def LogDmik625 * dmik logging.626 */627 #define LogDmik(a) LogIt(LOG_INSTANCE, RTLOGGRPFLAGS_DMIK, LOG_GROUP, a)628 610 629 611 /** @def LogSunlover … … 1064 1046 #define LogRelMichael(a) LogRelIt(LOG_REL_INSTANCE, RTLOGGRPFLAGS_MICHAEL, LOG_GROUP, a) 1065 1047 1066 /** @def LogRelDmik1067 * dmik logging.1068 */1069 #define LogRelDmik(a) LogRelIt(LOG_REL_INSTANCE, RTLOGGRPFLAGS_DMIK, LOG_GROUP, a)1070 1071 1048 /** @def LogRelSunlover 1072 1049 * sunlover logging. … … 1532 1509 * @param pLogger Where to create the logger instance. 1533 1510 * @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. 1537 1515 * @param fDestFlags The destination flags. 1538 1516 */ 1539 RTDECL(int) RTLogCreateForR0(PRTLOGGER pLogger, size_t cbLogger, PFNRTLOGGER pfnLogger, PFNRTLOGFLUSH pfnFlush, uint32_t fFlags, uint32_t fDestFlags); 1517 RTDECL(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 */ 1528 RTDECL(size_t) RTLogCalcSizeForR0(uint32_t cGroups, uint32_t fFlags); 1540 1529 1541 1530 /** … … 1598 1587 1599 1588 /** 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 * */ 1598 RTDECL(int) RTLogSetCustomPrefixCallbackForR0(PRTLOGGER pLogger, RTR0PTR pLoggerR0Ptr, 1599 RTR0PTR pfnCallbackR0Ptr, RTR0PTR pvUserR0Ptr); 1600 1601 /** 1600 1602 * Copies the group settings and flags from logger instance to another. 1601 1603 * 1602 1604 * @returns IPRT status code. 1603 1605 * @param pDstLogger The destination logger instance. 1606 * @param pDstLoggerR0Ptr The ring-0 address corresponding to @a pDstLogger. 1604 1607 * @param pSrcLogger The source logger instance. If NULL the default one is used. 1605 1608 * @param fFlagsOr OR mask for the flags. 1606 1609 * @param fFlagsAnd AND mask for the flags. 1607 1610 */ 1608 RTDECL(int) RTLogCopyGroupsAndFlags(PRTLOGGER pDstLogger, PCRTLOGGER pSrcLogger, unsigned fFlagsOr, unsigned fFlagsAnd); 1611 RTDECL(int) RTLogCopyGroupsAndFlagsForR0(PRTLOGGER pDstLogger, RTR0PTR pDstLoggerR0Ptr, 1612 PCRTLOGGER pSrcLogger, uint32_t fFlagsOr, uint32_t fFlagsAnd); 1609 1613 1610 1614 /** … … 1653 1657 */ 1654 1658 RTDECL(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 */ 1672 RTDECL(uint32_t) RTLogSetGroupLimit(PRTLOGGER pLogger, uint32_t cMaxEntriesPerGroup); 1655 1673 1656 1674 #ifndef IN_RC -
trunk/include/iprt/mangling.h
r37409 r37591 640 640 # define RTLogBackdoorPrintf RT_MANGLER(RTLogBackdoorPrintf) /* r0drv-guest */ 641 641 # define RTLogBackdoorPrintfV RT_MANGLER(RTLogBackdoorPrintfV) /* r0drv-guest */ 642 # define RTLogCalcSizeForR0 RT_MANGLER(RTLogCalcSizeForR0) 642 643 # define RTLogCloneRC RT_MANGLER(RTLogCloneRC) 643 644 # define RTLogComPrintf RT_MANGLER(RTLogComPrintf) 644 645 # define RTLogComPrintfV RT_MANGLER(RTLogComPrintfV) 645 # define RTLogCopyGroupsAndFlags RT_MANGLER(RTLogCopyGroupsAndFlags)646 # define RTLogCopyGroupsAndFlagsForR0 RT_MANGLER(RTLogCopyGroupsAndFlagsForR0) 646 647 # define RTLogCreate RT_MANGLER(RTLogCreate) 647 648 # define RTLogCreateEx RT_MANGLER(RTLogCreateEx) … … 677 678 # define RTLogSetBuffering RT_MANGLER(RTLogSetBuffering) 678 679 # define RTLogSetCustomPrefixCallback RT_MANGLER(RTLogSetCustomPrefixCallback) 680 # define RTLogSetCustomPrefixCallbackForR0 RT_MANGLER(RTLogSetCustomPrefixCallbackForR0) 679 681 # define RTLogSetDefaultInstance RT_MANGLER(RTLogSetDefaultInstance) 680 682 # define RTLogSetDefaultInstanceThread RT_MANGLER(RTLogSetDefaultInstanceThread) /* r0drv */ 683 # define RTLogSetGroupLimit RT_MANGLER(RTLogSetGroupLimit) 681 684 # define RTLogWriteCom RT_MANGLER(RTLogWriteCom) 682 685 # define RTLogWriteCom RT_MANGLER(RTLogWriteCom)
Note:
See TracChangeset
for help on using the changeset viewer.