{"name":"perf-sym","version":"2.0.0","description":"Translate symbol names generated by `--basic-perf-prof` into JavaScript names","main":"index.js","bin":{"perf-sym":"./cmd.js","profile_1ms.d":"./profile_1ms.d"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"David Mark Clements"},"dependencies":{"end-of-stream":"^1.1.0","minimist":"^1.2.0","pump":"^1.0.1","resolve-jit-symbols":"^0.5.0","split2":"^2.0.1"},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/davidmarkclements/perf-sym.git"},"bugs":{"url":"https://github.com/davidmarkclements/perf-sym/issues"},"homepage":"https://github.com/davidmarkclements/perf-sym#readme","license":"MIT","gitHead":"9be19d5775e13d0a1056bb0ed9f30e7682ca8275","_id":"perf-sym@2.0.0","_shasum":"f0f0bcd5973bd6fa2129190740fa40063c367c69","_from":".","_npmVersion":"2.14.17","_nodeVersion":"5.6.0","_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"dist":{"shasum":"f0f0bcd5973bd6fa2129190740fa40063c367c69","tarball":"http://registry-npm.ywwl.com/perf-sym/download/perf-sym-2.0.0.tgz","integrity":"sha512-pP/lem2MbG2ZqnAbHCqHLQ8MW2x4sQc5oNVtW/rxdLfXM6oOuEQr6J/2D8ow5KAuiBHsDjXqBMu/BkQPGIQGqQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHzA4TxdwpOhBSqXIhKAFxhaRQ8+LjRbGH8bdtpJfVOQIgXiXFYYmVeRXCzJqVnWa0VgwJx6Ge7HJwqL8uBP32BeY="}],"size":3435,"noattachment":false,"key":"/perf-sym/-/perf-sym-2.0.0.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/perf-sym-2.0.0.tgz_1456455032759_0.090330756502226"},"readme":"# perf-sym\n\nTranslate symbol names generated by `--basic-perf-prof` into JavaScript names.\n__You can use this tool to generate Flamegraphs on OSX and Linux__.\n\n## Install\n\n```sh\n[sudo] npm i -g perf-sym stackvis\n```\n\n## Usage\n\n```\n  cat stacks.out | perf-sym <pid>\n\n  --relative=[path] -r=[path] [false]\n  --keep-addr -k [false]\n```\n\n\n## Generate a flamegraph\n\n### Instrument your code\n\nYour process needs to shut down properly to generate the symbol map, so\ninstrument it with:\n\n```js\nconsole.error('process.pid', process.pid)\n\n// Cleanly shut down process on SIGINT to ensure that perf-<pid>.map gets flushed\nprocess.on('SIGINT', onSIGINT)\n\nfunction onSIGINT () {\n  // IMPORTANT to log on stderr, to not clutter stdout which is purely for data, i.e. dtrace stacks\n  console.error('Caught SIGINT, shutting down.')\n\n  // close any servers you have opened\n  server.close()\n\n  // clean exit\n  process.exit(0)\n}\n```\n\n### OS X\n\n#### Requirements\n\nRun your application, in one terminal:\n\n```\nnode --perf-basic-prof index.js\n# this should emit the PID of the process to stdout\n```\n\nIn another terminal, run:\n\n```\nsudo profile_1ms.d -p YOURPID  > stacks.out\n```\n\nIn another terminal, run a load/soak test:\n\n```\nwrk -c 100 -d 10 http://localhost:3000\n```\n\nWhen the load/soak test is finished, hit `CTRL-C` in the terminal running\nyour application.\n\nnow run:\n\n```\ncat stacks.out | perf-sym YOURPID | stackvis perf > flamegraph.html\nopen flamegraph.html\n```\n\n### Linux\n\n#### Requirements\n\nRun your application, in one terminal:\n\n```\nnode --perf-basic-prof index.js\n# this should emit the PID of the process to stdout\n```\n\nIn another terminal, run:\n```\nperf record -p YOURPID -i -g -e cycles:u; perf script > stacks.out\n```\n\nIn another terminal, run a load/soak test:\n\n```\nwrk -c 100 -d 10 http://localhost:3000\n```\n\nWhen the load/soak test is finished, hit `CRL-C` in the terminal running\nyour application.\n\nnow run:\n\n```\ncat stacks.out | perf-sym YOURPID | stackvis perf > flamegraph.html\n\nopen flamegraph.html\n```\n\n## Contributors\n\n* David Mark Clements\n* Matteo Collina\n\n## Acknowledgements\n\n* sponsored by nearForm\n* with thanks to [thlorenz](https://github.com/thlorenz) and his [cpuprofilify](https://github.com/thlorenz/cpuprofilify) module for inspiration and snippets and profile_1ms.d\n\n## License\n\nMIT\n","publish_time":1456455035621,"_cnpm_publish_time":1456455035621,"dist-tags":{"latest":"2.0.3"}}