void traceCap_(Capability *cap, char *msg, ...) { va_list ap; va_start(ap,msg); #ifdef DEBUG if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) { traceCap_stderr(cap, msg, ap); } else #endif { postCapMsg(cap, msg, ap); } va_end(ap); }
void traceUserMarker(Capability *cap, char *markername) { /* Note: traceUserMarker is special since it has no wrapper (it's called from cmm code), so we check eventlog_enabled and TRACE_user here. */ #ifdef DEBUG if (RtsFlags.TraceFlags.tracing == TRACE_STDERR && TRACE_user) { traceCap_stderr(cap, "User marker: %s", markername); } else #endif { if (eventlog_enabled && TRACE_user) { postUserEvent(cap, EVENT_USER_MARKER, markername); } } dtraceUserMarker(cap->no, markername); }
void traceUserMsg(Capability *cap, char *msg) { /* Note: normally we don't check the TRACE_* flags here as they're checked by the wrappers in Trace.h. But traceUserMsg is special since it has no wrapper (it's called from cmm code), so we check TRACE_user here */ #ifdef DEBUG if (RtsFlags.TraceFlags.tracing == TRACE_STDERR && TRACE_user) { // Use "%s" as format string to ignore format specifiers in msg (#3874). traceCap_stderr(cap, "%s", msg); } else #endif { if (eventlog_enabled && TRACE_user) { postUserEvent(cap, EVENT_USER_MSG, msg); } } dtraceUserMsg(cap->no, msg); }
static void traceFormatUserMsg(Capability *cap, char *msg, ...) { va_list ap; va_start(ap,msg); /* Note: normally we don't check the TRACE_* flags here as they're checked by the wrappers in Trace.h. But traceUserMsg is special since it has no wrapper (it's called from cmm code), so we check TRACE_user here */ #ifdef DEBUG if (RtsFlags.TraceFlags.tracing == TRACE_STDERR && TRACE_user) { traceCap_stderr(cap, msg, ap); } else #endif { if (eventlog_enabled && TRACE_user) { postUserMsg(cap, msg, ap); } } dtraceUserMsg(cap->no, msg); }