]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/commitdiff
Passing FRSH_TRACE as a standard (non-inlined) function in order for -O1 to
authortelleriam <telleriam@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Sun, 27 Jan 2008 10:31:38 +0000 (10:31 +0000)
committertelleriam <telleriam@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Sun, 27 Jan 2008 10:31:38 +0000 (10:31 +0000)
be applied.

git-svn-id: http://www.frescor.org/private/svn/frescor/frsh/trunk/include@1011 35b4ef3e-fd22-0410-ab77-dab3279adceb

frsh_debug_and_trace.h

index d86fd39116b4acb1c14eb869f1abdb76901edcc6..ad03ff431c832c4d191679bd689656d12dd35c31 100644 (file)
@@ -145,24 +145,17 @@ static inline long int FRSH_TIMESPEC_TO_RELATIVE_MSECS(const struct timespec *ts
     return time_msecs - frsh_trace_init_timemsec;
 }
 
-static void inline FRSH_TRACE(bool is_active, const char *format, ...)
-{
-    va_list args;
-
-#ifdef FRSH_TRACE_TS_MSECS
-    const int TS_LENGTH_MSECS = 10; /* Room for LONG_MAX 2147483648 */
-#endif
-
-    if (is_active) {
-
-        va_start(args, format);
 
-#ifdef FRSH_TRACE_TS_MSECS
-        printf("%*ld: ", TS_LENGTH_MSECS, FRSH_GET_TIMESTAMP_MSECS());
-#endif
-        vprintf(format, args);
-        va_end(args);
-    }
-}
+/**
+ * FRSH_TRACE()
+ *
+ * If the boolean value is true, print the format line optionally
+ * preceded by a timestamp in ms relative to the start of the
+ * program.
+ *
+ * Due to the "..." argument passing, this function cannot be
+ * inlined. 
+ **/
+void FRSH_TRACE(bool is_active, const char *format, ...);
 
 #endif