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); }