From: telleriam Date: Sun, 27 Jan 2008 10:31:38 +0000 (+0000) Subject: Passing FRSH_TRACE as a standard (non-inlined) function in order for -O1 to X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/frsh-include.git/commitdiff_plain/f17cc1093fea1cf8d9b8a794f9b3c530933d1432 Passing FRSH_TRACE as a standard (non-inlined) function in order for -O1 to be applied. git-svn-id: http://www.frescor.org/private/svn/frescor/frsh/trunk/include@1011 35b4ef3e-fd22-0410-ab77-dab3279adceb --- diff --git a/frsh_debug_and_trace.h b/frsh_debug_and_trace.h index d86fd39..ad03ff4 100644 --- a/frsh_debug_and_trace.h +++ b/frsh_debug_and_trace.h @@ -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