Changeset 6515 in vbox
- Timestamp:
- Jan 25, 2008 1:23:54 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 27525
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/log.h
r5999 r6515 287 287 RTLOGFLAGS_USECRLF = 0x00000010, 288 288 /** Show relative timestamps with PREFIX_TSC and PREFIX_TS */ 289 RTLOGFLAGS_REL_TS = 0x000 10000,289 RTLOGFLAGS_REL_TS = 0x00008000, 290 290 /** Show decimal timestamps with PREFIX_TSC and PREFIX_TS */ 291 RTLOGFLAGS_DECIMAL_TS = 0x00020000, 291 RTLOGFLAGS_DECIMAL_TS = 0x00010000, 292 /** New lines should be prefixed with the native process id. */ 293 RTLOGFLAGS_PREFIX_PID = 0x00020000, 292 294 /** New lines should be prefixed with group flag number causing the output. */ 293 295 RTLOGFLAGS_PREFIX_FLAG_NO = 0x00040000, -
trunk/src/VBox/Runtime/VBox/log-vbox.cpp
r6407 r6515 390 390 */ 391 391 # if defined(DEBUG_bird) && !defined(IN_GUEST) 392 //RTLogGroupSettings(pLogger, "all=~0");393 //RTLogFlags(pLogger, "enabled unbuffered");394 RTLogGroupSettings(pLogger, "-all");395 RTLogFlags(pLogger, "disabled unbuffered");396 pLogger->fDestFlags |= /*RTLOGDEST_DEBUGGER |*/ RTLOGDEST_COM;392 RTLogGroupSettings(pLogger, "all=~0"); 393 RTLogFlags(pLogger, "enabled unbuffered pid"); 394 //RTLogGroupSettings(pLogger, "-all"); 395 //RTLogFlags(pLogger, "disabled unbuffered"); 396 pLogger->fDestFlags |= RTLOGDEST_DEBUGGER;/* | RTLOGDEST_COM;*/ 397 397 # endif 398 398 # if defined(DEBUG_sandervl) && !defined(IN_GUEST) -
trunk/src/VBox/Runtime/common/log/log.cpp
r6493 r6515 32 32 #ifndef IN_GC 33 33 # include <iprt/alloc.h> 34 # include <iprt/process.h> 35 # include <iprt/semaphore.h> 34 36 # include <iprt/thread.h> 35 # include <iprt/semaphore.h>36 37 #endif 37 38 #ifdef IN_RING3 38 # include <iprt/process.h>39 39 # include <iprt/file.h> 40 40 # include <iprt/path.h> … … 1196 1196 { "dec", sizeof("dec" ) - 1, RTLOGFLAGS_DECIMAL_TS, false }, 1197 1197 { "hex", sizeof("hex" ) - 1, RTLOGFLAGS_DECIMAL_TS, true }, 1198 { "pid", sizeof("pid" ) - 1, RTLOGFLAGS_PREFIX_PID, false }, 1198 1199 { "flagno", sizeof("flagno" ) - 1, RTLOGFLAGS_PREFIX_FLAG_NO, false }, 1199 1200 { "flag", sizeof("flag" ) - 1, RTLOGFLAGS_PREFIX_FLAG, false }, … … 1870 1871 /* 1871 1872 * Flush the buffer if there isn't enough room for the maximum prefix config. 1872 * Max is 1 24, add a couple of extra bytes.1873 * Max is 198, add a couple of extra bytes. 1873 1874 */ 1874 if (cb < 1 28 + 18 + 22)1875 if (cb < 198 + 16) 1875 1876 { 1876 1877 rtlogFlush(pLogger); … … 1899 1900 if (pLogger->fFlags & RTLOGFLAGS_REL_TS) 1900 1901 { 1901 static uint64_t s_u64LastTs;1902 static volatile uint64_t s_u64LastTs; 1902 1903 uint64_t u64DiffTs = u64 - s_u64LastTs; 1903 1904 s_u64LastTs = u64; … … 1908 1909 } 1909 1910 /* 1E15 nanoseconds = 11 days */ 1910 psz += RTStrFormatNumber(psz, u64, iBase, 16, 0, fFlags); 1911 psz += RTStrFormatNumber(psz, u64, iBase, 16, 0, fFlags); /* +17 */ 1911 1912 *psz++ = ' '; 1912 1913 } … … 1923 1924 if (pLogger->fFlags & RTLOGFLAGS_REL_TS) 1924 1925 { 1925 static uint64_t s_u64LastTsc;1926 static volatile uint64_t s_u64LastTsc; 1926 1927 uint64_t u64DiffTsc = u64 - s_u64LastTsc; 1927 1928 s_u64LastTsc = u64; … … 1932 1933 } 1933 1934 /* 1E15 ticks at 4GHz = 69 hours */ 1934 psz += RTStrFormatNumber(psz, u64, iBase, 16, 0, fFlags); 1935 psz += RTStrFormatNumber(psz, u64, iBase, 16, 0, fFlags); /* +17 */ 1935 1936 *psz++ = ' '; 1936 1937 } … … 1959 1960 *psz++ = '.'; 1960 1961 psz += RTStrFormatNumber(psz, Time.u32Nanosecond / 1000000, 10, 3, 0, RTSTR_F_ZEROPAD); 1961 *psz++ = ' '; 1962 *psz++ = ' '; /* +17 (3+1+3+1+3+1+4+1) */ 1962 1963 #else 1963 1964 memset(psz, ' ', 13); … … 1978 1979 *psz++ = '.'; 1979 1980 psz += RTStrFormatNumber(psz, u32 % 1000, 10, 3, 0, RTSTR_F_ZEROPAD); 1980 *psz++ = ' '; 1981 *psz++ = ' '; /* +20 (9+1+2+1+2+1+3+1) */ 1981 1982 #else 1982 1983 memset(psz, ' ', 13); … … 1993 1994 memcpy(psz, szDate, cch); 1994 1995 psz += cch; 1995 *psz++ = ' '; 1996 *psz++ = ' '; /* +32 */ 1996 1997 } 1997 1998 # endif 1999 if (pLogger->fFlags & RTLOGFLAGS_PREFIX_PID) 2000 { 2001 #ifndef IN_GC 2002 RTPROCESS Process = RTProcSelf(); 2003 #else 2004 RTPROCESS Process = NIL_RTPROCESS; 2005 #endif 2006 psz += RTStrFormatNumber(psz, Process, 16, sizeof(RTPROCESS) * 2, 0, RTSTR_F_ZEROPAD); 2007 *psz++ = ' '; /* +9 */ 2008 } 1998 2009 if (pLogger->fFlags & RTLOGFLAGS_PREFIX_TID) 1999 2010 { 2000 #if def IN_RING32011 #ifndef IN_GC 2001 2012 RTNATIVETHREAD Thread = RTThreadNativeSelf(); 2002 2013 #else … … 2004 2015 #endif 2005 2016 psz += RTStrFormatNumber(psz, Thread, 16, sizeof(RTNATIVETHREAD) * 2, 0, RTSTR_F_ZEROPAD); 2006 *psz++ = ' '; 2017 *psz++ = ' '; /* +17 */ 2007 2018 } 2008 2019 if (pLogger->fFlags & RTLOGFLAGS_PREFIX_THREAD) … … 2025 2036 do 2026 2037 *psz++ = ' '; 2027 while (cch++ < 8); 2038 while (cch++ < 8); /* +17 */ 2028 2039 } 2029 2040 if (pLogger->fFlags & RTLOGFLAGS_PREFIX_FLAG_NO) 2030 2041 { 2031 2042 psz += RTStrFormatNumber(psz, pArgs->fFlags, 16, 8, 0, RTSTR_F_ZEROPAD); 2032 *psz++ = ' '; 2043 *psz++ = ' '; /* +9 */ 2033 2044 } 2034 2045 if (pLogger->fFlags & RTLOGFLAGS_PREFIX_FLAG) … … 2049 2060 do 2050 2061 *psz++ = ' '; 2051 while (cch++ < 8); 2062 while (cch++ < 8); /* +17 */ 2052 2063 } 2053 2064 if (pLogger->fFlags & RTLOGFLAGS_PREFIX_GROUP_NO) … … 2062 2073 memcpy(psz, "-1 ", sizeof("-1 ") - 1); 2063 2074 psz += sizeof("-1 ") - 1; 2064 } 2075 } /* +9 */ 2065 2076 } 2066 2077 if (pLogger->fFlags & RTLOGFLAGS_PREFIX_GROUP) … … 2102 2113 do 2103 2114 *psz++ = ' '; 2104 while (cch++ < 8); 2115 while (cch++ < 8); /* +17 */ 2105 2116 } 2106 2117 … … 2109 2120 */ 2110 2121 cb = psz - &pLogger->achScratch[pLogger->offScratch]; 2111 Assert(cb <= 1 24);2122 Assert(cb <= 198); 2112 2123 pLogger->offScratch += cb; 2113 2124 cb = sizeof(pLogger->achScratch) - pLogger->offScratch - 1;
Note:
See TracChangeset
for help on using the changeset viewer.