{"name":"perf-sym","version":"1.0.0","description":"Translate symbol names generated by `--basic-perf-prof` into JavaScript names","main":"index.js","bin":{"perf-sym":"./cmd.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"David Mark Clements"},"license":"GPL-2.0","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"},"gitHead":"b410501770e7ce6b55e4f4c0c582977e7e752c1f","_id":"perf-sym@1.0.0","_shasum":"2b0def5dea60d34d97fc6c946e44888b3ac33b06","_from":".","_npmVersion":"2.14.17","_nodeVersion":"5.6.0","_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"dist":{"shasum":"2b0def5dea60d34d97fc6c946e44888b3ac33b06","tarball":"http://registry-npm.ywwl.com/perf-sym/download/perf-sym-1.0.0.tgz","integrity":"sha512-d/YHPiXedJGB7gJNMGFv9GBtgktQ+qtww+TyybwsutKJQ9DKcEjxvb8IAtFzmglvmpyJeSPdy0QkwAACa6x+DQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCF9XE9RKlngawg9iWY/ZlBNqMam617K4bSsPll81xqqQIgH99uAK0o2zMkpK0KluiE0+2vxG1Lskdhcf2Hno1iuu4="}],"size":3260,"noattachment":false,"key":"/perf-sym/-/perf-sym-1.0.0.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/perf-sym-1.0.0.tgz_1455464732805_0.5462719756178558"},"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":1455464734837,"_cnpm_publish_time":1455464734837,"dist-tags":{"latest":"2.0.3"}}