trace.h

00001 #ifndef RTAI_TRACE_H
00002 #define RTAI_TRACE_H
00003 
00004 #ifdef __KERNEL__
00005 
00006 #include <rtai_config.h>
00007 
00008 #ifdef CONFIG_RTAI_OPT_TRACES
00009 
00010 #ifdef _cplusplus
00011 extern "C" {
00012 #endif
00013 
00014     typedef void
00015     rtai_trace_callback_t(const char *f, int l, const char *fn,
00016                        const char *fmt, ...)
00017 #if defined(__GNUC__) && _GNUC__ > 2 || __GNUC__ == 2 &&  __GNUC_MINOR__ >= 96
00018         __attribute__((format(printf, 4, 5)))
00019 #endif
00020         ;
00021     extern rtai_trace_callback_t *rtai_trace_callback;
00022 
00023 #ifdef _cplusplus
00024 }
00025 #endif
00026 
00027 #define RTAI_TRACE(fmt, args...)                                             \
00028     do {                                                                  \
00029         if (rtai_trace_callback)                                             \
00030             rtai_trace_callback(__FILE__, __LINE__, __func__, fmt , ##args); \
00031     } while(0)
00032 
00033 #else /* ! CONFIG_RTAI_OPT_TRACES */
00034 
00035 #define RTAI_TRACE(fmt, args...)
00036 
00037 #endif /* CONFIG_RTAI_OPT_TRACES */
00038 
00039 #endif /* __KERNEL__ */
00040 
00041 #endif /*RTAI_TRACE_H*/

Generated on Mon Dec 13 09:49:49 2004 for RTAI API by  doxygen 1.3.9.1