dtracy – dynamic tracing language|
dtracy [ –d ] prog|
Dtracy is a language for dynamic tracing of the kernel. Essentially,
it allows the user to define small programs in kernel space that
are triggered by certain events (known as probes) upon which they
are executed. |
Dtracy uses an awk(1) inspired syntax. A dtracy program is a series
of statements of one of the following forms
Predicate, if specified, is an expression that must evaluate to a non–zero value for the actions to be executed.
Actions is a semicolon–separated list of statements of one of the
Expressions can use the following variables
Print prints all its arguments, separated by spaces and followed by a newline. Printf prints its arguments using a format string with print(2) syntax. However, there is no need to specify the argument size, e.g. %d works for all integer types.
Statements of the form @name[index] = aggregation–expr collect statistics using a data structure referred to as an aggregation. Each time the statement is evaluated adds another datapoint to the aggregation, which will be printed in tabular form when dtracy finishes. Index is effectively a label for the datapoint; statistics are evaluated over all datapoints of the same index.
Aggregation–expr specifies the type of statistic to be collected.
Available options are
Dtracy appeared in 9front in November, 2018.|