Add FASTPATH trace log

Add a trace_fp that can be optimized away when FASTPATH is defined.
This commit is contained in:
Wim Taymans 2019-03-21 11:31:53 +01:00
parent 036ca89c0e
commit 5a2ccee1ff
17 changed files with 98 additions and 87 deletions

View file

@ -115,6 +115,12 @@ struct spa_log {
#define spa_log_debug(l,...) spa_log_log(l,SPA_LOG_LEVEL_DEBUG,__FILE__,__LINE__,__func__,__VA_ARGS__)
#define spa_log_trace(l,...) spa_log_log(l,SPA_LOG_LEVEL_TRACE,__FILE__,__LINE__,__func__,__VA_ARGS__)
#ifndef FASTPATH
#define spa_log_trace_fp(l,...) spa_log_log(l,SPA_LOG_LEVEL_TRACE,__FILE__,__LINE__,__func__,__VA_ARGS__)
#else
#define spa_log_trace_fp(l,...)
#endif
#else
#define SPA_LOG_FUNC(name,lev) \
@ -134,6 +140,12 @@ SPA_LOG_FUNC(info, SPA_LOG_LEVEL_INFO)
SPA_LOG_FUNC(debug, SPA_LOG_LEVEL_DEBUG)
SPA_LOG_FUNC(trace, SPA_LOG_LEVEL_TRACE)
#ifndef FASTPATH
SPA_LOG_FUNC(trace_fp, SPA_LOG_LEVEL_TRACE)
#else
static inline void spa_log_trace_fp (struct spa_log *l, const char *format, ...) { }
#endif
#endif
#ifdef __cplusplus
} /* extern "C" */