Note that the args callback is executed only when probe is enabled.

This commit is contained in:
Chris Andrews
2011-02-02 07:44:20 +00:00
parent 17a3591b4b
commit 22ec799e46
+6 -3
View File
@@ -28,9 +28,9 @@ Here's a simple example of creating a provider:
var dtp = d.createDTraceProvider("nodeapp");
dtp.addProbe("probe1", "int", "int");
dtp.addProbe("probe2", "char *");
dtp.enable();
dtp.fire("probe1", function(p) { return [1, 2]; });
dtp.fire("probe2", function(p) { return ["hello, dtrace"]; });
dtp.enable();
dtp.fire("probe1", function() { return [1, 2]; });
dtp.fire("probe2", function() { return ["hello, dtrace"]; });
This example creates a provider called "nodeapp", and adds two
probes. It then enables the provider, at which point the provider
@@ -46,6 +46,9 @@ The probes are then fired, which produces this output:
1 123562 func:probe1 1 2
1 123563 func:probe2 hello, dtrace
Arguments are captured by a callback only executed when the probe is
enabled. This means you can do more expensive work to gather arguments.
## PLATFORM SUPPORT
The nature of this extension means that support must be added for each