3.3 Using Aggregations with User-Space Applications

You can use aggregations to collect statistical data for user-space applications. For
example, the following D program, aggfunc.d, aggregates the number of
function calls across all PHP instances as well as by individual instances:

The -Z option allows you to start dtrace before
any instances of php are running and no matching probes are
available.

Run aggfunc.d in one window and start several instances of
php func.php from other windows. Allow aggfunc.d to
run for several seconds before typing Ctrl-C. The program returns output
such as the following: