process_requests (); \
} while (0)
-#define EXIT_LOG EXIT_LOG_EXPLICIT (TRUE, TRUE)
+// Pass these to EXIT_LOG_EXPLICIT () for easier reading.
+#define DO_SEND TRUE
+#define NO_SEND FALSE
+#define DO_REQUESTS TRUE
+#define NO_REQUESTS FALSE
+
+#define EXIT_LOG EXIT_LOG_EXPLICIT (DO_SEND, DO_REQUESTS)
static volatile gint32 buffer_rwlock_count;
static volatile gpointer buffer_rwlock_exclusive;
emit_event (logbuffer, TYPE_META | TYPE_SYNC_POINT);
emit_byte (logbuffer, type);
- EXIT_LOG_EXPLICIT (FALSE, FALSE);
+ EXIT_LOG_EXPLICIT (NO_SEND, NO_REQUESTS);
send_log_unsafe (FALSE);
}
emit_obj (logbuffer, refs [i]);
}
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
return 0;
}
emit_event (logbuffer, TYPE_HEAP_START | TYPE_HEAP);
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
mono_gc_walk_heap (0, gc_reference, NULL);
emit_event (logbuffer, TYPE_HEAP_END | TYPE_HEAP);
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
}
static void
emit_value (logbuffer, extra_info [i]);
}
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
}
static void
emit_byte (logbuffer, ev);
emit_byte (logbuffer, generation);
- EXIT_LOG_EXPLICIT (FALSE, FALSE);
+ EXIT_LOG_EXPLICIT (NO_SEND, NO_REQUESTS);
switch (ev) {
case MONO_GC_EVENT_START:
emit_event (logbuffer, TYPE_GC_RESIZE | TYPE_GC);
emit_value (logbuffer, new_size);
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
}
// If you alter MAX_FRAMES, you may need to alter SAMPLE_BLOCK_SIZE too.
for (int i = 0; i < num; ++i)
emit_obj (logbuffer, objects [i]);
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
}
static void
emit_byte (logbuffer, TYPE_THREAD);
emit_ptr (logbuffer, (void*) tid);
- EXIT_LOG_EXPLICIT (FALSE, FALSE);
+ EXIT_LOG_EXPLICIT (NO_SEND, NO_REQUESTS);
MonoProfilerThread *thread = PROF_TLS_GET ();
memcpy (logbuffer->cursor, filename, len);
logbuffer->cursor += len;
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
}
#endif
memcpy (logbuffer->cursor, name, len);
logbuffer->cursor += len;
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
}
/* ELF code crashes on some systems. */
agent->emitted = 1;
}
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
done:
mono_os_mutex_unlock (&counters_mutex);
emit_value (logbuffer, 0);
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
mono_os_mutex_unlock (&counters_mutex);
}
pcagent->emitted = 1;
}
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
}
static gboolean
emit_value (logbuffer, 0);
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
done:
mono_os_mutex_unlock (&counters_mutex);
emit_uvalue (logbuffer, method_id);
emit_value (logbuffer, coverage_data->len);
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
for (i = 0; i < coverage_data->len; i++) {
CoverageEntry *entry = (CoverageEntry *)coverage_data->pdata[i];
emit_uvalue (logbuffer, entry->line);
emit_uvalue (logbuffer, entry->column);
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
}
method_id++;
emit_uvalue (logbuffer, fully_covered);
emit_uvalue (logbuffer, partially_covered);
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
g_free (class_name);
}
emit_uvalue (logbuffer, fully_covered);
emit_uvalue (logbuffer, partially_covered);
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
}
static void
memcpy (logbuffer->cursor, name, nlen);
logbuffer->cursor += nlen;
- EXIT_LOG_EXPLICIT (FALSE, FALSE);
+ EXIT_LOG_EXPLICIT (NO_SEND, NO_REQUESTS);
mono_free (name);
for (int i = 0; i < sample->count; ++i)
emit_method (logbuffer, sample->frames [i].method);
- EXIT_LOG_EXPLICIT (TRUE, FALSE);
+ EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
mono_thread_hazardous_try_free (sample, reuse_sample_hit);