The dtTraceBuf macro can be used instead of dtTracen. It copies a single buffer, pointed to by buf and of length len, to the trace buffer, and advances the buffer pointer. When the trace buffer becomes full, it is flushed to disk and the buffer pointer is reset to the start of the trace buffer.
dtTraceBuf(dt *dtobj, char *buf, int len)