mirror of
https://github.com/hanzoai/node-dtrace-provider.git
synced 2026-09-23 23:48:45 +00:00
Note that the args callback is executed only when probe is enabled.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user