August 2011
Intermediate to advanced
552 pages
23h 48m
English
A provider is a facility that publishes the probes that you use in your D script. There are a number of built-in providers.
These are actually called dtrace:::BEGIN and dtrace:::END, but they are usually used as just BEGIN and END. The BEGIN probe fires when the D script begins execution, and the END probe fires when the script finishes. Example 9.2 shows using the BEGIN and END probes.
Example 9.2. begin-end.d
BEGIN
{
trace("begin the beguine");
exit(0);
}
END
{
trace ("that's all, folks...");
}
Run it:
$ sudo dtrace -s begin-end.d dtrace: script 'begin-end.d' ...Read now
Unlock full access