Solaris Dynamic Tracing Guide


void printf(string format, ...) 

Like trace(), the printf() action traces D expressions. However, printf() allows for elaborate printf(3C)-style formatting. Like printf(3C), the parameters consists of a format string followed by a variable number of arguments. By default, the arguments are traced to the directed buffer. The arguments are later formatted for output by dtrace(1M) according to the specified format string. For example, the first two examples of trace() from trace() could be combined in a single printf():

printf("execname is %s; priority is %d", execname, curlwpsinfo->pr_pri);

For more information on printf(), see Chapter 12, Output Formatting.