dtrace_aggregate_walk_keyvarsorted() Function

This function walks aggregations sorted by key first and then by the aggregation's variable ID. For example, the following D program would print the minimum, average, and maximum latency for the specified system calls:

syscall::p*:entry
{
       self->ts = timestamp;
}
syscall::p*:return
/ self->ts /
{
       @c[probefunc] = min(timestamp - self->ts);
       @d[probefunc] = avg(timestamp - self->ts);
       @e[probefunc] = max(timestamp - self->ts);  
       self->ts = 0;
}

When the D program is processed by using dtrace_aggregate_walk_keyvarsorted(), output similar to the following example is displayed. This function sorts the system call names first, and then sorts the entries with the same system call name, and then by the aggregation's variable ID. These IDs are assigned in the order in which the aggregation first appears in the D program, so, for example, the ID for @c is less than the ID for @d, which is less than the ID for @e. The system calls are grouped on consecutive lines and the minimum, average, and maximum values print in that order.

p_online                                           968
p_online                                          1051
p_online                                          9685
pollsys                                           7161
pollsys                                      120515277
pollsys                                     4159836122
portfs                                            1668
portfs                                            2583
portfs                                            6948
pset                                              1165
pset                                              1911
pset                                              3369

Note:

The data is not sorted by value, though this example might give that impression.