How to generate Node.js flame diagram on CentOS?

I would like to create a flame graph for my node.js application . Unfortunately, my dev block is OSX (does not support utrace helpers, for the related article), and my production box is CentOS (does not even have dtrace).

I found some signs that something like SystemTap might be an alternative to dtrace , but I was not able to put together an efficient working way to create the appropriate stacks.out file for feeding to the stack.

Does anyone know of a decent tutorial on how to run it and run it? I would prefer it on CentOS (so I can study my production application), but OSX will also suffice.

+7
source share
2 answers

Of the recent Google searches, people are unhappy with SystemTap on Centos, but here is the article http://dtrace.org/blogs/brendan/2012/03/17/linux-kernel-performance-flame-graphs/ referenced by someone FlameGraph github project https://github.com/brendangregg/FlameGraph

I would say, moving towards a real solution, getting a dtrace, rather than relying on work.

+2
source

On Linux, perf_events can be used to check stack traces and support the JIT character. For node.js, you need to run version 0.11.13 or later, with the v8 option --perf-basic-prof. This option creates the / tmp / perf -PID.map file for character translation, which uses performance. After you have punching the stack stacks with JavaScript characters, you can create flame graphics using stackcollapse-perf.pl (from the FlameGraph repo) in the output of the "perf script".

I wrote full instructions here: http://www.brendangregg.com/blog/2014-09-17/node-flame-graphs-on-linux.html

+2
source

All Articles