{"name":"perf-sym","version":"2.0.2","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":"f46008147babb13199138567cb16532877d0e4b0","_id":"perf-sym@2.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"dist":{"integrity":"sha512-fCr/SpvuO/fOlTnmzcVsmRA0S3LlcBTuVR/CCL2YoOGjejEDDKJH/wdPtCk89xvlXWfLjXp55OOMYZurIlp4/w==","shasum":"6983a84e6083f50eba959d851958b7d395034abc","tarball":"http://registry-npm.ywwl.com/perf-sym/download/perf-sym-2.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRsFr0l4qno5aaSqhdUnu0kWLWjYaV3c3JUnNwmlib1gIhAOSPb5NLdmzOVqNPAwgFiVhygkG6zG3uaHP9SisX1VAF"}],"size":3406,"noattachment":false,"key":"/perf-sym/-/perf-sym-2.0.2.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/perf-sym-2.0.2.tgz_1517858197375_0.03954627923667431"},"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":1517858198373,"_cnpm_publish_time":1517858198373,"dist-tags":{"latest":"2.0.3"}}