6 #ifndef ABTI_LOG_H_INCLUDED 7 #define ABTI_LOG_H_INCLUDED 11 #ifdef ABT_CONFIG_USE_DEBUG_LOG 16 extern ABTD_XSTREAM_LOCAL ABTI_log *lp_ABTI_log;
18 void ABTI_log_init(
void);
19 void ABTI_log_finalize(
void);
20 void ABTI_log_print(FILE *fh,
const char *format, ...);
21 void ABTI_log_event(FILE *fh,
const char *format, ...);
22 void ABTI_log_debug(FILE *fh,
char *path,
int line,
const char *format, ...);
23 void ABTI_log_pool_push(ABTI_pool *p_pool,
ABT_unit unit,
24 ABTI_native_thread_id producer_id);
25 void ABTI_log_pool_remove(ABTI_pool *p_pool,
ABT_unit unit,
26 ABTI_native_thread_id consumer_id);
27 void ABTI_log_pool_pop(ABTI_pool *p_pool,
ABT_unit unit);
29 static inline void ABTI_log_set_sched(ABTI_sched *p_sched)
31 lp_ABTI_log->p_sched = p_sched;
34 static inline ABTI_sched *ABTI_log_get_sched(
void)
36 return lp_ABTI_log->p_sched;
39 #define ABTI_LOG_INIT() ABTI_log_init() 40 #define ABTI_LOG_FINALIZE() ABTI_log_finalize() 41 #define ABTI_LOG_SET_SCHED(s) ABTI_log_set_sched(s) 42 #define ABTI_LOG_GET_SCHED(ret) ret = ABTI_log_get_sched() 43 #define LOG_EVENT(fmt, ...) ABTI_log_event(stderr, fmt, __VA_ARGS__) 44 #define LOG_DEBUG(fmt, ...) \ 45 ABTI_log_debug(stderr, __FILE__, __LINE__, fmt, __VA_ARGS__) 47 #define LOG_EVENT_POOL_PUSH(p_pool, unit, produer_id) \ 48 ABTI_log_pool_push(p_pool, unit, produer_id) 49 #define LOG_EVENT_POOL_REMOVE(p_pool, unit, consumer_id) \ 50 ABTI_log_pool_remove(p_pool, unit, consumer_id) 51 #define LOG_EVENT_POOL_POP(p_pool, unit) ABTI_log_pool_pop(p_pool, unit) 55 #define ABTI_LOG_INIT() 56 #define ABTI_LOG_FINALIZE() 57 #define ABTI_LOG_SET_SCHED(s) 58 #define ABTI_LOG_GET_SCHED(ret) 60 #define LOG_EVENT(fmt, ...) 61 #define LOG_DEBUG(fmt, ...) 63 #define LOG_EVENT_POOL_PUSH(p_pool, unit, produer_id) 64 #define LOG_EVENT_POOL_REMOVE(p_pool, unit, consumer_id) 65 #define LOG_EVENT_POOL_POP(p_pool, unit) struct ABT_unit_opaque * ABT_unit