10 #ifdef ABT_CONFIG_USE_DEBUG_LOG
12 void ABTI_log_debug(FILE *fh,
const char *format, ...)
19 const char *prefix_fmt = NULL, *prefix = NULL;
20 char static_buffer[256], *newfmt;
26 if (p_local_xstream) {
29 if (p_ythread == NULL) {
31 prefix_fmt =
"<U%" PRIu64
":E%d> %s";
32 rank = p_local_xstream->
rank;
39 rank = p_local_xstream->
rank;
40 prefix_fmt =
"<U%" PRIu64
":E%d> %s";
50 const int len_tid_rank = 50;
51 newfmt_len = 6 + len_tid_rank + strlen(format);
52 if (
sizeof(static_buffer) >= newfmt_len + 1) {
53 newfmt = static_buffer;
55 int abt_errno =
ABTU_malloc(newfmt_len + 1, (
void **)&newfmt);
59 sprintf(newfmt, prefix_fmt, tid, rank, format);
61 newfmt_len = strlen(prefix) + strlen(format);
62 if (
sizeof(static_buffer) >= newfmt_len + 1) {
63 newfmt = static_buffer;
65 int abt_errno =
ABTU_malloc(newfmt_len + 1, (
void **)&newfmt);
69 sprintf(newfmt, prefix_fmt, prefix, format);
72 #ifndef ABT_CONFIG_USE_DEBUG_LOG_DISCARD
74 va_start(list, format);
75 vfprintf(fh, newfmt, list);
83 if (newfmt != static_buffer) {
99 LOG_DEBUG(
"[%c%" PRIu64
":E%d] pushed to P%" PRIu64
"\n", unit_type,
103 LOG_DEBUG(
"[%c%" PRIu64
"] pushed to P%" PRIu64
"\n", unit_type,
119 LOG_DEBUG(
"[%c%" PRIu64
":E%d] removed from P%" PRIu64
"\n", unit_type,
123 LOG_DEBUG(
"[%c%" PRIu64
"] removed from P%" PRIu64
"\n", unit_type,
139 LOG_DEBUG(
"[%c%" PRIu64
":E%d] popped from P%" PRIu64
"\n", unit_type,
143 LOG_DEBUG(
"[%c%" PRIu64
"] popped from P%" PRIu64
"\n", unit_type,