{"_id":"trentm-dtrace-provider","_rev":"636266","name":"trentm-dtrace-provider","description":"Native DTrace providers for node.js applications (trentm fork of this)","dist-tags":{"latest":"0.2.4"},"maintainers":[{"name":"trentm","email":"trentm@gmail.com"}],"time":{"modified":"2024-06-26T14:35:32.000Z","created":"2012-11-01T18:56:16.598Z","0.2.4":"2012-11-01T18:56:16.598Z"},"users":{},"author":{"name":"Chris Andrews","email":"chris@nodnol.org"},"repository":{"type":"git","url":"http://github.com/chrisa/node-dtrace-provider.git"},"versions":{"0.2.4":{"name":"trentm-dtrace-provider","version":"0.2.4","description":"Native DTrace providers for node.js applications (trentm fork of this)","keywords":["dtrace"],"homepage":"https://github.com/chrisa/node-dtrace-provider#readme","author":{"name":"Chris Andrews","email":"chris@nodnol.org"},"main":"./dtrace-provider.js","repository":{"type":"git","url":"http://github.com/chrisa/node-dtrace-provider.git"},"scripts":{"install":"node-gyp rebuild"},"gypfile":true,"readmeFilename":"README.md","_id":"trentm-dtrace-provider@0.2.4","dist":{"shasum":"1b0225b66675a31df5d6542dac7790488b02c173","tarball":"http://registry-npm.ywwl.com/trentm-dtrace-provider/download/trentm-dtrace-provider-0.2.4.tgz","integrity":"sha512-r9u4ckU3TMcMG1GrOt85xG62+lPZvrGpM+nmbxXKQFPLbrUX4S+kxly8qOXoBJAHK+4Oq77fwDlWOwucj4nfQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzqrbhDUFvkOozIN5UuCypX9Hl14amUviyVhTmr9296QIgPpUQbVXs2zDfbNik7tKDMyWzOq8hNzy9WpN1jEh/I+E="}],"size":19422,"noattachment":false,"key":"/trentm-dtrace-provider/-/trentm-dtrace-provider-0.2.4.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"trentm","email":"trentm@gmail.com"},"maintainers":[{"name":"trentm","email":"trentm@gmail.com"}],"directories":{},"publish_time":1351796176598,"_cnpm_publish_time":1351796176598}},"readme":"# dtrace-provider - Native DTrace providers for Node.js apps.\n\nThis extension allows you to create native DTrace providers for your\nNode.js applications. That is, to create providers and probes which\nexpose information specific to your application, rather than\ninformation about the node runtime.\n\nYou could use this to expose high-level information about the inner\nworkings of your application, or to create a specific context in which\nto look at information from other runtime or system-level providers. \n\nThe provider is not created in the usual way, by declaring it and then\nchanging the build process to include it, but instead dynamically at\nruntime. This is done entirely in-process, and there is no background\ncompiler or dtrace(1) invocation. The process creating the provider\nneed not run as root.\n\n## INSTALL\n\n    $ npm install dtrace-provider\n\n## EXAMPLE\n\nHere's a simple example of creating a provider:\n\n    var d = require('dtrace-provider');\n\n    var dtp = d.createDTraceProvider(\"nodeapp\");\n    var p1 = dtp.addProbe(\"probe1\", \"int\", \"int\");\n    var p2 = dtp.addProbe(\"probe2\", \"char *\");\n    dtp.enable();\t   \n\nProbes may be fired via the provider object:\n\n    dtp.fire(\"probe1\", function(p) {\n        return [1, 2];\n    });\n    dtp.fire(\"probe2\", function(p) { \n        return [\"hello, dtrace via provider\", \"foo\"];\n    });\n\nor via the probe objects themselves:\n\n    p1.fire(function(p) {\n      return [1, 2, 3, 4, 5, 6];\n    });\n    p2.fire(function(p) {\n      return [\"hello, dtrace via probe\", \"foo\"];\n    });\n\nThis example creates a provider called \"nodeapp\", and adds two\nprobes. It then enables the provider, at which point the provider\nbecomes visible to DTrace.\n\nThe probes are then fired, which produces this output:\n\n    $ sudo dtrace -Z -n 'nodeapp*:::probe1{ trace(arg0); trace(arg1) }'  \\\n                     -n 'nodeapp*:::probe2{ trace(copyinstr(arg0));  }'\n    dtrace: description 'nodeapp*:::probe1' matched 0 probes\n    dtrace: description 'nodeapp*:::probe2' matched 0 probes\n    CPU     ID                    FUNCTION:NAME\n      1 123562                      func:probe1                 1                2\n      1 123563                      func:probe2   hello, dtrace                    \n\nArguments are captured by a callback only executed when the probe is\nenabled. This means you can do more expensive work to gather arguments.\n\nThe maximum number of arguments supported is 32. \n\n## PLATFORM SUPPORT\n\nThis libusdt-based Node.JS module supports 64 and 32 bit processes on\nMac OS X and Solaris-like systems such as Illumos or SmartOS. As more\nplatform support is added to libusdt, those platforms will be\nsupported by this module. See libusdt's status at:\n\n  https://github.com/chrisa/libusdt#readme\n\nFreeBSD is supported in principle but is restricted to only 4 working\narguments per probe.\n\nPlatforms not supporting DTrace (notably, Linux and Windows) may\ninstall this module without building libusdt, with a stub no-op\nimplementation provided for compatibility. This allows cross-platform\nnpm modules to embed probes and include a dependency on this module.\n\n## LIMITATIONS\n \nThe data types supported are \"int\" and \"char *\". Support for\nstructured types is planned, depending on support from the host DTrace\nimplementation for the necessary translators. \n\n## CAVEATS\n\nThere is some overhead to probes, even when disabled. Probes are\nalready using the \"is-enabled\" feature of DTrace to control execution\nof the arguments-gathering callback, but some work still needs to be\ndone before that's checked. This overhead should not be a problem\nunless probes are placed in particularly hot code paths.\n\n## CONTRIBUTING\n\nThe source is available at:\n\n  https://github.com/chrisa/node-dtrace-provider.\n\nFor issues, please use the Github issue tracker linked to the\nrepository. Github pull requests are very welcome. \n\n## OTHER IMPLEMENTATIONS\n\nThis node extension is derived from the ruby-dtrace gem, via the Perl\nmodule Devel::DTrace::Provider, both of which provide the same\nfunctionality to those languages.\n","_attachments":{},"readmeFilename":"README.md","homepage":"https://github.com/chrisa/node-dtrace-provider#readme"}